-
I use How I usually lock my dependenciesFor example, let's say that my pyproject.toml looks like this:
If I want to upgrade numpy in my lock file to 1.21.1, I can usually just do this:
Now I have 1.21.1 in my lock file and 1.17.3 in my pyproject.toml file. That's great. But I prefer to keep my project locked to the minimum versions of all of my dependencies at all times. This allows me to test in our CI that changes to our code won't require us to bump the minimum versions of our dependencies. So, at the moment, my pyproject.toml file has a minimum version specifier for numpy 1.17.3 and my My current issueNow, let's say that I'd like to test my project against python 3.7 and 3.9. Unfortunately, numpy 1.17.3 doesn't support python 3.9, but numpy 1.21.1 does. Of course, I can lock numpy at 1.21.1, but I would prefer to do that only for python 3.9 and not 3.7 and 3.8. I'm able to achieve this temporarily by using python markers. Here's what I'm doing, which mirrors the steps above.
But this doesn't work! After step 4, only one version of numpy remains in my lock file, not both :( I also tried the following for step 3 instead:
But this gives me the same result after step 4. Do you have any ideas for how I can achieve what I want? Or is it just not possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use both, I would try something like:
|
Beta Was this translation helpful? Give feedback.
You can use both,
project.dependencies
andtool.poetry.dependencies
, see https://python-poetry.org/docs/dependency-specification/#projectdependencies-and-toolpoetrydependenciesWhen using both,
tool.poetry.dependencies
do not influence the metadata but are only used for locking.I would try something like: