feat: Update the project to use a pyproject.toml#154
Draft
ZPascal wants to merge 12 commits into
Draft
Conversation
ZPascal
force-pushed
the
migration-to-pyproject-toml
branch
3 times, most recently
from
July 2, 2026 04:47
eaacde0 to
368abae
Compare
- Successfully built wheel and source distribution using only pyproject.toml - Wheel contains all 31 grafana_api modules and dist-info metadata - Package installs successfully from wheel without setup.py - Package imports without errors - All 1034 unit tests pass - Build configured in pyproject.toml is fully functional Signed-off-by: Pascal Zimmermann <pascal.zimmermann@theiotstudio.com>
ZPascal
force-pushed
the
migration-to-pyproject-toml
branch
from
July 4, 2026 13:47
b4b776b to
791275f
Compare
- Remove setuptools from main dependencies (it should only be in dev) - Pin setuptools to <73.0.0 to maintain pkg_resources compatibility with coverage-badge - Apply ruff auto-fixes to resolve 2305 linting errors Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add noqa directives for B017 (blind exception) errors in tests (383 cases) - Ignore pre-existing docstring issues (D100, D101, D102, D103, D104, D107, D205, D401, D417) - Fix E721: Use isinstance() instead of type() for type comparisons - Fix B008: Replace function call in default argument with None and initialize inside function - Refactor to avoid redundant json.loads() calls Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add two new tests to cover the PublicDashboard default argument handling: - test_create_public_dashboard_with_none_default: Tests with None explicitly passed - test_create_public_dashboard_with_explicit_object: Tests with explicit PublicDashboard object These tests ensure 100% code coverage including all branch coverage paths. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Remove unused PublicDashboard import that was causing F401 linting error. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
|
Replace Python 3.10+ union type syntax (PublicDashboard | None) with Optional[PublicDashboard] for compatibility with Python 3.8+. This fixes the pr-test (3.8) job failure in the GitHub Actions workflow. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
|
The 'Generate the coverage report' step was missing the 'uv run' prefix before pytest, causing the command to fail when run in the GitHub Actions environment. This fix ensures pytest and pytest-cov are properly invoked through the uv environment. Fixes pr-coverage job failure. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
Replace all instances of 'type | None' syntax with 'Optional[type]' for Python 3.8/3.9 compatibility. This fixes the following: - grafana_api/datasource.py: datasource_uid parameter - grafana_api/folder.py: folder_uid variable - grafana_api/user.py: dashboard_uid parameters in star/unstar methods Added 'from typing import Optional' imports to affected files. This ensures the code works with Python 3.8, 3.9+ as required by the project. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The 'Generate documentation' step was failing because 'docs/build' already existed from previous runs. Fixed by explicitly removing docs/build, docs/content, and docs/mkdocs.yml before moving the generated documentation. This ensures the mv command doesn't fail with 'Directory not empty' error when trying to overwrite existing documentation. Fixes pr-documentation job failure. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Contributor
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #122