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

feat: introduce blocklist of unwanted requirements #3469

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

claui
Copy link
Contributor

@claui claui commented Mar 9, 2025

This PR introduces a declarative blocklist and associated script. The idea is to generalize the tree-sitter.in technique from 25da067, because we’re going to need that same technique for two or maybe three upcoming changes:

  1. fixing pydub for Python 3.13;
  2. running pip-compile.sh on non-Apple platforms, and
  3. exploring a complex platform dependent versioning path (whose usefulness is still up to debate).

Commit 25da067 introduced a manually curated fragment for `tree-sitter`
to work around shortcomings [1] of pip-compile.

Generalize this technique by introducing a declarative blocklist and
associated script.

This feature is going to be needed by three unrelated features: fixing
`pydub`, running `pip-compile.sh` on non-Apple platforms, and exploring
the "complex platform dependent versioning path" proposed in PR Aider-AI#3444
[2].

As an added benefit, the blocklist script:

- allows comments in the blocklist; and

- removes extraneous comments from `requirements.txt`, avoiding
  misattribution and confusion if a human looks at them.

[1]: jazzband/pip-tools#639 (comment)

[2]: Aider-AI#3444 (comment)
@paul-gauthier
Copy link
Collaborator

Thanks for continuing to push this ahead.

I thought about this exact thing. Special casing tree sitter smelled bad to me.

My instinct is there must be a proper way to do this sort of complex environment-sensitive dependency management. After quickly looking at uv, poetry and other tools couldn't convince myself that they definitely solved this need in the more general complex case. So it didn't seem worth the work to switch to them at the moment.

I think before building and adopting a complex, bespoke system for this we would need to spend more time confirming if there is a sensible existing tool/approach.

This is all further complicated because of the way aider allows helpful/seamless installs and upgrades. See helper functions in aider/utils.py. These features seem to really benefit users, reduce problems they encounter and reduce GitHub issues they file against aider. It would be ideal if proposed dependency management solutions didn't disrupt that functionality.

So with all this in mind, I decided to special case tree-sitter for the moment. But was reluctant to continue that pattern without being certain there isn't a better way.

@claui
Copy link
Contributor Author

claui commented Mar 9, 2025

After quickly looking at uv, poetry and other tools couldn't convince myself that they definitely solved this need in the more general complex case.

Section Using environment markers in Poetry’s docs suggests to me that it might.

I’m going to experiment with Poetry a little to see whether this might be worth a switch.

@claui
Copy link
Contributor Author

claui commented Mar 9, 2025

There’s a thread on Python Discourse about how Poetry pulls off that feat: Insights into how poetry.lock works cross platform

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