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

pip defining wrong entry point versions on python 2.7 #5468

Closed
Anthchirp opened this issue Jun 1, 2018 · 12 comments
Closed

pip defining wrong entry point versions on python 2.7 #5468

Anthchirp opened this issue Jun 1, 2018 · 12 comments
Labels
type: bug A confirmed bug or unintended behavior

Comments

@Anthchirp
Copy link

Anthchirp commented Jun 1, 2018

Environment

  • pip version: 9.0.3, 10.0.1
  • Python version: 2.7.15
  • OS: Linux, RHEL Workstation 6.9 (system python == 2.6.6, no python3)

Description
On installation on Python 2.7 pip creates console scripts pip, pip2, pip2.7.
However pip defines console_scripts pip, pip3, pip3.6 in entry_points.txt

Expected behavior
pip should define console_scripts entry points pip, pip2, pip2.7

How to Reproduce

  1. Download Python2.7.15.tgz
  2. Run configure with --with-ensurepip=install, make, make install
  3. In installation directory run
./python -c "import pkg_resources; print(', '.join(
    pkg_resources.get_distribution('pip').get_entry_map()['console_scripts']))"
  1. Output is: pip, pip3.6, pip3
  2. File lib/python2.7/site-packages/pip-9.0.3.dist-info/entry_points.txt contains:
[console_scripts]
pip = pip:main
pip3 = pip:main
pip3.6 = pip:main
  1. ./python -m pip install --upgrade pip
  2. Rerun command to list entry points. Output still is pip, pip3.6, pip3
  3. File lib/python2.7/site-packages/pip-10.0.1.dist-info/entry_points.txt contains:
[console_scripts]
pip = pip._internal:main
pip3 = pip._internal:main
pip3.6 = pip._internal:main
@RonnyPfannschmidt
Copy link
Contributor

pip/setup.py

Lines 77 to 80 in 1335eba

"console_scripts": [
"pip=pip._internal:main",
"pip%s=pip._internal:main" % sys.version[:1],
"pip%s=pip._internal:main" % sys.version[:3],
is at fault

i have no idea why it even is added, its always wrong

@RonnyPfannschmidt
Copy link
Contributor

wow, added in 37d1bf3 almost a decade back

@pradyunsg
Copy link
Member

Indeed.

This isn't right... pip's wheel metadata would be incorrect then. Seems like a packaging bug.

@pradyunsg pradyunsg added the type: bug A confirmed bug or unintended behavior label Jun 3, 2018
@pradyunsg pradyunsg added this to the 18.0 milestone Jun 3, 2018
@matador86

This comment has been minimized.

@pradyunsg
Copy link
Member

@pypa/pip-committers Any suggestions here? Is this something that acts as another reason for #3164?

@pfmoore
Copy link
Member

pfmoore commented Jul 6, 2018

The relevant code is at https://github.com/pypa/pip/blob/master/src/pip/_internal/wheel.py#L404 - this generates the versioned wrappers for pip, ignoring the entry point values.

IMO, setup.py should just say

 "console_scripts": [ "pip=pip._internal:main" ]

#3164 is IMO more about removing the wheel.py code I referenced above.

@pradyunsg
Copy link
Member

Ah okay... IIUC, just updating setup.py would be enough for this issue?

@pfmoore
Copy link
Member

pfmoore commented Jul 6, 2018

Yep, I think so

@pradyunsg
Copy link
Member

This seems more complex than just removing the two entries (see https://travis-ci.org/pypa/pip/builds/401602524) and I don't have the bandwidth to look into this currently.

I'm also pushing this down the road to the next release since I don't think this would happen in time for 18.0. PRs are welcome for this though. :)

@pradyunsg pradyunsg modified the milestones: 18.0, 18.1 Jul 9, 2018
@pradyunsg
Copy link
Member

Pushing this down the road to the next release since I don't think this'd happen in time for 18.1.

If someone else does take a look, we'd probably need a PR to be merged by 30th Sept for this to make it into 18.1.

@hugovk
Copy link
Contributor

hugovk commented Jan 8, 2021

Can this be closed now Python 2.7 support is being dropped (#6148)?

@Anthchirp
Copy link
Author

Yep, I don't have a stake in this any more.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants