feat: replace setuptools with uv - #3516
Conversation
f0aafcc to
ec479f0
Compare
|
For the record, I also attempted the same thing with Poetry as suggested in #3469 (comment) but ultimately abandoned Poetry in favor of uv for several reasons:
|
0430c91 to
b550c0d
Compare
Replace setuptools with uv to streamline dependency management. This also allows for environment-specific requirements, which Aider needs for several use cases.
b550c0d to
bdce119
Compare
|
@paul-gauthier What do you think of this approach? |
| ### Using `uv` | ||
|
|
||
| ``` | ||
| uv venv /path/to/venv |
There was a problem hiding this comment.
One of the biggest benefits of uv is that you don't have to think about virtual environments at all, since uv manages it automatically. uv venv is largely intended for legacy workflows. There is no need to scaffold, activate, or deactivate virtual environments anymore.
I suggest avoiding the uv venv and uv pip commands for this reason.
|
Honestly, this looks so much cleaner than current setup... |
| @@ -0,0 +1 @@ | |||
| 3.9 | |||
There was a problem hiding this comment.
Shouldn’t this decision be left to each developer’s local environment? Supporting multiple Python versions is inconvenient when one is hard-coded in the Git repository.
There was a problem hiding this comment.
For a package that wants to support multiple Pythons, pinning the oldest supported Python helps enforce the greatest common divisor in terms of language and API level. It’s just a guardrail for the developer so they can’t inadvertently use newer language features, which would break the library for users with older Pythons.
It also makes sure that every developer gets the same linting and typechecking findings.
With that being said, the file is only a hint for tools at venv creation time. If a developer absolutely must override this (even though I think this is a bad idea), they’re free to ignore this file and just create a custom venv with a Python version of their choosing.
There was a problem hiding this comment.
Yes, indeed. I assumed this file would take precedence and didn’t realize it can be overridden by the UV_PYTHON environment variable or the --python flag. It might be worth noting this in CONTRIBUTING.md.
This PR replaces setuptools with uv to streamline dependency management.
This also allows for environment-specific requirements, which Aider needs for several use cases.
See #3469 (comment) for background and rationale.
@paul-gauthier Let me know what you think of this approach.
To do