Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix local file sub-dependencies not being recorded in lockfile#6498

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
matteius wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromfix/local-subdep-lockfile-6119

Conversation

@matteius
Copy link
Member

Summary

Fixes#6119

Problem

When a package (A) installed from a local path depends on another package (B) also installed from a local path, the sub-dependency (B) was not being properly recorded inPipfile.lock. The lockfile entry for B would be empty ({}) instead of containing the file/path information.

Expected Result:

"namespace-library": {"editable":true,"file":"../namespace-library-file"},"namespace-utils": {"editable":true,"file":"../namespace-utils"}

Actual Result (before fix):

"namespace-library": {"editable":true,"file":"../namespace-library-file"},"namespace-utils": {}

Root Cause

Theformat_requirement_for_lockfile() function inpipenv/utils/locking.py was settingentry["file"] = req.link.url for all file:// URLs. However:

  1. For localdirectories, we should usepath (with a relative path) instead offile (with a URL)
  2. The version and index entries should be removed for file/path dependencies
  3. The editable flag should be preserved

Solution

This fix:

  • Differentiates between local directories (usepath) and archive files (usefile) for file:// URLs usingreq.link.is_existing_dir()
  • Converts file:// URLs to relative paths for local directories usingensure_path_is_relative()
  • Removesversion andindex entries for file/path dependencies
  • Preserves theeditable flag if set on the requirement

Testing

To test this fix, you can use the reproduction repository from the issue:

git clone https://github.com/AlexandreArpin/pipenv-reprocd pipenv-repro/my-app-file-deppipenv lockcat Pipfile.lock# namespace-utils should now have path info

Pull Request opened byAugment Code with guidance from the PR author

When a package (A) installed from a local path depends on anotherpackage (B) also installed from a local path, the sub-dependency (B)was not being properly recorded in Pipfile.lock. The lockfile entryfor B would be empty ({}) instead of containing the file/path info.This fix:- Differentiates between local directories (use 'path') and archive  files (use 'file') for file:// URLs- Converts file:// URLs to relative paths for local directories- Removes version and index entries for file/path dependencies- Preserves the editable flag if setFixes#6119
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

File located Dependencies of Packages (sub-dependency) can't be installed with Pipenv

2 participants

@matteius

[8]ページ先頭

©2009-2025 Movatter.jp