Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ _build
.venv
.vscode
.VSCodeCounter

uv.lock
3 changes: 2 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sphinx:

python:
install:
- requirements: doc-requirements.txt
- method: pip
path: .
extra_requirements:
- docs
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing

## Formatting and linting

The easiest way to run the formatting and linting is to use the [pre-commit] tool.
Install it, then run:

```bash
pre-commit run --all
```

This will run formatting and linting on all files in the repository (principally using [ruff]).

To install as a pre-commit hook:

```bash
pre-commit install
```

## Managing the Python code

The pyproject.toml follows the [PEP621] standard.
To install all dependencies you may use [uv]:

```bash
uv sync --all-groups --all-extras
```

A Makefile exits to execute some common tasks:
```bash
make docs-html
make docs-linkcheck
make format
make lint
make test
make test-matrix
```

The test matrix is executed using [nox] and runs all tests in all supported Python versions.
The Python versions must be pre-installed on your system.

[pre-commit]: https://pre-commit.com/
[ruff]: https://docs.astral.sh/ruff/
[uv]: https://docs.astral.sh/uv/
[nox]: https://nox.thea.codes
[PEP621]: https://peps.python.org/pep-0621/
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

7 changes: 0 additions & 7 deletions doc-requirements.txt

This file was deleted.

41 changes: 6 additions & 35 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,24 @@
PYTHON_VERSIONS = ["3.10", "3.12"]
SPHINX_VERSIONS = ["5.0", "7.2.5", "8.1.3"]
SPHINX_NEEDS_VERSIONS = ["2.1", "4.2"]
TEST_DEPENDENCIES = [
"pytest",
"pytest-xdist",
]
LINT_DEPENDENCIES = [
"flake8",
"pep8-naming",
"flake8-isort",
"flake8-black",
]


def is_supported(python: str, sphinx: str) -> bool:
return not (python == "3.6" and float(sphinx) > 3.0) # fmt: skip


def run_tests(session, sphinx, sphinx_needs):
session.install(".")
session.install(*TEST_DEPENDENCIES)
session.install(".[test]")
session.run("pip", "install", f"sphinx=={sphinx}", silent=True)
session.run("pip", "install", f"sphinx_needs=={sphinx_needs}", silent=True)
session.run("pip", "install", "-r", "doc-requirements.txt", silent=True)
session.run("make", "test", external=True)


@session(python=PYTHON_VERSIONS)
@nox.parametrize("sphinx_needs", SPHINX_NEEDS_VERSIONS)
@nox.parametrize("sphinx", SPHINX_VERSIONS)
def tests(session, sphinx_needs, sphinx):
if is_supported(session.python, sphinx):
run_tests(session, sphinx, sphinx_needs)
else:
session.skip("unsupported combination")

run_tests(session, sphinx, sphinx_needs)

@session(python="3.9")
def lint(session):
session.install(*LINT_DEPENDENCIES)
session.run("make", "lint", external=True)


@session(python="3.9")
@session(python="3.12")
def linkcheck(session):
session.install(".")
# LinkCheck cn handle rate limits since Sphinx 3.4, which is needed as
# our doc has to many links to GitHub.
session.run("pip", "install", "sphinx==3.5.4", silent=True)

session.run("pip", "install", "-r", "doc-requirements.txt", silent=True)
session.run("make", "docs-linkcheck", external=True)
session.install(".[docs]")
with session.chdir("docs"):
session.run("make", "linkcheck", external=True)
39 changes: 28 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "sphinx-test-reports"
version = "1.2.0"
description = "Sphinx extension for showing test results and test environment information inside sphinx documentations"
readme = "README.rst"
requires-python = ">=3.6"
license = { text = "MIT" }
authors = [{ name = "team useblocks", email = "info@useblocks.com" }]
dependencies = ["sphinx>4.0", "lxml", "sphinx-needs>=1.0.1"]
classifiers = [
"Framework :: Sphinx",
"Framework :: Sphinx :: Extension",
Expand All @@ -27,20 +25,39 @@ classifiers = [
"Topic :: Documentation",
]
keywords = ["sphinx", "documentation", "test-reports"]
requires-python = ">=3.9"
dependencies = ["sphinx>4.0", "lxml", "sphinx-needs>=1.0.1"]

[project.urls]
[project.optional-dependencies]
test = [
"nox>=2025.2.9",
"pytest-xdist",
"pytest>=7.0",
"sphinx_design",
"sphinxcontrib-plantuml",
]
docs = [
"pillow",
"sphinx-design",
"sphinx-immaterial",
"sphinx-needs>=4",
"sphinx-test-reports>=0.3.3",
"sphinx==7",
"sphinxcontrib-plantuml",
]

[dependency-groups]
dev = ["pre-commit~=3.0", "nox>=2025.2.9"]

[tool.flit.module]
name = "sphinxcontrib.test_reports"

[project.urls]
Homepage = "https://github.com/useblocks/sphinx-test-reports"
Repository = "https://github.com/useblocks/sphinx-test-reports.git"
Documentation = "https://sphinx-test-reports.readthedocs.io/en/latest/"
download-url = "http://pypi.python.org/pypi/sphinx-test-reports"

[tool.setuptools.packages.find]
include = ["*"]

[project.optional-dependencies]
development = ["wheel"]

[tool.ruff.lint]
# TODO enable and fix commented rules
extend-select = [
Expand Down
1 change: 0 additions & 1 deletion sphinxcontrib/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions test-requirements.txt

This file was deleted.