-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from di/updates
Normalize filenames, and other QOL updates
- Loading branch information
Showing
8 changed files
with
157 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.11.0 | ||
3.11.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
default: | ||
@echo "Call a specific subcommand:" | ||
@echo | ||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null\ | ||
| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}'\ | ||
| sort\ | ||
| egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | ||
@echo | ||
@exit 1 | ||
|
||
# Optionally overriden by the user, if they're using a virtual environment manager. | ||
VENV ?= env | ||
|
||
# On Windows, venv scripts/shims are under `Scripts` instead of `bin`. | ||
VENV_BIN := $(VENV)/bin | ||
ifeq ($(OS),Windows_NT) | ||
VENV_BIN := $(VENV)/Scripts | ||
endif | ||
|
||
$(VENV)/pyvenv.cfg: | ||
# Create our Python 3 virtual environment | ||
python3 -m venv $(VENV) | ||
$(VENV_BIN)/python -m pip install --upgrade pip pip-tools tox | ||
|
||
.PHONY: tests | ||
tests: $(VENV)/pyvenv.cfg | ||
. $(VENV_BIN)/activate && \ | ||
tox | ||
|
||
requirements.txt: requirements.in $(VENV)/pyvenv.cfg | ||
. $(VENV_BIN)/activate && \ | ||
pip-compile --allow-unsafe --output-file=$@ $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
aiobotocore | ||
aiohttp | ||
gunicorn | ||
packaging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import pytest | ||
|
||
from conveyor.views import _normalize_filename | ||
|
||
|
||
@pytest.mark.asyncio | ||
@pytest.mark.parametrize( | ||
"filename, expected", | ||
[ | ||
("Flask-Common-0.2.0.tar.gz", "flask-common-0.2.tar.gz"), | ||
("websocket_client-0.52.0.tar.gz", "websocket-client-0.52.tar.gz"), | ||
("Sphinx-7.1.1.tar.gz", "sphinx-7.1.1.tar.gz"), | ||
("Foo_Bar-24.0.0.0.tar.gz", "foo-bar-24.tar.gz"), | ||
("Foo_Bar-24.0.0.0-py3-none-any.whl", "foo-bar-24-py3-none-any.whl"), | ||
("foo-24-py3-none-any.whl", "foo-24-py3-none-any.whl"), | ||
( | ||
"spam-1.0-420yolo-py3-none-any.whl", | ||
"spam-1-420yolo-py3-none-any.whl", | ||
), # Build tag | ||
("Foo_bar-24.0.0.0.zip", "foo-bar-24.zip"), | ||
], | ||
) | ||
async def test_normalize_filename(filename, expected): | ||
result = await _normalize_filename(filename) | ||
|
||
assert result == expected |