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

ipythonMAJ.MIN entry point has name of wheel building python #13815

Open
bnavigator opened this issue Nov 6, 2022 · 6 comments
Open

ipythonMAJ.MIN entry point has name of wheel building python #13815

bnavigator opened this issue Nov 6, 2022 · 6 comments

Comments

@bnavigator
Copy link
Contributor

Contrary to what the release notes say, #13743 does not have such effect on a python setup.py install or pip install. The published wheel in PyPI does not have the entry points either, because it is minor-version agnostic:

ipython-8.6.0-py3-none-any.whl::ipython-8.6.0.dist-info/entry_points.txt

[console_scripts]
ipython = IPython:start_ipython
ipython3 = IPython:start_ipython

Simple pip install from PyPI:

[ben@skylab:~]% python3 -m venv ipenv                                                                                                                                                                             [0]
[ben@skylab:~]% . ipenv/bin/activate                                                                                                                                                                              [0]
(ipenv) [ben@skylab:~]% pip install ipython                                                                                                                                                                       [0]
Collecting ipython
  Downloading ipython-8.6.0-py3-none-any.whl (761 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 761.1/761.1 kB 6.8 MB/s eta 0:00:00
Collecting stack-data
  Downloading stack_data-0.6.0-py3-none-any.whl (24 kB)
Collecting traitlets>=5
  Downloading traitlets-5.5.0-py3-none-any.whl (107 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.4/107.4 kB 6.4 MB/s eta 0:00:00
Collecting matplotlib-inline
  Downloading matplotlib_inline-0.1.6-py3-none-any.whl (9.4 kB)
Collecting pygments>=2.4.0
  Downloading Pygments-2.13.0-py3-none-any.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 7.7 MB/s eta 0:00:00
Collecting backcall
  Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting decorator
  Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting prompt-toolkit<3.1.0,>3.0.1
  Downloading prompt_toolkit-3.0.32-py3-none-any.whl (382 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 382.8/382.8 kB 7.3 MB/s eta 0:00:00
Collecting jedi>=0.16
  Using cached jedi-0.18.1-py2.py3-none-any.whl (1.6 MB)
Collecting pexpect>4.3
  Using cached pexpect-4.8.0-py2.py3-none-any.whl (59 kB)
Collecting pickleshare
  Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting parso<0.9.0,>=0.8.0
  Using cached parso-0.8.3-py2.py3-none-any.whl (100 kB)
Collecting ptyprocess>=0.5
  Using cached ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Collecting wcwidth
  Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting asttokens>=2.1.0
  Downloading asttokens-2.1.0-py2.py3-none-any.whl (26 kB)
Collecting pure-eval
  Downloading pure_eval-0.2.2-py3-none-any.whl (11 kB)
Collecting executing>=1.2.0
  Downloading executing-1.2.0-py2.py3-none-any.whl (24 kB)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: wcwidth, pure-eval, ptyprocess, pickleshare, executing, backcall, traitlets, six, pygments, prompt-toolkit, pexpect, parso, decorator, matplotlib-inline, jedi, asttokens, stack-data, ipython
Successfully installed asttokens-2.1.0 backcall-0.2.0 decorator-5.1.1 executing-1.2.0 ipython-8.6.0 jedi-0.18.1 matplotlib-inline-0.1.6 parso-0.8.3 pexpect-4.8.0 pickleshare-0.7.5 prompt-toolkit-3.0.32 ptyprocess-0.7.0 pure-eval-0.2.2 pygments-2.13.0 six-1.16.0 stack-data-0.6.0 traitlets-5.5.0 wcwidth-0.2.5

[notice] A new release of pip available: 22.2.2 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
(ipenv) [ben@skylab:~]% ls ipenv/bin                                                                                                                                                                              [0]
activate  activate.csh  activate.fish  Activate.ps1  ipython  ipython3  pip  pip3  pip3.10  pygmentize  python  python3  python3.10
(ipenv) [ben@skylab:~]%  
@bnavigator
Copy link
Contributor Author

@UltimateLobster, #13842 made it worse.

The ipython-8.7.0-py3-none-any.whl from PyPI now installs an ipython3.10 even when you install it to python 3.9 or python3.11

@bnavigator bnavigator changed the title ipythonMAJ.MIN entry points are not installed ipythonMAJ.MIN entry point has name of wheel building python Dec 25, 2022
@UltimateLobster
Copy link
Contributor

@UltimateLobster, #13842 made it worse.

The ipython-8.7.0-py3-none-any.whl from PyPI now installs an ipython3.10 even when you install it to python 3.9 or python3.11

Noticed it as well. Since the entry points are decided upon wheel creation time, this only installs the entrypoint of the python version that compiled the wheel. It will work correctly only when installing from source. I'm looking into the possibility of having a wheel that's specific to a minor version.

@bnavigator
Copy link
Contributor Author

bnavigator commented Dec 25, 2022

Or just leave it alone and rely on the installing virtual environment mechanisms (venv, virtualenv, conda, ..) and distribution packagers. Who really needs an ipythonMAJ.MIN entrypoint? Either you are in a venv, where ipython(3) is enough or the distribution takes care of it. At openSUSE, e.g., we install update-alternative links for ipython{,3}-MAJ.MIN.

@bollwyvl
Copy link
Contributor

Yerp, this was a bummer downstream on conda-forge as well: we had to create a special, magic package just for this purpose, and it will complicate things later on down the line (e.g. when 3.12 lands).

If only from that perspective, my vote would be for removing this feature entirely.

@UltimateLobster
Copy link
Contributor

Or just leave it alone and rely on the installing virtual environment mechanisms (venv, virtualenv, conda, ..) and distribution packagers. Who really needs an ipythonMAJ.MIN entrypoint? Either you are in a venv, where ipython(3) is enough or the distribution takes care of it. At openSUSE, e.g., we install update-alternative links for ipython{,3}-MAJ.MIN.

Sometimes you just want to experiment without a specific environment just to test the features and differences between python versions. So I would still support the addition of this feature.

That being said, I agree that this is merely a "nice to have" and therefore, should only be done if it's easy to do so. I didn't think about the possibility of entry points being statically decided at wheel time.

As long as creating a wheel per minor version is not practical, and there is no official "good" way to support this feature, I sadly agree that it should be removed. I will continue to experiment with the known tools and see if there's an easy and practical way to do so.

In the meantime, if no one has done it yet, I'll open a new request soon to revert the changes. I'll re-suggest this feature if and when a better way would arise.

@bnavigator
Copy link
Contributor Author

Experiments must be done in controlled environments, not on the system!

If you pip install the same package for different python versions to the same system without an environment the ipython and ipython3 entrypoints are overwritten on each install. Pip is just not made for that kind of installation scheme.

If you still want to do this: Create wheels for each minor version with the correct python_tag (PEP425, ...py310-none-any.whl), by providing the python-tag option to bdist_wheel.

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

No branches or pull requests

3 participants