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

object of type 'VersionInfo' has no len() #96

Closed
sagimann opened this issue Jan 30, 2023 · 1 comment
Closed

object of type 'VersionInfo' has no len() #96

sagimann opened this issue Jan 30, 2023 · 1 comment

Comments

@sagimann
Copy link

Hello,
I'm new to sphinx multiversion. I tried to build using:
sphinx-multiversion . public

and got:

Theme error:
An error happened in rendering the page docs/common_structures/MyStruct.
Reason: TypeError("object of type 'VersionInfo' has no len()")
Traceback (most recent call last):
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\MyUser\my\my-doc\venv\Scripts\sphinx-multiversion.exe\__main__.py", line 7, in <module>
  File "C:\Users\MyUser\my\my-doc\venv\lib\site-packages\sphinx_multiversion\main.py", line 338, in main
    subprocess.check_call(cmd, cwd=current_cwd)
  File "C:\Users\MyUser\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('C:\\Users\\MyUser\\my\\my-doc\\venv\\Scripts\\python.exe', '-R', '-m', 'sphinx', '-D', 'smv_metadata_path=C:\\Users\\MyUser\\AppData\\Local\\Temp\\tmpn116xt2f\\versions.json', '-D', 'smv_current_version=586-branch1', '-c', 'C:\\Users\\MyUser\\my\\my-doc', 'C:\\Users\\MyUser\\AppData\\Local\\Temp\\tmpn116xt2f\\05292799e6726d55a753048c097d5351cdc459ef\\.', 'C:\\Users\\MyUser\\my\\my-doc\\public\\586-branch1')' returned non-zero exit status 2.

I am using python3 venv and installed latest sphinx multiversion using pip. My conf.py has the following:

extensions = [
    'sphinx_rtd_theme',
...
    'sphinx_multiversion'
]

templates_path = ['_templates']

# SET CURRENT_VERSION
from git import Repo
repo = Repo( search_parent_directories=True )
current_version = repo.active_branch.name
html_context['current_version'] = current_version
html_context['version'] = current_version
html_context['versions'] = list()
versions = [branch.name for branch in repo.branches]
for version in versions:
    html_context['versions'].append( (version, f'/{VERSION_BASE_URI}/{version}/index.html') )
@BurningEnlightenment
Copy link
Member

Hi, using git from a sphinx-multiversion subprocess is currently unsupported (see also #17).

@BurningEnlightenment BurningEnlightenment closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
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

2 participants