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

Replace uv pip compile/sync/install to uv lock/lock -U/sync/add #25

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Di-Is
Copy link

@Di-Is Di-Is commented Aug 22, 2024

See #24

@Di-Is Di-Is force-pushed the main branch 2 times, most recently from 1f60503 to c037496 Compare August 22, 2024 11:32
Makefile Outdated
@@ -122,25 +122,21 @@ TOOLS := "$(TOOLS) uv"
uv-tooling:
pip install --user uv
uv-import:
cat requirements.txt
cd uv; mkdir -p app; touch app/__init__.py; uv add --frozen -r ../requirements.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not this?

cd uv; uv init; uv add --frozen --requirements ../requirements.txt

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assumption is that the processing time for generating lock files for cross-platform is affected by the value of requires-python in pyproject.toml.
Therefore, this condition should be aligned in poetry, pdm, and uv.

In the pyproject.toml of poetry and pdm, a condition equivalent to “requires-python>=3.11” is specified.
To generate a similar pyproject.toml with uv init, you need to run uv init --python 3.11.

So, the values of requires-python (and also its source) are scattered in pyproject.toml for poetry and pdm, and in Makefile for uv.

I have decided not to use uv init, because I think it makes maintenance worse.

Copy link
Author

@Di-Is Di-Is Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, it might be better to revise it as follows, as the intention of the implementation may be difficult to convey.

  • Add empty file to uv/app/__init__.py in the repository
  • Change the indicated part to cd uv; uv add --frozen --requirements ../requirements.txt.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it would be more concise to remove the following from pyproject.toml in uv [build-system].
It is the build-backend hatchling that needs init.py.
Therefore, the deletion of [build-system] eliminates the need for init.py.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
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.

3 participants