-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Support config defaults using .pip-tools.toml
or pyproject.toml
#1863
Support config defaults using .pip-tools.toml
or pyproject.toml
#1863
Conversation
d097397
to
b73731a
Compare
@j00bar you can't trigger CI until you have at least one commit in the repo.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I was able to skim through the patch from mobile and noticed a few areas that might need some love...
Though, I'm sure someone will check the logic too. Reviews are easier from an actual computer.
I'll also approve the CI in just a bit to see how it's doing...
The PyPy failures seem unrelated... Though, they'll probably need sorting out separately before this PR could be mergeable. I wonder if bumping the interpreter version would have any effect. |
9262e29
to
b4e57f4
Compare
Thank you for the detailed feedback!
|
b4e57f4
to
6734ea0
Compare
Yes. Each parameter follows the order of precedence independently. The full configuration, like most command-line utilities, uses a mosaic of command-line set arguments, config file settings, and hardcoded defaults.
I don't agree. Projects use these config files to set defaults that should apply to the whole project to make the preferred way of compiling/syncing requirements be the easiest way to compile/sync requirements. That encourages consistency transparently. As the steward of many projects and having to have created automation to fail a PR when it fails consistency in the compiled requirements, I want it as laborious as possible to deviate from the project's default settings. And if there are deviations I often make, I'm going to make an additional config file with a non-default config file name. But you're a maintainer of this one - it's up to you if you want that - to me it's a foot-gun so I'm not interested in helping with that one. |
@AndydeCleyre I wonder why is this backwards incompatible? |
I still don't know the answer to this question, but this is what I was thinking of:
|
@j00bar will using |
I've noticed that the
Also |
I'm inclined to think that this update does not represent a breaking change. The current update does not interfere with pip-compile's default behavior, nor does it require any modifications to existing calls. Running pip-compile without any arguments will still function as it does in the current release and shouldn't break any existing pipelines, as there were no configurations before. However, I believe we should consider adding support for Are there any objections if I remove the corresponding label and proceed with the version 6.14.0 (#1892) release process? |
I also don't think it's a breaking change, since no configs existed in projects using pip-tools prior to this release, hence adding one must be treated as an explicit opt-in to this feature, similar to the The absolute path is indeed unpleasant and the |
Ok, remove the breaking label and status. I would really like to know how to consistently protect myself from unwanted configs once this is released. And yes, that absolute path is going to be a paper cut for any teams that include the header and run pip-compile on different systems. IMO all paths in the txt output should be relative to the txt file. |
@AndydeCleyre thanks! I've prepared two PRs to address #1863 (comment):
Let's get this merged before the release. |
Released as part of pip-tools v6.14.0. |
Hey @j00bar, FYI there's some post-release adjustment and bugfixing efforts going on, in case you wanted to keep an eye on the changes, here's some:
|
When using |
Thanks! I got laid off last month, which took my attention/interest/priorities in other directions - grateful for the continued stewardship of this feature. |
See these lines: Lines 656 to 657 in 776c3fa
Maybe this could be simplified for
I think it's explained properly under the configuration section. |
That was the original implementation which, in review, was rejected in favor of consistency. |
Thanks. I thought there was a discussion about making it like ruff, but I can't find it so maybe dreamed it. From ruff's docs:
|
FTR, that discussion that you're recalling was about the need to have the section header in all of the files or not. It was you who mentioned Ruff in that context: #1863 (comment). And I made an argument that it's more consistent to have this header in all files: #1863 (comment). It makes it easier to copy the section over between different files. And now I think that when the end-users want to have several sections in their non-pyproject config, they can only do so when there are sections in the file. |
Supports use of a
.pip-tools.toml
,pyproject.toml
, or other explicitly specified TOML file to set configuration defaults forpip-compile
andpip-sync
.Fixes #604.
Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.