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

Use uv for python project management #184

Open
vhdirk opened this issue Oct 5, 2024 · 3 comments
Open

Use uv for python project management #184

vhdirk opened this issue Oct 5, 2024 · 3 comments
Labels
contributing Request to contribute

Comments

@vhdirk
Copy link

vhdirk commented Oct 5, 2024

I just forked your repo with the goal of fixing some bugs I'm seeing. The first thing that struck me is that you're not using any project manager, like poetry, pdm or uv. I've been working with uv for a while now, and I absolutely love it. It's insanely fast!
Would you be open to a PR for this?

@vhdirk vhdirk added the contributing Request to contribute label Oct 5, 2024
@Casvt
Copy link
Owner

Casvt commented Oct 5, 2024

What does it add/improve? Install the modules in requirements-dev.txt and done.

What bugs have you noticed?

@vhdirk
Copy link
Author

vhdirk commented Oct 6, 2024

What I find a big improvement of uv over requirements[-dev].txt:

  • It's significantly faster
  • it encourages contributors to use virtualenvs. A simple uv sync sets up a virtualenv with all requirements immediately installed
  • You can enforce a requirement on the python version used (min, exact, max, etc). If not detected on the system, uv can automatically download it and set it up
  • When using uv add <new dependency> it automatically checks compatibility with other packages and the requested python version
  • It makes publishing to pypi significantly easier: https://docs.astral.sh/uv/guides/publish/#publishing-your-package
  • There's support for optional dependency groups (although at this point, that is not much added value for Kapowarr)

While none of these arguments on their own make a great case for adopting uv, I do think the usability and how integrated it is makes it a very useful tool to adopt.
I've been developing with python for at least 15 years, and for me, uv really is a breath of fresh air. Python dependency management has always been a bit of a pain, but after all these years, this thing has fixed that for me. ( oh yeah, I am not affiliated with uv/astral at all. I just like it :) )

@Casvt
Copy link
Owner

Casvt commented Oct 6, 2024

For me personally (and >99% of development is done by me), there is no need for uv. However, that does not mean that it's not useful for contributors.

If you set up the (configuration) files uv needs to work properly and update the CONTRIBUTING.md file so that everyone can follow commands to develop using uv, then I'm fine with it. uv must not become neccesary in order to develop the project though.

Just add the configuration files that need to be present so that users can initialise uv and have it be ready for use. Seems like that means some additions to the pyproject.toml file, a .python-version file and uv.lock file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributing Request to contribute
Projects
None yet
Development

No branches or pull requests

2 participants