mkdocstrings / python-legacy

A legacy Python handler for mkdocstrings.
https://mkdocstrings.github.io/python-legacy
ISC License
3 stars 3 forks source link

python-legacy isn't find modules in a specific subfolder #3

Closed tijuca closed 2 years ago

tijuca commented 2 years ago

Describe the bug On building the HTML documentation for netbox (while writing version 3.2.4) I've run into a error message about a non found module which is available within a subfolder from the netbox modules main folder.

Upstream is using python-legacy and not python-handlers together with griffe.

System information:

To Reproduce It's probably not that easy to reproduce the issue I see as I'm currently trying to build the netbox documentation not within a venv but on a native Debian system. To make this possible I've packaged and updated various depending packages like also mkdocstrings, pytkdocs and also python-legacy.

I compared the binary packages on PyPi with the packages I've build locally and so far the content is the same. The shipped test suites are running successfully while a package build. Also most of the output while running mkdocs build ... looks quite correct, except for modules that living in a subfolder that is named the same as the main folder netbox.

A cutted build log:

$  mkdocs -v build
DEBUG    -  Loading configuration file: /home/carsten/gitprojects/netbox/mkdocs.yml
DEBUG    -  Loaded theme configuration for 'material' from '/usr/share/mkdocs/themes/material/mkdocs_theme.yml': {'language': 'en', 'direction': None, 'features': [], 'palette': {'primary': None, 'accent': None},
            'font': {'text': 'Roboto', 'code': 'Roboto Mono'}, 'icon': None, 'favicon': 'assets/images/favicon.png', 'include_search_page': False, 'search_index_only': True, 'static_templates': ['404.html']}
DEBUG    -  Config value: 'config_file_path' = '/home/carsten/gitprojects/netbox/mkdocs.yml'
DEBUG    -  Config value: 'site_name' = 'NetBox Documentation'
DEBUG    -  Config value: 'nav' = [{'Introduction': 'index.md'}, {'Installation': [{'Installing NetBox': 'installation/index.md'}, {'1. PostgreSQL': 'installation/1-postgresql.md'}, {'2. Redis':
            'installation/2-redis.md'}, {'3. NetBox': 'installation/3-netbox.md'}, {'4. Gunicorn': 'installation/4-gunicorn.md'}, {'5. HTTP Server': 'installation/5-http-server.md'}, {'6. LDAP (Optional)':
            'installation/6-ldap.md'}, {'Upgrading NetBox': 'installation/upgrading.md'}, {'Migrating to systemd': 'installation/migrating-to-systemd.md'}]}, {'Configuration': [{'Configuring NetBox':
            'configuration/index.md'}, {'Required Settings': 'configuration/required-settings.md'}, {'Optional Settings': 'configuration/optional-settings.md'}, {'Dynamic Settings':
            'configuration/dynamic-settings.md'}, {'Error Reporting': 'configuration/error-reporting.md'}, {'Remote Authentication': 'configuration/remote-authentication.md'}]}, {'Core Functionality': [{'IP
            Address Management': 'core-functionality/ipam.md'}, {'VLAN Management': 'core-functionality/vlans.md'}, {'Sites and Racks': 'core-functionality/sites-and-racks.md'}, {'Devices and Cabling':
            'core-functionality/devices.md'}, {'Device Types': 'core-functionality/device-types.md'}, {'Modules': 'core-functionality/modules.md'}, {'Virtualization': 'core-functionality/virtualization.md'},
            {'Service Mapping': 'core-functionality/services.md'}, {'Circuits': 'core-functionality/circuits.md'}, {'Wireless': 'core-functionality/wireless.md'}, {'Power Tracking': 'core-functionality/power.md'},
            {'Tenancy': 'core-functionality/tenancy.md'}, {'Contacts': 'core-functionality/contacts.md'}]}, {'Customization': [{'Custom Fields': 'customization/custom-fields.md'}, {'Custom Validation':
            'customization/custom-validation.md'}, {'Custom Links': 'models/extras/customlink.md'}, {'Export Templates': 'customization/export-templates.md'}, {'Custom Scripts': 'customization/custom-scripts.md'},
            {'Reports': 'customization/reports.md'}]}, {'Additional Features': [{'Change Logging': 'additional-features/change-logging.md'}, {'Context Data': 'models/extras/configcontext.md'}, {'Journaling':
            'additional-features/journaling.md'}, {'NAPALM': 'additional-features/napalm.md'}, {'Prometheus Metrics': 'additional-features/prometheus-metrics.md'}, {'Tags': 'models/extras/tag.md'}, {'Webhooks':
            'additional-features/webhooks.md'}]}, {'Plugins': [{'Using Plugins': 'plugins/index.md'}, {'Developing Plugins': [{'Getting Started': 'plugins/development/index.md'}, {'Models':
            'plugins/development/models.md'}, {'Views': 'plugins/development/views.md'}, {'Navigation': 'plugins/development/navigation.md'}, {'Templates': 'plugins/development/templates.md'}, {'Tables':
            'plugins/development/tables.md'}, {'Forms': 'plugins/development/forms.md'}, {'Filters & Filter Sets': 'plugins/development/filtersets.md'}, {'REST API': 'plugins/development/rest-api.md'}, {'GraphQL
            API': 'plugins/development/graphql-api.md'}, {'Background Tasks': 'plugins/development/background-tasks.md'}]}]}, {'Administration': [{'Authentication': [{'Overview':
            'administration/authentication/overview.md'}, {'Microsoft Azure AD': 'administration/authentication/microsoft-azure-ad.md'}, {'Okta': 'administration/authentication/okta.md'}]}, {'Permissions':
            'administration/permissions.md'}, {'Error Reporting': 'administration/error-reporting.md'}, {'Housekeeping': 'administration/housekeeping.md'}, {'Replicating NetBox':
            'administration/replicating-netbox.md'}, {'NetBox Shell': 'administration/netbox-shell.md'}]}, {'REST API': [{'Overview': 'rest-api/overview.md'}, {'Filtering': 'rest-api/filtering.md'},
            {'Authentication': 'rest-api/authentication.md'}]}, {'GraphQL API': [{'Overview': 'graphql-api/overview.md'}]}, {'Reference': [{'Conditions': 'reference/conditions.md'}]}, {'Development':
            [{'Introduction': 'development/index.md'}, {'Getting Started': 'development/getting-started.md'}, {'Style Guide': 'development/style-guide.md'}, {'Models': 'development/models.md'}, {'Adding Models':
            'development/adding-models.md'}, {'Extending Models': 'development/extending-models.md'}, {'Signals': 'development/signals.md'}, {'Application Registry': 'development/application-registry.md'}, {'User
            Preferences': 'development/user-preferences.md'}, {'Web UI': 'development/web-ui.md'}, {'Release Checklist': 'development/release-checklist.md'}]}, {'Release Notes': [{'Summary':
            'release-notes/index.md'}, {'Version 3.2': 'release-notes/version-3.2.md'}, {'Version 3.1': 'release-notes/version-3.1.md'}, {'Version 3.0': 'release-notes/version-3.0.md'}, {'Version 2.11':
            'release-notes/version-2.11.md'}, {'Version 2.10': 'release-notes/version-2.10.md'}, {'Version 2.9': 'release-notes/version-2.9.md'}, {'Version 2.8': 'release-notes/version-2.8.md'}, {'Version 2.7':
            'release-notes/version-2.7.md'}, {'Version 2.6': 'release-notes/version-2.6.md'}, {'Version 2.5': 'release-notes/version-2.5.md'}, {'Version 2.4': 'release-notes/version-2.4.md'}, {'Version 2.3':
            'release-notes/version-2.3.md'}, {'Version 2.2': 'release-notes/version-2.2.md'}, {'Version 2.1': 'release-notes/version-2.1.md'}, {'Version 2.0': 'release-notes/version-2.0.md'}]}]
DEBUG    -  Config value: 'pages' = None
DEBUG    -  Config value: 'site_url' = 'https://docs.netbox.dev/'
DEBUG    -  Config value: 'site_description' = None
DEBUG    -  Config value: 'site_author' = None
DEBUG    -  Config value: 'theme' = Theme(name='material', dirs=['/usr/share/mkdocs/themes/material', '/usr/lib/python3/dist-packages/mkdocs/templates'], static_templates=['sitemap.xml', '404.html'],
            locale=Locale('en'), language='en', direction=None, features=[], palette=[{'media': '(prefers-color-scheme: light)', 'scheme': 'default', 'toggle': {'icon': 'material/lightbulb-outline', 'name':
            'Switch to Dark Mode'}}, {'media': '(prefers-color-scheme: dark)', 'scheme': 'slate', 'toggle': {'icon': 'material/lightbulb', 'name': 'Switch to Light Mode'}}], font={'text': 'Roboto', 'code': 'Roboto
            Mono'}, icon={'repo': 'fontawesome/brands/github'}, favicon='assets/images/favicon.png', include_search_page=False, search_index_only=True)
DEBUG    -  Config value: 'docs_dir' = '/home/carsten/gitprojects/netbox/docs'
DEBUG    -  Config value: 'site_dir' = '/home/carsten/gitprojects/netbox/netbox/project-static/docs'
DEBUG    -  Config value: 'copyright' = None
DEBUG    -  Config value: 'google_analytics' = None
DEBUG    -  Config value: 'dev_addr' = Address(host='127.0.0.1', port=8000)
DEBUG    -  Config value: 'use_directory_urls' = True
DEBUG    -  Config value: 'repo_url' = 'https://github.com/netbox-community/netbox'
DEBUG    -  Config value: 'repo_name' = 'netbox-community/netbox'
DEBUG    -  Config value: 'edit_uri' = 'edit/master/docs/'
DEBUG    -  Config value: 'extra_css' = ['extra.css']
DEBUG    -  Config value: 'extra_javascript' = []
DEBUG    -  Config value: 'extra_templates' = []
DEBUG    -  Config value: 'markdown_extensions' = ['toc', 'tables', 'fenced_code', 'admonition', 'attr_list', 'markdown_include.include', 'pymdownx.superfences', 'pymdownx.tabbed']
DEBUG    -  Config value: 'mdx_configs' = {'markdown_include.include': {'base_path': 'docs/', 'headingOffset': 1}, 'pymdownx.tabbed': {'alternate_style': True}}
DEBUG    -  Config value: 'strict' = False
DEBUG    -  Config value: 'remote_branch' = 'gh-pages'
DEBUG    -  Config value: 'remote_name' = 'origin'
DEBUG    -  Config value: 'extra' = {'social': [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/netbox-community/netbox'}, {'icon': 'fontawesome/brands/slack', 'link': 'https://netdev.chat/'}]}
DEBUG    -  Config value: 'plugins' = PluginCollection([('search', <mkdocs.contrib.search.SearchPlugin object at 0x7f36c3cc8ee0>), ('mkdocstrings', <mkdocstrings.plugin.MkdocstringsPlugin object at
            0x7f36bd741510>)])
DEBUG    -  Config value: 'watch' = None
DEBUG    -  mkdocstrings: Adding extension to the list
DEBUG    -  mkdocstrings: Added a subdued autorefs instance <mkdocs_autorefs.plugin.AutorefsPlugin object at 0x7f36bd6098a0>
DEBUG    -  mkdocs_autorefs.plugin: Adding AutorefsExtension to the list
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: /home/carsten/gitprojects/netbox/netbox/project-static/docs
DEBUG    -  Looking for translations for locale 'en'
DEBUG    -  No translations found here: '/usr/lib/python3/dist-packages/mkdocs/templates/locales'
DEBUG    -  No translations found here: '/usr/share/mkdocs/themes/material/locales'
INFO     -  The following pages exist in the docs directory, but are not included in the "nav" configuration:
              - models/circuits/circuit.md
              - models/circuits/circuittermination.md
              - models/circuits/circuittype.md
              - models/circuits/provider.md
              - models/circuits/providernetwork.md
              - models/dcim/cable.md
              - models/dcim/consoleport.md
              - models/dcim/consoleporttemplate.md
              - models/dcim/consoleserverport.md
              - models/dcim/consoleserverporttemplate.md
              - models/dcim/device.md
              - models/dcim/devicebay.md
              - models/dcim/devicebaytemplate.md
              - models/dcim/devicerole.md
              - models/dcim/devicetype.md
              - models/dcim/frontport.md
              - models/dcim/frontporttemplate.md
              - models/dcim/interface.md
              - models/dcim/interfacetemplate.md
              - models/dcim/inventoryitem.md
              - models/dcim/inventoryitemrole.md
              - models/dcim/inventoryitemtemplate.md
              - models/dcim/location.md
              - models/dcim/manufacturer.md
              - models/dcim/module.md
              - models/dcim/modulebay.md
              - models/dcim/modulebaytemplate.md
              - models/dcim/moduletype.md
              - models/dcim/platform.md
              - models/dcim/powerfeed.md
              - models/dcim/poweroutlet.md
              - models/dcim/poweroutlettemplate.md
              - models/dcim/powerpanel.md
              - models/dcim/powerport.md
              - models/dcim/powerporttemplate.md
              - models/dcim/rack.md
              - models/dcim/rackreservation.md
              - models/dcim/rackrole.md
              - models/dcim/rearport.md
              - models/dcim/rearporttemplate.md
              - models/dcim/region.md
              - models/dcim/site.md
              - models/dcim/sitegroup.md
              - models/dcim/virtualchassis.md
              - models/extras/customfield.md
              - models/extras/exporttemplate.md
              - models/extras/imageattachment.md
              - models/extras/webhook.md
              - models/ipam/aggregate.md
              - models/ipam/asn.md
              - models/ipam/fhrpgroup.md
              - models/ipam/fhrpgroupassignment.md
              - models/ipam/ipaddress.md
              - models/ipam/iprange.md
              - models/ipam/prefix.md
              - models/ipam/rir.md
              - models/ipam/role.md
              - models/ipam/routetarget.md
              - models/ipam/service.md
              - models/ipam/servicetemplate.md
              - models/ipam/vlan.md
              - models/ipam/vlangroup.md
              - models/ipam/vrf.md
              - models/tenancy/contact.md
              - models/tenancy/contactgroup.md
              - models/tenancy/contactrole.md
              - models/tenancy/tenant.md
              - models/tenancy/tenantgroup.md
              - models/users/objectpermission.md
              - models/users/token.md
              - models/virtualization/cluster.md
              - models/virtualization/clustergroup.md
              - models/virtualization/clustertype.md
              - models/virtualization/virtualmachine.md
              - models/virtualization/vminterface.md
              - models/wireless/wirelesslan.md
              - models/wireless/wirelesslangroup.md
              - models/wireless/wirelesslink.md
DEBUG    -  Reading markdown pages.
DEBUG    -  ......
DEBUG    -  Reading: plugins/development/forms.md
DEBUG    -  mkdocstrings: Matched '::: utilities.forms.ColorField'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings_handlers: Opening 'pytkdocs' subprocess
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Updating renderer's env
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.forms.CommentField'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.forms.JSONField'
DEBUG    -  ....
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/attribute.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.models.features.WebhooksMixin'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  Reading: plugins/development/navigation.md
DEBUG    -  Reading: plugins/development/rest-api.md
DEBUG    -  Reading: plugins/development/tables.md
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.BooleanColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Updating renderer's env
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.ChoiceFieldColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.ColorColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.ColoredLabelColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.ContentTypeColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.ContentTypesColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.MarkdownColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.TagColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: netbox.tables.TemplateColumn'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/class.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/children.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/method.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/parameters.html: Rendering
DEBUG    -  Reading: plugins/development/templates.md
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.tags.badge'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Updating renderer's env
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/parameters.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.tags.checkmark'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/parameters.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.tags.tag'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/parameters.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.bettertitle'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.content_type'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.content_type_id'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.linkify'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.meta'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/parameters.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.placeholder'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.render_json'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.render_markdown'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.render_yaml'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.split'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/parameters.html: Rendering
DEBUG    -  mkdocstrings: Matched '::: utilities.templatetags.builtins.filters.tzoffset'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
DEBUG    -  mkdocstrings_handlers: Rebuilding categories and children lists
DEBUG    -  mkdocstrings: Rendering templates
DEBUG    -  mkdocstrings: python/templates/material/function.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/signature.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/properties.html: Rendering
DEBUG    -  mkdocstrings: python/templates/material/docstring.html: Rendering
DEBUG    -  Reading: plugins/development/views.md
DEBUG    -  mkdocstrings: Matched '::: netbox.views.generic.base.BaseObjectView'
DEBUG    -  mkdocstrings: Using handler 'python'
DEBUG    -  mkdocstrings: Collecting data
DEBUG    -  mkdocstrings_handlers: Preparing input
DEBUG    -  mkdocstrings_handlers: Writing to process' stdin
DEBUG    -  mkdocstrings_handlers: Reading process' stdout
DEBUG    -  mkdocstrings_handlers: Loading JSON output as Python object
ERROR    -  mkdocstrings: module 'netbox' has no attribute 'views'
            Traceback (most recent call last):
              File "/usr/lib/python3/dist-packages/pytkdocs/cli.py", line 205, in main
                output = json.dumps(process_json(line))
              File "/usr/lib/python3/dist-packages/pytkdocs/cli.py", line 114, in process_json
                return process_config(json.loads(json_input))
              File "/usr/lib/python3/dist-packages/pytkdocs/cli.py", line 91, in process_config
                obj = loader.get_object_documentation(path, members)
              File "/usr/lib/python3/dist-packages/pytkdocs/loader.py", line 357, in get_object_documentation
                leaf = get_object_tree(dotted_path, self.new_path_syntax)
              File "/usr/lib/python3/dist-packages/pytkdocs/loader.py", line 283, in get_object_tree
                obj = getattr(current_node.obj, obj_name)
            AttributeError: module 'netbox' has no attribute 'views'
ERROR    -  Error reading page 'plugins/development/views.md':
ERROR    -  Could not collect 'netbox.views.generic.base.BaseObjectView'

Aborted with a BuildError!

I was able to build the documentation with previous versions of mkdocstrings 0.17.0 , python-handler 0.6.6 and python-legacy 0.2.2.

I've searched a lot about the correct usage to aad a correct search path but I had no luck to get the build successfull running. The output is the same if I use

plugins:
- mkdocstrings:
    handlers:
      python:
        paths: [../netbox]

or the current setting from the upstream configuration for mkdocs.yml. So my guess is currently that the issue I see is mostly because something isn't working correctly inside mkdocstring-python-legacy.

The folder structure of the Python files is basically this:

$ tree -L 3 -d -I "project-static|media|*cache*" --matchdirs netbox
netbox
├── circuits
│   ├── api
│   ├── forms
│   ├── graphql
│   ├── migrations
│   ├── models
│   ├── tables
│   └── tests
├── dcim
│   ├── api
│   ├── forms
│   ├── graphql
│   ├── management
│   │   └── commands
│   ├── migrations
│   ├── models
│   ├── tables
│   └── tests
├── extras
│   ├── api
│   ├── forms
│   ├── graphql
│   ├── management
│   │   └── commands
│   ├── migrations
│   ├── models
│   ├── plugins
│   ├── tables
│   ├── templatetags
│   └── tests
│       └── dummy_plugin
├── ipam
│   ├── api
│   ├── forms
│   ├── graphql
│   ├── management
│   │   └── commands
│   ├── migrations
│   ├── models
│   ├── tables
│   └── tests
├── netbox
│   ├── api
│   │   ├── serializers
│   │   └── viewsets
│   ├── config
│   ├── forms
│   ├── graphql
│   ├── models
│   ├── tables
│   ├── tests
│   └── views
│       └── generic
├── reports
├── scripts
├── templates
│   ├── admin
│   │   └── extras
│   ├── base
│   ├── circuits
│   │   └── inc
│   ├── dcim
│   │   ├── device
│   │   ├── devicetype
│   │   ├── inc
│   │   ├── moduletype
│   │   └── trace
│   ├── exceptions
│   ├── extras
│   │   ├── admin
│   │   ├── htmx
│   │   ├── inc
│   │   └── templatetags
│   ├── generic
│   ├── htmx
│   ├── inc
│   │   └── panels
│   ├── ipam
│   │   ├── aggregate
│   │   ├── inc
│   │   ├── iprange
│   │   ├── prefix
│   │   └── vlan
│   ├── rest_framework
│   ├── tenancy
│   ├── users
│   ├── virtualization
│   │   ├── cluster
│   │   └── virtualmachine
│   └── wireless
│       └── inc
├── tenancy
│   ├── api
│   ├── forms
│   ├── graphql
│   ├── migrations
│   ├── models
│   ├── tables
│   └── tests
├── users
│   ├── admin
│   ├── api
│   ├── graphql
│   ├── migrations
│   └── tests
├── utilities
│   ├── forms
│   │   └── fields
│   ├── management
│   │   └── commands
│   ├── templates
│   │   ├── builtins
│   │   ├── buttons
│   │   ├── form_helpers
│   │   ├── helpers
│   │   ├── navigation
│   │   ├── search
│   │   └── widgets
│   ├── templatetags
│   │   └── builtins
│   ├── testing
│   └── tests
├── virtualization
│   ├── api
│   ├── forms
│   ├── graphql
│   ├── migrations
│   ├── tables
│   └── tests
└── wireless
    ├── api
    ├── forms
    ├── graphql
    ├── migrations
    ├── tables
    └── tests

136 directories

I can't see why mkdoctrings is thinking that were are no modules (netbox/)netbox/... but seems to have no problems to find modules in (netbox/)utilities/... e.g..

Please let me know how to show you better to reproduce the issue if it's not obvious what I mean. I'm absolutely not that deep in the internals how mkdocstrings is working, but adding some more debug output in some of the modules I'm able to add of course. :-)

Additional context I haven't tried yet to build the documantion of netbox within a venv yet as I was busy with doing all the packaging work until now.

pawamoy commented 2 years ago

Hello @tijuca, thank you very much for the detailed report! I think it will be enough to debug the issue :slightly_smiling_face:

My first intuition is that the repository root appears in sys.path, and therefore when trying to import netbox, pytkdocs actually imports from <root>/netbox instead of <root>/netbox/netbox. This issue is kind of why so many Python developers put their sources into an src folder (it's commonly called the "src layout").

To fix this, multiple solutions:

Keep me posted!

tijuca commented 2 years ago

O.k., after hours of debugging the behaviour I found the root for the problem.

It turned out that in one the Python files within the subfolder netbox/ was an include for an library that wasn't available on my system (it's not packaged yet), in detail there was a line

from sentry_sdk import capture_message

So the shown issue about a non found module netbox wasn't fully right and did hide the real missing module/library. I've no idea if that could be improved within mkdocstrings-handler[-legacy], but a "correct" message about a missed module would be nice. :-)

After I "fixed" that inclusion the mkdocs run was successful.

pawamoy commented 2 years ago

Unfortunately it's almost impossible to distinguish between a path misconfiguration and a missing package/module, since they both raise import errors. It should however provide a better message, stating a few possible reasons for the error, notably missing dependencies. Not sure why it was not displayed here. Closing as there's no actionable item here. Thank you for coming back and reporting the solution!