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

Specifying source files in pyproject.toml leads to only pyproject.toml being used #2006

Closed
csalerno-asml opened this issue Oct 19, 2023 · 6 comments · Fixed by #2015
Closed
Labels
config Related to pip-tools' configuration

Comments

@csalerno-asml
Copy link
Contributor

Hi,
I am using pip-compile==7.3.0, and trying to specify multiple source files within the pyproject.toml file with the keyword src-files.

My desired outcome would be to specify pyproject.toml and requirements.hotfix.txt, so that the list of dependencies can be used together.
However, I noticed that it's like these files - and the whole input in general - are ignored, because then the tool only use the dependencies specified in pyproject.toml.

I also tried to do something like these (see picture), but I ended up with again pyproject.toml being used.
image

I know that the tool is reading the config, since the other options are used, and if I specify a non-existing file I get an error message
image

Is this a known bug? Should I change something on my end?

Environment Versions

  1. OS Type: RHEL7
  2. Python version: 3.10.5
  3. pip version: 23.3
  4. pip-tools version: 7.3.0

Steps to replicate

  1. specify dependencies in pyproject.toml and file.txt
  2. specify tools.pip-tools / src_files = ["pyproject.toml", "file.txt"
  3. check if dependencies specified in file.txt are picked up and translated in requirements.txt

Expected result

Dependencies specified in both files are translated in requirements.txt

Actual result

Only dependencies specified in pyproject.toml are picked up

@csalerno-asml
Copy link
Contributor Author

To add on this, if I run pip-compile pyproject.toml file.txt, I get the expected result

@webknjaz
Copy link
Member

A full repro would be helpful.

@csalerno-asml
Copy link
Contributor Author

Hey @webknjaz , I created a repo to demo this: https://github.com/csalerno-asml/test-pip-compile

Basically, it looks like the tool ignores entirely the content of src-files, and, when no src file is specified via CLI, it just pick the dependencies following a list:

  1. requirements.in
  2. pyproject.toml
  3. else?

You can see the behavior here:

  1. all the three files specified in src-files are found, but only requirements.in is used: https://github.com/csalerno-asml/test-pip-compile/actions/runs/6625134286/job/17995493296
  2. requirements.in is removed and only pyproject.toml is used: Removed requirements.in csalerno-asml/test-pip-compile#1

@csalerno-asml
Copy link
Contributor Author

csalerno-asml commented Oct 25, 2023

To add on this, the src-files option in pyproject.toml is used by the tool for sure, since all the paths specified there are checked, i.e., an error will raise if you put a non-existing-file inside the list.

My concern is, then: maybe the code is missing the logic to handle src-files when specified from a config, rather than CLI usage?

@AndydeCleyre AndydeCleyre added the config Related to pip-tools' configuration label Oct 26, 2023
@atugushev
Copy link
Member

I believe we should first incorporate this PR #1966 which will allow us to separately specify inputs and outputs for the compile and sync commands.

@chrysle
Copy link
Contributor

chrysle commented Jan 20, 2024

Actually, I found out what exactly causes this: According to pallets/click#390, default values won't work on arguments with unlimited length. So I think the proposed fix is the only solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Related to pip-tools' configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants