python-poetry / python-poetry/poetry-plugin-export

export omits implicit markers

Open
#25 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
335
Forks
57
Avg merge
1h 23m
Merged PRs (30d)
3

Description

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

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).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing poetry export -f requirements.txt -o requirements.txt --without-hashes with the linked pyproject.toml and compare the generated requirements with the lock file. Done means dependencies whose versions vary by Python version retain the appropriate environment markers in the export, including the urllib3 entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.