I am writing a library A that is used by an application B,
I am using pip-compile in the process for both library A and application B, and would like my requirements.txt to have a loose dependency such as
# requirements.in for library A
pandas~=1.4.0 # will install the highest version available above 1.4.0 , but not 1.5.0 or higher.
After pip-compile, this is what I have
# requirements.txt for library A
...
pandas==1.4.4
...
Is it possible to have this instead, for the output of pip-compile, so that other application B can decide, during dependency resolution, on what exact version of pandas==1.4.x to use?
# requirements.txt for library A
...
pandas~=1.4.0
...
# requirements.in for application B
libraryA==1.1.1
pandas==1.4.2
# There are incompatible versions in the resolved dependencies:
# pandas==1.4.2 from ...
# pandas==1.4.4 (from libraryA==1.1.1->-r requirements.in (line 1))
This should be possible by using the string version
Use double quotes for Windows.