poetry-plugin-export icon indicating copy to clipboard operation
poetry-plugin-export copied to clipboard

export omits implicit markers

Open schinckel opened this issue 5 years ago • 3 comments

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS Catalina
  • Poetry version: 1.0.0b8
  • Link of a Gist with the contents of your pyproject.toml file:https://gist.github.com/schinckel/a58ab47bbc89b694208333c21e5aea68

Issue

When generating using unpinned dependencies, poetry does a great job of creating a lock file that handles different python versions, but only those with explicit markers in the pyproject.toml file get those markers in an export file.

$ poetry export -f requirements.txt -o requirements.txt --without-hashes generates the second file in the above gist: this contains two lines for urllib3, neither of which has a marker. This means this file cannot be used to install from.

The workaround at this stage is to have explicit version markers for different python versions when the latest version is not supported in both. That's fine, since it's going to limit the python 2 version anyway, but since poetry knows how to resolve dependencies to get a working version, it should be able to export that correctly too.

(As it stands, I'll probably get future CI failures as other packages release versions that don't support python 2).

schinckel avatar Dec 18 '19 05:12 schinckel

Even worse: when including explicit markers in pyproject.toml, I'm struggling to get pillow to appear only once in the requirements.txt file.

schinckel avatar Jan 14 '20 06:01 schinckel

I ran into the same problem with the latest version of pandas which now includes:

      python_requires=">=3.6.1",

My pyproject.toml had been setup with:

[tool.poetry.dependencies]
python = "^3.6"

jimmywan avatar Feb 20 '20 19:02 jimmywan

We just get urllib3==1.22 today, this is fixed

dimbleby avatar May 28 '22 11:05 dimbleby