Skip to content
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

Migrate from poetry to uv #42

Merged
merged 17 commits into from
Sep 17, 2024
Merged

Migrate from poetry to uv #42

merged 17 commits into from
Sep 17, 2024

Conversation

jorenham
Copy link
Owner

@jorenham jorenham commented Sep 3, 2024

.github/workflows/ci.yml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
@jorenham
Copy link
Owner Author

jorenham commented Sep 8, 2024

I don't think we can use UV to test on python 3.13 yet 🤔
astral-sh/uv#6697

@jorenham
Copy link
Owner Author

jorenham commented Sep 8, 2024

I notices that uv build produces an sdist archive that's quite a bit larger than that of poetry build:

-rw-r--r-- 1 joren joren 5,6K sep  2 15:27 mainpy-1.4.0-py3-none-any.whl
-rw-rw-r-- 1 joren joren 7,0K sep  2 15:27 mainpy-1.4.0.tar.gz
-rw-r--r-- 1 joren joren 5,6K sep  8 19:55 mainpy-1.4.1.dev0-py3-none-any.whl
-rw-r--r-- 1 joren joren  34K sep  8 19:55 mainpy-1.4.1.dev0.tar.gz

It appears that uv build also includes the irrelevant files in the sdist, such as .github/ and tests/, so basically everything in the repo...


edit

Oh and it messes up the "last-modified" meta field in the archive too:

uv:

❯ lesspipe ./mainpy-1.4.1.dev0.tar.gz
-rw-r--r-- 0/0             256 2020-02-02 01:00 mainpy-1.4.1.dev0/.editorconfig
-rw-r--r-- 0/0             265 2020-02-02 01:00 mainpy-1.4.1.dev0/.markdownlint.yaml
-rw-r--r-- 0/0            1966 2020-02-02 01:00 mainpy-1.4.1.dev0/.pre-commit-config.yaml
-rw-r--r-- 0/0            2937 2020-02-02 01:00 mainpy-1.4.1.dev0/CODE_OF_CONDUCT.md
-rw-r--r-- 0/0            8950 2020-02-02 01:00 mainpy-1.4.1.dev0/CONTRIBUTING.md
-rw-r--r-- 0/0             340 2020-02-02 01:00 mainpy-1.4.1.dev0/SECURITY.md
-rw-r--r-- 0/0           53240 2020-02-02 01:00 mainpy-1.4.1.dev0/uv.lock
-rw-r--r-- 0/0              17 2020-02-02 01:00 mainpy-1.4.1.dev0/.github/FUNDING.yml
-rw-r--r-- 0/0             367 2020-02-02 01:00 mainpy-1.4.1.dev0/.github/dependabot.yml
-rw-r--r-- 0/0            1963 2020-02-02 01:00 mainpy-1.4.1.dev0/.github/workflows/ci.yml
-rw-r--r-- 0/0             241 2020-02-02 01:00 mainpy-1.4.1.dev0/.vscode/extensions.json
-rw-r--r-- 0/0             216 2020-02-02 01:00 mainpy-1.4.1.dev0/.vscode/settings.json
-rw-r--r-- 0/0             136 2020-02-02 01:00 mainpy-1.4.1.dev0/examples/click_command.py
-rw-r--r-- 0/0             342 2020-02-02 01:00 mainpy-1.4.1.dev0/examples/click_group.py
-rw-r--r-- 0/0             215 2020-02-02 01:00 mainpy-1.4.1.dev0/examples/functools_cache.py
-rw-r--r-- 0/0               0 2020-02-02 01:00 mainpy-1.4.1.dev0/examples/py.typed
-rw-r--r-- 0/0             179 2020-02-02 01:00 mainpy-1.4.1.dev0/examples/simple_async.py
-rw-r--r-- 0/0             137 2020-02-02 01:00 mainpy-1.4.1.dev0/examples/simple_sync.py
-rw-r--r-- 0/0             145 2020-02-02 01:00 mainpy-1.4.1.dev0/examples/typer_command.py
-rw-r--r-- 0/0            5036 2020-02-02 01:00 mainpy-1.4.1.dev0/mainpy/__init__.py
-rw-r--r-- 0/0               0 2020-02-02 01:00 mainpy-1.4.1.dev0/mainpy/py.typed
-rw-r--r-- 0/0               0 2020-02-02 01:00 mainpy-1.4.1.dev0/tests/__init__.py
-rw-r--r-- 0/0              30 2020-02-02 01:00 mainpy-1.4.1.dev0/tests/conftest.py
-rw-r--r-- 0/0             874 2020-02-02 01:00 mainpy-1.4.1.dev0/tests/test_integration.py
-rw-r--r-- 0/0            2660 2020-02-02 01:00 mainpy-1.4.1.dev0/tests/test_mainpy.py
-rw-r--r-- 0/0             217 2020-02-02 01:00 mainpy-1.4.1.dev0/.gitignore
-rw-r--r-- 0/0            1068 2020-02-02 01:00 mainpy-1.4.1.dev0/LICENSE
-rw-r--r-- 0/0            5272 2020-02-02 01:00 mainpy-1.4.1.dev0/README.md
-rw-r--r-- 0/0            5781 2020-02-02 01:00 mainpy-1.4.1.dev0/pyproject.toml
-rw-r--r-- 0/0            6504 2020-02-02 01:00 mainpy-1.4.1.dev0/PKG-INFO

poetry:

❯ lesspipe ./mainpy-1.4.0.tar.gz
-rw-r--r-- 0/0            1068 2022-03-15 20:48 mainpy-1.4.0/LICENSE
-rw-r--r-- 0/0            5272 2024-08-19 19:15 mainpy-1.4.0/README.md
-rw-r--r-- 0/0            5121 2024-09-02 14:58 mainpy-1.4.0/mainpy/__init__.py
-rw-r--r-- 0/0               0 2022-04-02 16:23 mainpy-1.4.0/mainpy/py.typed
-rw-r--r-- 0/0            6442 2024-09-02 15:24 mainpy-1.4.0/pyproject.toml
-rw-r--r-- 0/0            6597 1970-01-01 01:00 mainpy-1.4.0/PKG-INFO

@jorenham jorenham added the deferred Postponed until some condition is met label Sep 8, 2024
@jorenham
Copy link
Owner Author

jorenham commented Sep 8, 2024

Given the lack of uv publish, and the bugs in uv build, I think it's better to wait until those are resolved before swtiching from poetry to uv.

CONTRIBUTING.md Outdated Show resolved Hide resolved
@KotlinIsland
Copy link
Collaborator

KotlinIsland commented Sep 8, 2024

I don't think we can use UV to test on python 3.13 yet 🤔 astral-sh/uv#6697

Alternatively, the official GitHub setup-python action can be used. This can be faster, because GitHub caches the Python versions alongside the runner.

https://docs.astral.sh/uv/guides/integration/github/#setting-up-python

additionally:
indygreg/python-build-standalone#319

@KotlinIsland
Copy link
Collaborator

KotlinIsland commented Sep 8, 2024

It appears that uv build also includes the irrelevant files in the sdist, such as .github/ and tests/, so basically everything in the repo...

i wonder if this is regarding differing selection rules

edit
people like that kind of thing i think:
https://discuss.python.org/t/should-sdists-include-docs-and-tests/14578/2

re-edit
so this is the behaviour of hatchling, not uv. any issue would be a hatchling issue. i wonder if we could use poetry as a build backend instead?

@jorenham jorenham removed the deferred Postponed until some condition is met label Sep 16, 2024
@jorenham
Copy link
Owner Author

@KotlinIsland I'm sold on uv. You can merge this if you want

@KotlinIsland KotlinIsland merged commit 8df78e0 into main Sep 17, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants