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

_vendor/README.rst: vendor.txt needed for debug #8436

Closed
wants to merge 8 commits into from
Closed

_vendor/README.rst: vendor.txt needed for debug #8436

wants to merge 8 commits into from

Conversation

kitterma
Copy link
Contributor

The debug command parses vendor.txt, so it's needed when debundling.

@xavfernandez
Copy link
Member

It appears you've included the commits of #8328 in this PR.

Could you only submit the commit changing the README ?

@kitterma
Copy link
Contributor Author

kitterma commented Jun 25, 2020 via email

@BrownTruck
Copy link
Contributor

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will be eligible for code review and hopefully merging!

@BrownTruck BrownTruck added the needs rebase or merge PR has conflicts with current master label Jul 8, 2020
@@ -0,0 +1 @@
The pip debug command takes module versions from vendor.txt even when they are debundled. Enhance the debug command output to instead show the location, name, and version of the debundled modules when appropriate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this with .vendor, so when we generate news it gets more exposure to the people repackaging pip.

@@ -127,7 +127,7 @@ semi-supported method (that we don't test in our CI) and requires a bit of
extra work on your end in order to solve the problems described above.

1. Delete everything in ``pip/_vendor/`` **except** for
``pip/_vendor/__init__.py``.
``pip/_vendor/__init__.py`` and ``pip/_vendor/vendor.txt``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After these changes it won't be necessary to include vendor.txt, correct?

@@ -63,6 +63,14 @@ def create_vendor_txt_map():
return dict(line.split('==', 1) for line in lines) # type: ignore


def create_debundle_txt_map():
# type: () -> Dict[str, str]
wheels = [fn for fn in os.listdir(pip._vendor.WHEEL_DIR)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also catch non-wheel files (which are likely to exist if the wheels are in pip/_vendor). We have a Wheel helper in pip._internal.models.wheel that can help distinguish those cases and get the name and version:

def _vendor_wheels():
    for fn in os.listdir(pip._vendor.WHEEL_DIR):
        try:
            yield Wheel(fn)
        except InvalidWheelFilename:
            pass


def create_debundle_txt_map():
    return {wheel.name: wheel.version for wheel in _vendor_wheels()}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same point as in #8328 (review)
WHEEL_DIR is currently not the only mechanism used by distributions to debundle pip.

@pradyunsg
Copy link
Member

pradyunsg commented Apr 2, 2021

Closing since this is out of date and bitrotten.

@kitterma Could you file a new PR for this? It'll need updating the news file fragment, and dealing with the merge conflict.

@pradyunsg pradyunsg closed this Apr 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs rebase or merge PR has conflicts with current master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants