jorenham / mainpy

Simplify your project's main entrypoint definition with @main
https://pypi.org/project/mainpy/
MIT License
6 stars 2 forks source link

Migrate from poetry to uv #42

Closed jorenham closed 2 months ago

jorenham commented 2 months ago

cc @KotlinIsland

jorenham commented 2 months ago

I don't think we can use UV to test on python 3.13 yet 🤔 https://github.com/astral-sh/uv/issues/6697

jorenham commented 2 months ago

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 commented 2 months ago

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.

KotlinIsland commented 2 months ago

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: https://github.com/indygreg/python-build-standalone/pull/319

KotlinIsland commented 2 months ago

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 commented 2 months ago

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