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

make html : TypeError: add_source_parser() takes 2 positional arguments but 3 were given #7795

Closed
netbomo opened this issue Jun 6, 2020 · 2 comments

Comments

@netbomo
Copy link

netbomo commented Jun 6, 2020

Hello,
I'm trying to build doc from a venv, but when I try make html I have this error :


File "/path_to_project/sources/venv/lib/python3.7/site-packages/sphinx/application.py", line 1069, in add_source_parser
    self.registry.add_source_parser(*args, **kwargs)
TypeError: add_source_parser() takes 2 positional arguments but 3 were given

make: *** [Makefile:23: html] Error 2

Here is the log file :


# Sphinx version: 3.0.4
# Python version: 3.7.3 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.11.2
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/path_to_project/sources/venv/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/path_to_project/sources/venv/lib/python3.7/site-packages/sphinx/application.py", line 244, in __init__
    self.setup_extension(extension)
  File "/path_to_project/sources/venv/lib/python3.7/site-packages/sphinx/application.py", line 398, in setup_extension
    self.registry.load_extension(self, extname)
  File "/path_to_project/sources/venv/lib/python3.7/site-packages/sphinx/registry.py", line 414, in load_extension
    metadata = setup(app)
  File "/path_to_project/sources/venv/lib/python3.7/site-packages/m2r.py", line 652, in setup
    app.add_source_parser('.md', M2RParser)
  File "/path_to_project/sources/venv/lib/python3.7/site-packages/sphinx/application.py", line 1069, in add_source_parser
    self.registry.add_source_parser(*args, **kwargs)
TypeError: add_source_parser() takes 2 positional arguments but 3 were given

the makefile :


# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXRST     = sphinx-apidoc
SPHINXBUILD   = sphinx-build
SPHINXPROJ    = Windviewer
SPHINXMODULE  = windviewer
SOURCEDIR     = source
BUILDDIR      = build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

rst:
	@$(SPHINXRST) -f -o "$(SOURCEDIR)" "../../$(SPHINXMODULE)"

html:
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

I've allready build the doc but not in the venv, and it was working, but I add import modules problems so I try it in the venv, see the post :

autodoc: failed to import module 'routes' from module 'app_folder'

Thanks for the feedback!

Gilou

@netbomo
Copy link
Author

netbomo commented Jun 6, 2020

I've remove the 'm2r' extension in my conf.py, and the documentation is generated. But how can I use it? I need to add some markdown like a README.md from gitlab repo.

Thanks!

@tk0miya
Copy link
Member

tk0miya commented Jun 6, 2020

The add_source_parser() API has changed since Sphinx-1.8.0. And it seems m2r extension does not use the new style. That was filed as miyakogi/m2r#51. Please pin Sphinx to 2.x to wait for the update.
Thanks,

@tk0miya tk0miya closed this as completed Jun 6, 2020
frdwhite24 pushed a commit to frdwhite24/frewpy that referenced this issue Oct 2, 2020
in order to do this, sphinx was downgraded to version 2 as per this issue
on the sphinx repository sphinx-doc/sphinx#7795
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants