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

new version Sphinx 4.0 requires this package to be updated #16

Closed
jugmac00 opened this issue May 9, 2021 · 24 comments
Closed

new version Sphinx 4.0 requires this package to be updated #16

jugmac00 opened this issue May 9, 2021 · 24 comments

Comments

@jugmac00
Copy link

jugmac00 commented May 9, 2021

Also, tox does not work currently.

❯ tox -e py39 -r
GLOB sdist-make: /home/jugmac00/Projects/repoze.sphinx.autointerface/setup.py
py39 recreate: /home/jugmac00/Projects/repoze.sphinx.autointerface/.tox/py39
py39 installdeps: zope.testrunner
py39 inst: /home/jugmac00/Projects/repoze.sphinx.autointerface/.tox/.tmp/package/1/repoze.sphinx.autointerface-0.8.1.dev0.zip
ERROR: invocation failed (exit code 1), logfile: /home/jugmac00/Projects/repoze.sphinx.autointerface/.tox/py39/log/py39-2.log
=========================================================== log start ============================================================
Processing ./.tox/.tmp/package/1/repoze.sphinx.autointerface-0.8.1.dev0.zip
    ERROR: Command errored out with exit status 1:
     command: /home/jugmac00/Projects/repoze.sphinx.autointerface/.tox/py39/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-9ruvlhgg/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-9ruvlhgg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ppju3j90
         cwd: /tmp/pip-req-build-9ruvlhgg/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-9ruvlhgg/setup.py", line 24, in <module>
        with open(os.path.join(here, 'CHANGES.rst')) as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-9ruvlhgg/CHANGES.rst'
    ----------------------------------------
WARNING: Discarding file:///home/jugmac00/Projects/repoze.sphinx.autointerface/.tox/.tmp/package/1/repoze.sphinx.autointerface-0.8.1.dev0.zip. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 21.0.1; however, version 21.1.1 is available.
You should consider upgrading via the '/home/jugmac00/Projects/repoze.sphinx.autointerface/.tox/py39/bin/python -m pip install --upgrade pip' command.

============================================================ log end =============================================================
____________________________________________________________ summary _____________________________________________________________
ERROR:   py39: InvocationError for command /home/jugmac00/Projects/repoze.sphinx.autointerface/.tox/py39/bin/python -m pip install --exists-action w .tox/.tmp/package/1/repoze.sphinx.autointerface-0.8.1.dev0.zip (exited with code 1)

This package currently only supports Python 2.7 and 3.5.

Also, a couple of hours ago Sphinx 4.0 came out with breaks this package.

Extension error:
Could not import extension repoze.sphinx.autointerface (exception: cannot import name 'force_decode' from 'sphinx.util' (/home/runner/work/Products.PluggableAuthService/Products.PluggableAuthService/.tox/docs/lib/python3.8/site-packages/sphinx/util/__init__.py))
ERROR: InvocationError for command /home/runner/work/Products.PluggableAuthService/Products.PluggableAuthService/.tox/docs/bin/sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html (exited with code 2)
@jugmac00
Copy link
Author

jugmac00 commented May 9, 2021

It is a bit hard to understand the Sphinx documentation, but I interpret

   * - ``sphinx.util.force_decode()``
     - 2.0
     - 4.0
     - N/A

as force_decode was deprecated with Sphinx 2, removed with Sphinx 4 and the last - means there is no replacement.

@stevepiercy
Copy link
Contributor

Your interpretation is correct. Rendered to HTML: https://www.sphinx-doc.org/en/master/extdev/deprecated.html

@stevepiercy
Copy link
Contributor

Here's the PR and explanation for the deprecation.
sphinx-doc/sphinx#5620

@stevepiercy
Copy link
Contributor

What do we want to do? Drop Python 2 support? Pin to Sphinx < 4 or vendor in force_decode?

@icemac
Copy link
Contributor

icemac commented May 10, 2021

I'd suggest to drop Python 2 support, it should make the code cleaner here.

@jugmac00
Copy link
Author

Also see #13 - the problem was well known for years.

@jugmac00
Copy link
Author

I'd suggest to drop Python 2 support, it should make the code cleaner here.

pinging @jamadden who - at least for other packages - wanted to keep Python 2 support for some more time

@icemac
Copy link
Contributor

icemac commented May 10, 2021

I see no need to still build the documentation of a package on Python 2.

@jamadden
Copy link
Contributor

Agreed. Sphinx itself dropped support for running on Python 2 some time ago, and projects that support Python 2 also support Python 3 (and so can build their docs with Python 3). So as long as the metadata (python_requires) is set correctly for a new uploaded version of this plugin, there shouldn't be much of an issue with it dropping Python 2.

@jamadden
Copy link
Contributor

#14 was a PR that's been merged which partly fixed this issue when it was originally reported in #13. But there were some issues with that, and according to the comments on #14, @tseaver and @freddrake were going to take a look at things. So master is in a different state than the released plugin and in fact may already have unintentionally dropped support for Python 2.

@stevepiercy
Copy link
Contributor

What should be the supported versions of Python going forward? I'd suggest 3.6+, dropping all earlier EOLed versions.

I would also suggest bringing in @tseaver's preferences from #14.

I'd be happy to do the necessary work. Are there any other items that should be included, such as adding GitHub Actions for CI?

@icemac
Copy link
Contributor

icemac commented May 11, 2021

CI is still on travis-ci.org, so it should work for now (besides from being very slow). It would be nice to migrate to GHA but having a released version has more value to me.

@jugmac00
Copy link
Author

Travis announced to finally shut down travis-ci.org at the end of May - this time for sure :-)

icemac pushed a commit to zopefoundation/meta that referenced this issue May 11, 2021
@stevepiercy
Copy link
Contributor

stevepiercy commented May 11, 2021

I gave it a shot, but I quickly got in way over my head. I'd be happy to work with someone who knows this library and is willing to be a mentor to me and fix it. Please @ me.

Here's a short list of things that I think need to be upgraded:

  • sphinx.ext.autodoc.AutoDirective is deprecated; use application.Sphinx.add_autodocumenter()
  • Remove force_decode()
  • Replace StringIO with io.StringIO, and remove six.
  • Do something(?) with sphinx.theming.Theme.themes

@jugmac00
Copy link
Author

@stevepiercy That is completely relatable - when I noticed this package was broken, I also tried... but one fixed problem led to the next, and without some serious Sphinx knowledge, there was no way to go further. 🤞 somebody with some deeper knowledge and some spare time steps up.

@stevepiercy
Copy link
Contributor

stevepiercy commented May 16, 2021

I opened PR #17 to get this started. I am happy to collaborate with anyone to resolve it, granting access to push commits to my GitHub fork. It's only some housecleaning at the moment.

@LauraKirby
Copy link

I am seeing a similar error when trying to use: sphinxcontrib.autohttp.flask

Python packages installed:

  • "sphinxcontrib-httpdomain"
    • "version": "==1.0.1"
  • "sphinx"
    • "version": "==4.0.1"
  • "flask"
    • "version": "==1.1.2"

api.rst

API
------------------------

.. autoflask:: my_app:app
   :endpoints:
   :order: path

Terminal:

➜ make html
Running Sphinx v4.0.1

Extension error:
Could not import extension sphinxcontrib.autohttp.flask (exception: cannot import name 'force_decode' from 'sphinx.util' (/Users/laura/.local/share/virtualenvs/my_app-FiNEjGX7/lib/python3.8/site-packages/sphinx/util/init.py))
make: *** [html] Error 2

@stevepiercy
Copy link
Contributor

@LauraKirby thanks for the post. I found an open issue that you can track as well. I hope to see someone smarter than I who can fix it, and I can follow their lead.

@LauraKirby
Copy link

Thank you @stevepiercy!

odidev added a commit to odidev/zope.proxy that referenced this issue Jun 24, 2021
To provide support for repoze.sphinx.autointerface
We can upgrade back once below issue resolves
  - repoze/repoze.sphinx.autointerface#16

Signed-off-by: odidev <odidev@puresoftware.com>
icemac pushed a commit to zopefoundation/zope.proxy that referenced this issue Jul 15, 2021
To provide support for repoze.sphinx.autointerface
We can upgrade back once below issue resolves
  - repoze/repoze.sphinx.autointerface#16

Signed-off-by: odidev <odidev@puresoftware.com>
@kloczek
Copy link

kloczek commented Aug 6, 2021

Just tested 2.4 with sphinx 4.1.2

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.1.2
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing repoze.who.egg-info/PKG-INFO
writing dependency_links to repoze.who.egg-info/dependency_links.txt
writing entry points to repoze.who.egg-info/entry_points.txt
writing namespace_packages to repoze.who.egg-info/namespace_packages.txt
writing requirements to repoze.who.egg-info/requires.txt
writing top-level names to repoze.who.egg-info/top_level.txt
reading manifest file 'repoze.who.egg-info/SOURCES.txt'
writing manifest file 'repoze.who.egg-info/SOURCES.txt'
running build_ext
..............................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 302 tests in 0.047s

OK
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 8 added, 0 changed, 0 removed
reading sources... [100%] use_cases
/home/tkloczko/rpmbuild/BUILD/repoze.who-2.4/docs/configuration.rst:138: WARNING: Unknown interpreted text role "method".
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-repoze.who.3 { narr use_cases middleware api configuration plugins changes } done
build succeeded, 1 warning.

@stevepiercy
Copy link
Contributor

@icemac
Copy link
Contributor

icemac commented May 16, 2022

5.0.0b1 of Sphinx again no longer contains force_decode, so the problem reappears again. Now probably without any further grace period.

@dataflake
Copy link
Contributor

Fixed by #17 , version 1.0.0 is now published on PyPI.

@icemac
Copy link
Contributor

icemac commented May 31, 2022

@dataflake Thank you very much!

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

7 participants