Skip to content

Commit

Permalink
Remove the environment markers from export result
Browse files Browse the repository at this point in the history
Close #843
  • Loading branch information
frostming committed Jan 6, 2022
1 parent af1b1c1 commit 21ebacc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/843.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that export result has environment markers that don't apply for all requirements.
4 changes: 3 additions & 1 deletion pdm/formats/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ def export(
lines = []
for candidate in sorted(candidates, key=lambda x: x.identify()):
if isinstance(candidate, Candidate):
req = dataclasses.replace(candidate.req, specifier=f"=={candidate.version}")
req = dataclasses.replace(
candidate.req, specifier=f"=={candidate.version}", marker=None
)
else:
assert isinstance(candidate, Requirement)
req = candidate
Expand Down

0 comments on commit 21ebacc

Please sign in to comment.