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

sphinx1.7+: ImportError workaround, allows to see help #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

z00sts
Copy link

@z00sts z00sts commented Dec 5, 2019

upstream merged + branch/commit renamed (#69)

UPD: add reproduce details
python 3.7.5

Package                       Version                                                  
----------------------------- ----------
...
Sphinx                        2.2.2      
sphinxcontrib-applehelp       1.0.1      
sphinxcontrib-devhelp         1.0.1      
sphinxcontrib-htmlhelp        1.0.2      
sphinxcontrib-jsmath          1.0.1      
sphinxcontrib-qthelp          1.0.2      
sphinxcontrib-serializinghtml 1.1.3      
sphinxcontrib-versioning      2.2.1      
...
$ venv/bin/sphinx-versioning --help
Traceback (most recent call last):
  File "venv/bin/sphinx-versioning", line 11, in <module>
    load_entry_point('sphinxcontrib-versioning', 'console_scripts', 'sphinx-versioning')()
  File ".../sphinxcontrib-versioning/venv/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/pkg_resources/__init__.py", line 489, in load_entry_point
  File ".../sphinxcontrib-versioning/venv/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/pkg_resources/__init__.py", line 2793, in load_entry_point
  File ".../sphinxcontrib-versioning/venv/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/pkg_resources/__init__.py", line 2411, in load
  File ".../sphinxcontrib-versioning/venv/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/pkg_resources/__init__.py", line 2417, in resolve
  File ".../sphinxcontrib-versioning/sphinxcontrib/versioning/__main__.py", line 13, in <module>
    from sphinxcontrib.versioning.routines import build_all, gather_git_info, pre_build, read_local_conf
  File ".../sphinxcontrib-versioning/sphinxcontrib/versioning/routines.py", line 11, in <module>
    from sphinxcontrib.versioning.sphinx_ import build, read_config
  File ".../sphinxcontrib-versioning/sphinxcontrib/versioning/sphinx_.py", line 9, in <module>
    from sphinx import application, build_main, locale
ImportError: cannot import name 'build_main' from 'sphinx'

@z00sts z00sts force-pushed the sphinx1.7-import-error-workaround branch from 13272ee to 221a1c7 Compare December 5, 2019 03:45
@TimKam
Copy link
Member

TimKam commented Dec 5, 2019

Can you fix the linting error:

./sphinxcontrib/versioning/sphinx_.py:17:1: I202 Additional newline in a group of imports. 'from sphinx.builders.html import StandaloneHTMLBuilder' is identified as Third Party and 'from sphinx import application, locale' is identified as Third Party.

@z00sts z00sts force-pushed the sphinx1.7-import-error-workaround branch from 221a1c7 to d6d0260 Compare December 9, 2019 08:08
@z00sts
Copy link
Author

z00sts commented Dec 9, 2019

@TimKam fixed

@gryphon2411
Copy link

@TimKam any progress on this one?

@achamayou
Copy link

@TimKam there is a good number of users who would love to this merged (and released!) :)

@TimKam
Copy link
Member

TimKam commented Mar 11, 2020

Sorry, my GitHub inbox is so full that I can hardly see what's relevant. I'll take a look tomorrow night latest.

@TimKam
Copy link
Member

TimKam commented Mar 12, 2020

I am getting an error:

File "/Users/timotheuskampik/Desktop/github/sphinx-forks/sphinxcontrib-versioning/sphinxcontrib/versioning/sphinx_.py", line 95, in html_page_context
    cls.VERSIONS.context = context
AttributeError: 'NoneType' object has no attribute 'context'

I cannot see where in the code cls.VERSIONS could possibly be set.

@z00sts
Copy link
Author

z00sts commented Mar 15, 2020

I cannot see where in the code cls.VERSIONS could possibly be set.

I'm not sure that this particular issue is related

@TimKam
Copy link
Member

TimKam commented Mar 15, 2020

I am also not sure, but I cannot successfully do a manual test. If you point me to a doc set that should "just work" with this branch, I'll test it and consider it good enough/create a follow-up issue.

@Holzhaus
Copy link

I had these issues, too, and decided to write a new, clean implementation of a sphinx versioning extension. If you're still having problems with this, you could try https://holzhaus.github.io/sphinx-multiversion/master/index.html

@TimKam
Copy link
Member

TimKam commented Mar 15, 2020

@Holzhaus great, wouldn't it make sense to consolidate these two projects? I.e. if your extension has the same functionality as this one but works reliably, we can deprecate this extension and ideally move yours into this GitHub project (but you remain maintainer). What do you think?

@Holzhaus
Copy link

Holzhaus commented Mar 15, 2020

The extension works vastly different internally. Check the FAQ page.

I wrote it to add versioning to the existing sphinx documentation of the Mixxx DJ Software. Hence, I made sure does not require any changes to old branches/tags (i.e. adding the extension to conf.py). Also, it always uses the configuration of the branch you're building from, so that all versions share the same theme/templates/extensions, etc.
So it might not be the right choice for everyone.

I suggest you try it out first before we start to talk about dropping sphinx-versioning in favor of sphinx-multiversion 😛

@codecov-io
Copy link

Codecov Report

Merging #78 into master will increase coverage by 0.11%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
+ Coverage   98.34%   98.46%   +0.11%     
==========================================
  Files           8        8              
  Lines         908      912       +4     
  Branches      176      176              
==========================================
+ Hits          893      898       +5     
  Misses          7        7              
+ Partials        8        7       -1     
Impacted Files Coverage Δ
sphinxcontrib/versioning/sphinx_.py 98.64% <60.00%> (-1.36%) ⬇️
sphinxcontrib/versioning/git.py 97.14% <0.00%> (+1.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b56210...d6d0260. Read the comment docs.

@samuel-emrys
Copy link

Any progress on this? What's holding it up from being merged in?

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

Successfully merging this pull request may close these issues.

7 participants