Skip to content

fix: export editable local dependencies with relative paths - #3856

Merged
frostming merged 6 commits into
pdm-project:mainfrom
tunglambk:fix/export-editable-relative-path
Aug 21, 2026
Merged

fix: export editable local dependencies with relative paths#3856
frostming merged 6 commits into
pdm-project:mainfrom
tunglambk:fix/export-editable-relative-path

Conversation

@tunglambk

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

Fixes #3294.

Editable local dependencies are exported using their relative project path instead of expanding file:///${PROJECT_ROOT} into an absolute file:// URL. This keeps generated requirements files portable across machines and checkout locations.

The change is limited to editable FileRequirement entries that have a local path. VCS, remote URLs, and non-editable requirements keep their existing formatting.

This supersedes #3853, whose CI regression-test fixture was corrected here.

Verification

  • .venv/bin/python -m pytest -q tests/test_formats.py tests/test_requirements_export_relative.py (62 passed)
  • ruff check src/pdm/formats/requirements.py tests/test_requirements_export_relative.py
  • ruff format --check src/pdm/formats/requirements.py tests/test_requirements_export_relative.py
  • git diff --check

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.51%. Comparing base (394fe28) to head (84104ea).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3856   +/-   ##
=======================================
  Coverage   88.51%   88.51%           
=======================================
  Files         121      121           
  Lines       13278    13281    +3     
  Branches     2256     2257    +1     
=======================================
+ Hits        11753    11756    +3     
  Misses        960      960           
  Partials      565      565           
Flag Coverage Δ
unittests 88.40% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@frostming
frostming merged commit a7e9d00 into pdm-project:main Aug 21, 2026
25 checks passed
@tunglambk
tunglambk deleted the fix/export-editable-relative-path branch August 21, 2026 09:19
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.

Export editable subpackage to requirements.txt with relative path instead of full file url

2 participants