-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
Config file discovery doesn't work as intended #2096
Comments
un-def
added a commit
to un-def/pip-tools
that referenced
this issue
May 31, 2024
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As it stated in the documentation, pip-tools look for the configuration file “in the same directory as your requirements input files”. However, due to the way click works, it's not true:
--config
(and--no-config
) is declared as eager: https://github.com/jazzband/pip-tools/blob/7.4.1/piptools/scripts/options.py#L317-L333--config
's callbackoverride_defaults_from_config_file
tries to get thesrc_files
param value to compute the config path relative to the source files: https://github.com/jazzband/pip-tools/blob/7.4.1/piptools/utils.py#L543src_files
is always empty. From the click documentation: “All eager parameters are evaluated before all non-eager parameters, but again in the order as they were provided on the command line by the user.”select_config_file
falls back to the current working dir as a config file location: https://github.com/jazzband/pip-tools/blob/7.4.1/piptools/utils.py#L627-L630Environment Versions
Python 3.12.3
pip 24.0
pip-compile, version 7.4.1
Steps to replicate
requirements/
withrequirements.in
..pip-tools.toml
orpyproject.toml
withgenerate-hashes = true
.pip compile requirements/requirements.in
.Expected result
requirements/requirements.txt
contains hashes.Actual result
requirements/requirements.txt
has no hashes; the configuration file is ignored.The text was updated successfully, but these errors were encountered: