Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/integrationtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
permissions: read-all
strategy:
matrix:
python-version: [ '3.10' ]
python-version: [ "3.12" ]

steps:
- uses: actions/checkout@v6
Expand All @@ -25,10 +25,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'

- name: Install the requirements
run: pip install -r requirements.txt
- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install the project with dev dependencies
run: uv sync --extra dev

- name: Execute the integrationtests (http1.1)
run: python3 -m unittest discover tests/integrationtest
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.x']
python-version: ["3.12"]

steps:
- name: Checkout the repository and the branch
Expand All @@ -21,17 +21,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'

- name: Install the requirements
run: pip install -r requirements.txt && pip install setuptools~=65.5.1 mkdocs mkdocs-material
- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Install build tools and documentation dependencies
run: uv sync --extra dev --extra docs

- name: Build a binary wheel and a source tarball
run: >-
Expand All @@ -47,7 +42,7 @@ jobs:
git config --local user.name "github-actions[bot]"

- name: Update the GitHub pages documentation
run: cd docs && mkdocs gh-deploy --force && cd ..
run: cd docs && uv run mkdocs gh-deploy --force && cd ..

- name: Publish distribution package to PyPI
if: startsWith(github.ref, 'refs/tags')
Expand Down
47 changes: 27 additions & 20 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]

steps:
- uses: actions/checkout@v6
Expand All @@ -20,10 +20,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'

- name: Install the requirements
run: pip install -r requirements.txt
- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install the project with dev dependencies
run: uv sync --extra dev

- name: Execute the unittests
run: python3 -m unittest discover tests/unittests
Expand All @@ -33,7 +35,7 @@ jobs:
permissions: write-all
strategy:
matrix:
python-version: [ '3.10' ]
python-version: [ "3.12" ]

steps:
- uses: actions/checkout@v6
Expand All @@ -43,21 +45,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'

- name: Execute the linting checks
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
flake8_args: --config=.flake8
fail_on_error: true
- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install ruff
run: uv sync --extra dev

- name: Execute the linting checks with ruff
run: ruff check .

pr-coverage:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
python-version: [ '3.10' ]
python-version: [ "3.12" ]

steps:
- uses: actions/checkout@v6
Expand All @@ -70,10 +73,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'

- name: Install the requirements
run: pip install -r requirements.txt && pip install pytest-cov coverage-badge
- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install the project and coverage tools
run: uv sync --extra dev

- name: Generate the coverage report
run: export PYTHONPATH=$PWD && pytest --junitxml=pytest.xml --cov=. tests/unittests | tee pytest-coverage.txt
Expand Down Expand Up @@ -117,7 +122,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]
python-version: [ "3.12" ]

steps:
- uses: actions/checkout@v6
Expand All @@ -130,10 +135,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'

- name: Install the requirements
run: pip install pydoc-markdown==4.6.3 mkdocs mkdocs-material
- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install documentation tools
run: uv sync --extra docs

- name: Generate documentation
run: pydoc-markdown --render-toc && rm -rf docs/content && mv build/docs/* docs
Expand Down
65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[build-system]
requires = ["setuptools>=65.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "grafana-api-sdk"
version = "0.9.0"
description = "A Grafana API SDK"
readme = "README.md"
requires-python = ">=3.8"
license = { text = "Apache-2.0 License" }
authors = [
{ name = "Pascal Zimmermann", email = "info@theiotstudio.com" }
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved",
"Operating System :: OS Independent",
]
dependencies = ["httpx"]

[project.optional-dependencies]
http2 = ["httpx[http2]"]
docs = ["pyyaml>=6.0.3", "pydoc-markdown", "mkdocs", "mkdocs-material"]
dev = ["build", "setuptools>=65.0.0", "wheel", "ruff>=0.5.0", "pytest", "pytest-httpx", "pytest-cov", "coverage-badge", "httpx[http2]", "setuptools>=65.0.0", "wheel"]

[project.urls]
Source = "https://github.com/ZPascal/grafana_api_sdk"
"Bug Tracker" = "https://github.com/ZPascal/grafana_api_sdk/issues"
Documentation = "https://zpascal.github.io/grafana_api_sdk/"

[tool.setuptools]
packages = ["grafana_api"]

[tool.ruff]
line-length = 120
target-version = "py38"

[tool.ruff.lint]
select = ["B", "C", "D", "E", "F", "W", "T4", "B902", "B950"]
ignore = ["E203", "E266", "E501", "W503"]
exclude = [".venv", "venv", ".git"]

[tool.ruff.lint.pylint]
max-args = 10

[tool.ruff.lint.mccabe]
max-complexity = 20

[tool.coverage.run]
branch = true
omit = ["*/setup.py"]
source = ["."]

[tool.coverage.report]
fail_under = 80
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

Loading