Skip to content
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

fix: resolve requirements paths relative to the requirement file they are specified in #2422

Merged
merged 1 commit into from Nov 23, 2023

Conversation

mattem
Copy link
Contributor

@mattem mattem commented Nov 22, 2023

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.

When the requirements parser encountered a -r requirements path reference it would pass the line directly to open, whereas under pip (I was importing a requirements project when encountered this) the -r references are resolved relative to the file in which they are specified.

This diff changes the behaviour to resolve the file relative to where it was specified, rather than the current working directory.

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (a339412) 84.46% compared to head (f9eb961) 84.45%.

Files Patch % Lines
src/pdm/formats/requirements.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2422      +/-   ##
==========================================
- Coverage   84.46%   84.45%   -0.01%     
==========================================
  Files         102      102              
  Lines       10124    10125       +1     
  Branches     2225     2225              
==========================================
  Hits         8551     8551              
- Misses       1095     1096       +1     
  Partials      478      478              
Flag Coverage Δ
unittests 84.23% <40.00%> (-0.01%) ⬇️

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

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

@frostming frostming merged commit 4f80ef8 into pdm-project:main Nov 23, 2023
22 of 24 checks passed
frostming pushed a commit that referenced this pull request Nov 23, 2023
… are specified in (#2422)

Signed-off-by: Frost Ming <me@frostming.com>
@mattem mattem deleted the relative_requirements_paths branch November 23, 2023 11:37
@j178 j178 mentioned this pull request Apr 3, 2024
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.

None yet

2 participants