Skip to content

Make pip-sync honor src_files from the config file - #2433

Open
Sanjays2402 wants to merge 1 commit into
jazzband:mainfrom
Sanjays2402:fix/pip-sync-src-files-config
Open

Make pip-sync honor src_files from the config file#2433
Sanjays2402 wants to merge 1 commit into
jazzband:mainfrom
Sanjays2402:fix/pip-sync-src-files-config

Conversation

@Sanjays2402

Copy link
Copy Markdown

Fixes #2187

pip-compile reads src_files out of the click context default_map when none are given on the command line, but pip-sync never did — so [tool.pip-tools.sync] src_files was silently ignored and pip-sync always fell back to requirements.txt (or exited 2 when it was absent). This applies the same lookup in pip-sync; CLI arguments still take precedence.

Contributor checklist
  • Included tests for the changes.
  • A change note is created in changelog.d/ (see changelog.d/README.md
    for instructions) or the PR text says "no changelog needed".
Maintainer checklist
  • If no changelog is needed, apply the bot:chronographer:skip label.
  • Assign the PR to an existing or new milestone for the target version
    (following Semantic Versioning).

pip-compile reads src_files out of the click context default_map when
none are given on the command line, but pip-sync never did, so
[tool.pip-tools.sync] src_files was silently ignored and pip-sync always
fell back to requirements.txt (or exited 2 when it was absent).

Apply the same default_map lookup in pip-sync. CLI arguments still win.

Fixes jazzband#2187
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided A mark meaning that a new change log entry is present within the patch. label Jul 25, 2026
@sirosen

sirosen commented Jul 28, 2026

Copy link
Copy Markdown
Member

I'm not clear on whether or not this is desirable behavior.

src_files has a different meaning between pip-compile and pip-sync. This behavior would result, I think, in loading src_files if specified in, for example, this config:

[tool.pip-tools]
src-files = ["pyproject.toml"]

Such a config is very clearly meant for pip-compile, not pip-sync, and loading it in this context is wrong. We may need more sophisticated config loading before the cited issue can be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided A mark meaning that a new change log entry is present within the patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specifying src_files for pip-sync in pyproject.toml is ignored.

2 participants