-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate from poetry to uv
#146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
26e3750
Migrate from `poetry` to `uv`
tothtamas28 3c58212
Fix linting issues
tothtamas28 aea8686
Fix `SyntaxWarning`
tothtamas28 6b7a5a8
Run `pyupgrade`
tothtamas28 910b4fa
Run `black`
tothtamas28 956fe17
Adjust workflows
tothtamas28 a916e58
migrate nix derivation from poetry to uv
juliankuners c4354e4
update uv2nix and pyproject-build-systems in update workflow
juliankuners da79bbd
version bump
juliankuners File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,6 +1,7 @@ | ||
| [flake8] | ||
| max-line-length = 120 | ||
| extend-select = B9 | ||
| extend-select = B9, TC1 | ||
| extend-ignore = B950,E,W1,W2,W3,W4,W5 | ||
| per-file-ignores = | ||
| */__init__.py: F401 | ||
| type-checking-strict = true |
This file contains hidden or 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 hidden or 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 hidden or 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,2 +1,3 @@ | ||
| /dist/ | ||
| __pycache__/ | ||
| .coverage |
This file contains hidden or 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,57 +1,100 @@ | ||
| .PHONY: default all clean build install \ | ||
| poetry-install \ | ||
| test test-unit \ | ||
| format isort autoflake black \ | ||
| check check-isort check-autoflake check-black check-flake8 check-mypy | ||
| UV := uv | ||
| UV_RUN := $(UV) run -- | ||
|
|
||
|
|
||
| default: check test-unit | ||
|
|
||
| all: check cov | ||
|
|
||
| .PHONY: clean | ||
| clean: | ||
| rm -rf dist .mypy_cache | ||
| rm -rf dist .coverage cov-* .mypy_cache .pytest_cache | ||
| find -type d -name __pycache__ -prune -exec rm -rf {} \; | ||
|
|
||
| .PHONY: build | ||
| build: | ||
| poetry build | ||
| $(UV) build | ||
|
|
||
| poetry-install: | ||
| poetry install | ||
|
|
||
| POETRY_RUN := poetry run | ||
| # Tests | ||
|
|
||
| TEST_ARGS := | ||
|
|
||
| # Tests | ||
| test: test-all | ||
|
|
||
| .PHONY: test-all | ||
| test-all: | ||
| $(UV_RUN) pytest src/tests --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS) | ||
|
|
||
| .PHONY: test-unit | ||
| test-unit: | ||
| $(UV_RUN) pytest src/tests/unit --maxfail=1 --verbose $(TEST_ARGS) | ||
|
|
||
| .PHONY: test-integration | ||
| test-integration: | ||
| $(UV_RUN) pytest src/tests/integration --maxfail=1 --verbose --durations=0 --numprocesses=4 --dist=worksteal $(TEST_ARGS) | ||
|
|
||
|
|
||
| # Coverage | ||
|
|
||
| test: test-unit | ||
| COV_ARGS := | ||
|
|
||
| test-unit: poetry-install | ||
| $(POETRY_RUN) python -m unittest discover tests --failfast --verbose | ||
| cov: cov-all | ||
|
|
||
| cov-%: TEST_ARGS += --cov=kup --no-cov-on-fail --cov-branch --cov-report=term | ||
|
|
||
| cov-all: TEST_ARGS += --cov-report=html:cov-all-html $(COV_ARGS) | ||
| cov-all: test-all | ||
|
|
||
| cov-unit: TEST_ARGS += --cov-report=html:cov-unit-html $(COV_ARGS) | ||
| cov-unit: test-unit | ||
|
|
||
| cov-integration: TEST_ARGS += --cov-report=html:cov-integration-html $(COV_ARGS) | ||
| cov-integration: test-integration | ||
|
|
||
|
|
||
| # Checks and formatting | ||
|
|
||
| format: autoflake isort black | ||
| check: check-flake8 check-mypy check-autoflake check-isort check-black | ||
|
|
||
| check-flake8: poetry-install | ||
| $(POETRY_RUN) flake8 src | ||
| .PHONY: check-flake8 | ||
| check-flake8: | ||
| $(UV_RUN) flake8 src | ||
|
|
||
| .PHONY: check-mypy | ||
| check-mypy: | ||
| $(UV_RUN) mypy src | ||
|
|
||
| .PHONY: autoflake | ||
| autoflake: | ||
| $(UV_RUN) autoflake --quiet --in-place src | ||
|
|
||
| .PHONY: check-autoflake | ||
| check-autoflake: | ||
| $(UV_RUN) autoflake --quiet --check src | ||
|
|
||
| .PHONY: isort | ||
| isort: | ||
| $(UV_RUN) isort src | ||
|
|
||
| check-mypy: poetry-install | ||
| $(POETRY_RUN) mypy src | ||
| .PHONY: check-isort | ||
| check-isort: | ||
| $(UV_RUN) isort --check src | ||
|
|
||
| autoflake: poetry-install | ||
| $(POETRY_RUN) autoflake --quiet --in-place src | ||
| .PHONY: black | ||
| black: | ||
| $(UV_RUN) black src | ||
|
|
||
| check-autoflake: poetry-install | ||
| $(POETRY_RUN) autoflake --quiet --check src | ||
| .PHONY: check-black | ||
| check-black: | ||
| $(UV_RUN) black --check src | ||
|
|
||
| isort: poetry-install | ||
| $(POETRY_RUN) isort src | ||
|
|
||
| check-isort: poetry-install | ||
| $(POETRY_RUN) isort --check src | ||
| # Optional tools | ||
|
|
||
| black: poetry-install | ||
| $(POETRY_RUN) black src | ||
| SRC_FILES := $(shell find src -type f -name '*.py') | ||
|
|
||
| check-black: poetry-install | ||
| $(POETRY_RUN) black --check src | ||
| .PHONY: pyupgrade | ||
| pyupgrade: | ||
| $(UV_RUN) pyupgrade --py310-plus $(SRC_FILES) |
This file contains hidden or 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 hidden or 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 @@ | ||
| c8cf711802cb00b2e05d5c54d3486fce7bfc8f7c |
This file contains hidden or 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 @@ | ||
| 0.9.9 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.