Skip to content

feat: introduce blocklist of unwanted requirements - #3469

Closed
claui wants to merge 1 commit into
Aider-AI:mainfrom
claui:blocklist
Closed

feat: introduce blocklist of unwanted requirements#3469
claui wants to merge 1 commit into
Aider-AI:mainfrom
claui:blocklist

Conversation

@claui

@claui claui commented Mar 9, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

claui commented Mar 9, 2025

Copy link
Copy Markdown
Contributor Author

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

claui commented Mar 9, 2025

Copy link
Copy Markdown
Contributor Author

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

@claui claui mentioned this pull request Mar 13, 2025
8 tasks
@claui

claui commented Mar 13, 2025

Copy link
Copy Markdown
Contributor Author

Closing in favor of #3516.

@claui claui closed this Mar 13, 2025
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