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

sphinxcontrib.applehelp should be distributed as sphinxcontrib_applehelp #11130

Closed
ghost opened this issue Jan 14, 2023 · 6 comments
Closed

sphinxcontrib.applehelp should be distributed as sphinxcontrib_applehelp #11130

ghost opened this issue Jan 14, 2023 · 6 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2023

Describe the bug

If you look at how the distribution packages are named here: https://pypi.org/simple/sphinxcontrib-applehelp/ you will see that for some reason this package changed name in the last version. sphinx package didn't update to depend on this package correctly.

For no good reason pip seems to replace the dot in the package name with a hyphen, and this makes it possible to install sphinx using pip, but pkg_resources doesn't do it (that's correct way to do it), and so sphinx isn't installable in this way. Most importantly, this leads to build_sphinx setuptools extension becoming unusable.

In other words, it's no longer possible to specify sphinx in setup_requires list, because that would lead to setuptools trying to resolve dependencies for sphinx, but failing to do so because sphinx needs sphinxcontrib_applehelp , but such dependency cannot be installed, because once found package called sphinxcontrib.applehelp pkg_resources will not try to look for a different version or anything like that, it'll just declare that the package doesn't exist.

In general, you shouldn't upload a package named differently into the same repository: the packaging system is already in shambles, and it's sure not prepared to deal with such cases. Why go looking for trouble if the obvious way was to use simpler naming schemes?


This behavior exists at least in Python 3.8, setuptools 56.0.0.

How to Reproduce

Create setup.py and specify sphinx in setup_requires list.

Environment Information

Sphinx is not installable.

BTW, this is the commit responsible for the breakage.

Also, the fact that using pyproject.toml is more recent, doesn't mean that it's better. It's actually worse... There's absolutely no reason to use it. Undoing this whole commit would've made the project a little bit better.

@benoj
Copy link

benoj commented Jan 16, 2023

I think this issue is blowing up my CI - any workarounds?

@ajslater
Copy link

This currently breaks downstream builds like ninemoreminutes/xapian-bindings

@bachya
Copy link

bachya commented Mar 11, 2023

Any update on this? I can't install my package's dev environment because of this issue:

• Installing sphinxcontrib-applehelp (1.0.3): Failed

  KeyError

  "There is no item named 'sphinxcontrib.applehelp-1.0.3.dist-info/WHEEL' in the archive"

  at ~/.asdf/installs/python/3.11.2/lib/python3.11/zipfile.py:1473 in getinfo
      1469│     def getinfo(self, name):
      1470│         """Return the instance of ZipInfo given 'name'."""
      1471│         info = self.NameToInfo.get(name)
      1472│         if info is None:
    → 1473│             raise KeyError(
      1474│                 'There is no item named %r in the archive' % name)
      1475│
      1476│         return info

@nodiscc
Copy link

nodiscc commented Jul 4, 2023

This breaks all sphinx installations where sphinx is installed through another module's install_requires=[].

In my case this doesn't prevent installation, but sphinx-build will fail at run time, regardless of sphinx version:

$ sphinx-build -b html -c tests/ tests/awesome-selfhosted-html/ tests/awesome-selfhosted-html/html
Running Sphinx v5.3.0

Extension error:
Could not import extension sphinxcontrib.applehelp (exception: No module named 'sphinxcontrib.applehelp')

Are there any plans to fix this, or known workarounds?

Edit: a workaround I found is to install sphinx manually using pip install sphinx

nodiscc added a commit to awesome-selfhosted/awesome-selfhosted-data that referenced this issue Jul 24, 2023
- build markdown/HTML versions, use separate makefile targets/hecat configuration files for each export format/push task
- add non-free.md generation step to markdown export hecat configuration file
- add makefile targets to push exports to https://github.com/awesome-selfhosted/awesome-selfhosted and https://github.com/nodiscc/awesome-selfhosted-html-preview
- install: install sphinx <7 directly using pip since it can't be installed from setup.py sphinx-doc/sphinx#11130
- pin sphinx to version <7, sphinx-design is not compatible with sphinx 7 executablebooks/sphinx-design#130
- add sphinx configuration file
nodiscc added a commit to awesome-selfhosted/awesome-selfhosted-data that referenced this issue Jul 24, 2023
- build markdown/HTML versions, use separate makefile targets/hecat configuration files for each export format/push task
- add non-free.md generation step to markdown export hecat configuration file
- add makefile targets to push exports to https://github.com/awesome-selfhosted/awesome-selfhosted and https://github.com/nodiscc/awesome-selfhosted-html-preview
- install: install sphinx <7 directly using pip since it can't be installed from setup.py sphinx-doc/sphinx#11130
- pin sphinx to version <7, sphinx-design is not compatible with sphinx 7 executablebooks/sphinx-design#130
- add sphinx configuration file
- tools/makefile: monkeypatch furo theme to display build tools and license link in footer (furo/sphinx does not provide a way to customize this pradyunsg/furo#612)
- fix dependencies between makefile targets
- setup/document SSH deploy keys usage
- each repository requires a different deploy key, trying to add a deploy key to repo B, which has already been added to repo A results in error 'this key already exists'
- set git remote URL to use ssh URIs before push (required to use SSH deploy keys)
- when referencing an environment secret, environment: key must be defined explicitly for the step (https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#referencing-an-environment)
- use a single SSH key file/no ssh-agent, else git push will try to use the first registered key and fail with permission denied when trying to push to the HTML repository
- use variables to identify target repos
- use temporary repositories as push destination
nodiscc added a commit to nodiscc/hecat that referenced this issue Jul 27, 2023
- executablebooks/sphinx-design#130
- sphinx must be installed manually/ install through install_requires still blocked by sphinx-doc/sphinx#11130
@nodiscc
Copy link

nodiscc commented Jul 27, 2023

@AA-Turner any chance of reverting the commit responsible for this?

@nodiscc
Copy link

nodiscc commented Jul 27, 2023

breaks all sphinx installations where sphinx is installed through another module's install_requires=[]

The problem was fixed by using python3 -m pip install . instead of python3 setup.py install to install the package which lists sphinx in its install_requires (nodiscc/hecat#115).

Invoking setup.py directly is deprecated https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants