Open jmcgill298 opened 2 years ago
I am running the same version of pytkdocs and am not having an issue. I am no expert but I do want to try to help.
I had received a similar error or maybe even the same, I am not near my work station right now, but my issue was a bad mkdocs.yml
. I had copied the config from somewhere online and produced and error. After checking the mkdocstring documentation, I removed a few lines I had in the handler
config. If your handler does not look the same as mine below, that might be the issue.
plugins:
- search
- mkdocstrings:
handlers:
python:
setup_commands:
- import os
- import sys
- import django
- sys.path.insert(0, os.path.abspath('../src/'))
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphql_api.settings")
- django.setup()
@jmcgill298 I hope that can be of some help.
I have the same AttributeError problem, but it's on my form.
AttributeError: 'ModelFormOptions' object has no attribute 'get_fields'
Did you manage to solve the problem?
A new Python handler is available and fixes all these AttributeError
issues since it does not execute the code anymore, but only parses/visits it. Note however that this new handler is experimental and might not work as you expect, or as the legacy handler does, particularly with third-party libs like Django. Beta-tests and feedback are greatly appreciated! Closing for now, feel free to reopen, or open new issues.
I have the same AttributeError problem, but it's on my form.
AttributeError: 'ModelFormOptions' object has no attribute 'get_fields'
Did you manage to solve the problem?
Hi @BrayanMota, I have exactly the same issue. The new handler is still not supporting Django, so I'm stuck. Did you find a solution to bypass those errors (for a class, a function or a whole module) and continue generating the documentation ?
If someone is willing to fix this, PRs are welcome in pytkdocs! I'm reopening this and moving the issue to pytkdocs' repo.
Please open an issue on pytkdocs instead if this is related to Python docstrings parsing or the collection of Python objects!
Describe the bug Having pytkdocs >= 0.12.0 causes mkdocstrings build to crash with Django projects. Installation of pytkdocs with pip installs a version of pytkdocs >= 0.12.0.
To Reproduce Steps to reproduce the behavior:
mkdocs build
cli commandExpected behavior I expected the docs to be built
Screenshots
Information (please complete the following information):
mkdocstrings
version: 0.16.2 (tried all since June)pytkdocs
version: 0.[12, 13, 14].0 (worked once I got to 0.11.1)Additional context Add any other context about the problem here.