DataBackend typo in plugin documentation #9129

Closed
opened 2025-12-29 20:46:01 +01:00 by adam · 6 comments
Owner

Originally created by @minijackson on GitHub (Jan 22, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

3.7.0

Python Version

3.11

Steps to Reproduce

Hello, I'm packaging the 3.7.1 version of NetBox, but the griffe build fails due to this link introduced in #14095:

https://github.com/netbox-community/netbox/blob/develop/docs/plugins/development/data-backends.md?plain=1#L23

Which from my understanding should be netbox.data_backends.DataBackend

Expected Behavior

Griffe successfully builds the documentation.

Observed Behavior

Griffe fails with:

ERROR   -  Error reading page 'plugins/development/data-backends.md': Could not resolve alias core.data_backends.DataBackend pointing at netbox.data_backends.DataBackend (in netbox/core/data_backends.py:13)
Originally created by @minijackson on GitHub (Jan 22, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version 3.7.0 ### Python Version 3.11 ### Steps to Reproduce Hello, I'm packaging the 3.7.1 version of NetBox, but the griffe build fails due to this link introduced in #14095: https://github.com/netbox-community/netbox/blob/develop/docs/plugins/development/data-backends.md?plain=1#L23 Which from my understanding should be `netbox.data_backends.DataBackend` ### Expected Behavior Griffe successfully builds the documentation. ### Observed Behavior Griffe fails with: ``` ERROR - Error reading page 'plugins/development/data-backends.md': Could not resolve alias core.data_backends.DataBackend pointing at netbox.data_backends.DataBackend (in netbox/core/data_backends.py:13) ```
adam added the status: acceptedtype: documentation labels 2025-12-29 20:46:01 +01:00
adam closed this issue 2025-12-29 20:46:01 +01:00
Author
Owner

@jeffgdotorg commented on GitHub (Jan 22, 2024):

Can you please help me understand your packaging target, and especially what a griffe build is? We're not familiar with that build framework.

@jeffgdotorg commented on GitHub (Jan 22, 2024): Can you please help me understand your packaging target, and especially what a griffe build is? We're not familiar with that build framework.
Author
Owner

@minijackson commented on GitHub (Jan 22, 2024):

Sorry, I should have provided more details. griffe is the Python library that powers the mkdocs project, it extracts the structure of the codebase, for example to provide function signatures.

This errors happens in our build during the python -m mkdocs build command.

@minijackson commented on GitHub (Jan 22, 2024): Sorry, I should have provided more details. [griffe](https://mkdocstrings.github.io/griffe/) is the Python library that powers the mkdocs project, it extracts the structure of the codebase, for example to provide function signatures. This errors happens in our build during the `python -m mkdocs build` command.
Author
Owner

@jeremystretch commented on GitHub (Jan 22, 2024):

The NetBox documentation is built by calling mkdocs directly:

$ mkdocs build
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /home/jstretch/projects/netbox/netbox/project-static/docs
INFO    -  The following pages exist in the docs directory, but are not included in the "nav" configuration:
             - index.md
INFO    -  Documentation built in 3.74 seconds
@jeremystretch commented on GitHub (Jan 22, 2024): The NetBox documentation is built by calling `mkdocs` directly: ``` $ mkdocs build INFO - Cleaning site directory INFO - Building documentation to directory: /home/jstretch/projects/netbox/netbox/project-static/docs INFO - The following pages exist in the docs directory, but are not included in the "nav" configuration: - index.md INFO - Documentation built in 3.74 seconds ```
Author
Owner

@minijackson commented on GitHub (Jan 22, 2024):

That's weird, from reading the source code of mkdocs this shouldn't be any different. I should investigate why it works on your end and not mine.

Though I still feel that the documentation I linked has a typo, DataBackend is defined in netbox.data_backends, and not core.data_backends

@minijackson commented on GitHub (Jan 22, 2024): That's weird, from reading the source code of mkdocs this shouldn't be any different. I should investigate why it works on your end and not mine. Though I still feel that the documentation I linked has a typo, `DataBackend` is defined in `netbox.data_backends`, and not `core.data_backends`
Author
Owner

@jeremystretch commented on GitHub (Jan 22, 2024):

The DataBackend class is imported into core.data_backends, which is why the documentation renders correctly.

I'm fine with updating its location in the Markdown file to be more correct, though I couldn't say whether it will solve your problem. I'm going to make that change and close this out as it's not a NetBox issue.

@jeremystretch commented on GitHub (Jan 22, 2024): The `DataBackend` class is imported into `core.data_backends`, which is why [the documentation](https://docs.netbox.dev/en/stable/plugins/development/data-backends/#netbox.data_backends.DataBackend) renders correctly. I'm fine with updating its location in the Markdown file to be more correct, though I couldn't say whether it will solve your problem. I'm going to make that change and close this out as it's not a NetBox issue.
Author
Owner

@minijackson commented on GitHub (Jan 22, 2024):

Thank you! This helps

@minijackson commented on GitHub (Jan 22, 2024): Thank you! This helps
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9129