Skip to content

Feature: Added a flag to generate requirements.txt without markers #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sealonohana
Copy link

@sealonohana sealonohana commented Apr 23, 2025

The PR adds a --without-markers flag to the poetry export command. It tells Poetry to leave out all environment markers from the generated requirements.txt.

We ran into repeated issues where certain tools or build steps would choke on these markers—especially in CI environments that don’t process them correctly.

The goal here is simple: export a clean, unconditional list of packages that works everywhere, without surprises. It’s not a replacement for markers when they’re needed, but for cases where you explicitly don’t want them, this makes the export process a lot more reliable and predictable.

@sealonohana sealonohana changed the title Feature/requirements without markers Feature: Added a flag to generate requirements.txt without markers Apr 23, 2025
Copy link

@radoering
Copy link
Member

The goal here is simple: export a clean, unconditional list of packages that works everywhere, without surprises.

Unfortunately, this is not possible in general. There will be surprises for sure. An unconditional list of packages will just work for a specific environment. There has already been a PR like this before: #82

Citing from #82 (comment):

A requirements.txt exported without markers is in general broken: installing from it may install the wrong things, may install incompatible things, may try to install two different versions of the same thing.

In some cases a requirements.txt without markers may work. However, just providing an option that simply strips markers and will produce broken requirements.txt files for many people is something we will probably not approve. In order to create a requirements.txt without markers you have to evaluate markers for a target environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants