Specifying `src_files` for `pip-sync` in `pyproject.toml` is ignored.
Author: takuminakasoCreated Jun 13, 2025Updated Jul 30, 2026
Labelsenhancement
Environment Versions
- OS Type:
Ubuntu 24.04.2 LTS - Python version:
Python 3.13.3 - pip version:
pip 25.1.1 - pip-tools version:
pip-compile, version 7.4.1
Steps to replicate
Specifying src_files for pip-sync in pyproject.toml as follows is ignored and always synchronizes with requirements.txt.
[tool.pip-tools.sync]
src_files = ['requirements_lock.txt']And the following error occurs.
$ pip-sync
No requirement files given and no requirements.txt found in the current directoryExpected result
Expect the same behavior as the following command.
pip-sync requirements_lock.txtActual result
The behavior is actually equivalent to the following command.
pip-sync requirements.txtMy suggetion
The following fix will result in the expected behavior.
Source: jazzband/pip-tools