From 7bbf5c0697afce5ccd78f8f8cee75ec0095a313a Mon Sep 17 00:00:00 2001 From: mrbean-bremen Date: Thu, 3 Dec 2026 19:18:41 +0100 Subject: [PATCH] Add project documentation and AI guidelines - add issue and PR templates - add contributing guide, including AI usage guidelines - add project section to documentation - remove old requirements.txt files, update pyproject.toml - copied and adapted from pyfakefs documentation --- .github/ISSUE_TEMPLATE/bug_report.md | 26 +++++++ .github/ISSUE_TEMPLATE/feature_request.md | 17 +++++ .github/PULL_REQUEST_TEMPLATE.md | 13 ++++ .pre-commit-config.yaml | 2 +- .readthedocs.yaml | 9 ++- CHANGELOG.md | 5 ++ CONTRIBUTING.md | 93 +++++++++++++++++++++++ README.md | 12 ++- docs/requirements.txt | 2 - docs/source/conf.py | 1 + docs/source/contributing.rst | 5 ++ docs/source/index.rst | 8 ++ docs/source/license.rst | 7 ++ docs/source/release_notes.rst | 5 ++ pyproject.toml | 5 ++ requirements.txt | 2 - requirements_dev.txt | 5 -- 17 files changed, 203 insertions(+), 14 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 CONTRIBUTING.md delete mode 100644 docs/requirements.txt create mode 100644 docs/source/contributing.rst create mode 100644 docs/source/license.rst create mode 100644 docs/source/release_notes.rst delete mode 100644 requirements.txt delete mode 100644 requirements_dev.txt diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..1157c44 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +Describe the observed behavior, and what you expect to happen instead. +In case of a crash, please provide the complete stack trace. + +**How To Reproduce** +Please provide a unit test or a minimal reproducible example that shows +the problem. + +**Your environment** +Please run the following in the environment where the problem happened and +paste the output. +```bash +python -c "import platform; print(platform.platform())" +python -c "import sys; print('Python', sys.version)" +python -c "from pytest_order import __version__; print('pytest-order', __version__)" +python -c "import pytest; print('pytest', pytest.__version__)" +``` diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..e12f065 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: 'enhancement' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A description of any alternative solutions or features you've considered. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..527a1d0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ +#### Describe the changes + +The related issue or a description of the bug or feature that this PR addresses. + +#### Tasks + +- [ ] Fix or feature added +- [ ] Any AI-generated code has been reviewed line by line +- [ ] Unit tests added that reproduce the issue or prove feature is working +- [ ] Entry to release notes added +- [ ] Pre-commit CI shows no errors +- [ ] Unit tests passing +- [ ] For documentation changes: The Read the Docs preview builds and looks as expected diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6460c13..b029528 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,4 +44,4 @@ repos: rev: v2.4.1 hooks: - id: mypy - exclude: (docs|pyfakefs/tests) + exclude: docs diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 7f24f5c..393d841 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,9 +4,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.11" + python: "3.13" sphinx: configuration: docs/source/conf.py @@ -14,4 +14,7 @@ sphinx: python: install: - - requirements: docs/requirements.txt + - method: pip + path: . + extra_requirements: + - doc diff --git a/CHANGELOG.md b/CHANGELOG.md index f6e0e1b..ea99c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ `--order-group-scope` is used (see [#279](https://github.com/pytest-dev/pytest-order/pull/279)) +### Documentation +- added issue and PR templates +- added contributing guide, including AI usage guidelines +- added project section to documentation + ## [Version 1.5.0](https://pypi.org/project/pytest-order/1.5.0/) (2026-06-13) Adds option to abort tests after a failed ordering. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a28acde --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,93 @@ +# Contributing to pytest-order + +We welcome any contributions that help to improve this pytest plugin for the community. +Contributions may include bug reports, bug fixes, new features, infrastructure enhancements, or +documentation updates. + +## How to contribute + +### Reporting Bugs + +If you think you found a bug in `pytest-order`, you +can [create an issue](https://help.github.com/articles/creating-an-issue/). +Before filing the bug, please check, if it still exists in the [main branch](https://github.com/pytest-dev/pytest-order). +If you can reproduce the problem, please provide enough information so that it can be reproduced by other developers. +This includes: + +* The Operating System +* The Python version +* A minimal example to reproduce the problem (preferably in the form of a failing test) +* The stack trace in case of an unexpected exception. + For better readability, you may + use [markdown code formatting](https://help.github.com/articles/creating-and-highlighting-code-blocks/) for any + included code. + +### Proposing Enhancements + +If you need a specific feature that is not implemented, or have an idea for a useful addition, +you may also create a respective issue. +As usually, implementing it yourself is the best chance to get it done! +The next item has some information on doing this. + +### Contributing Code + +The preferred workflow for contributing code is to +[fork](https://help.github.com/articles/fork-a-repo/) the [repository](https://github.com/pytest-dev/pytest-order) on +GitHub, clone it, +develop on a feature branch, +and [create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork) when done. +There are a few things to consider for contributing code: + +* We ensure the [PEP-8 coding style](https://www.python.org/dev/peps/pep-0008/) + by using [ruff](https://docs.astral.sh/ruff/formatter/) auto-format in a + pre-commit hook. We recommend to locally install + [pre-commit](https://pypi.org/project/pre-commit/) (`pre-commit install`) to run the linter + tests on check-in, or run the tests on demand (`pre-commit run --all-files`). +* Provide unit tests for bug fixes or new functionality - check the existing tests for examples. +* Provide meaningful commit messages - it is ok to amend the commits to improve the comments. +* Check that the automatic GitHub Action CI tests all pass for your pull request. +* Be ready to adapt your changes after a code review. + +### Contributing Documentation + +If you want to improve the existing documentation, you can do this also using a pull request. +You can contribute to: + +* the documentation published on [Read the Docs](https://pytest-order.readthedocs.io/) + and located in `docs/source` using + [reStructuredText syntax](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) +* the [README](https://github.com/pytest-dev/pytest-order/blob/main/README.md) + using [markdown syntax](https://help.github.com/articles/basic-writing-and-formatting-syntax/) + +To build the documentation locally, you need to install the needed dependencies by calling + +``` +python -m pip install .[doc] +``` + +from your source directory. Then you can create the documentation: + +``` +cd docs +make html +``` + +The generated documentation will be located under *docs/build/html*. + +### Usage of LLMs/AI + +It is perfectly fine to use AI to help to write your code, provided you +understand the subject well enough yourself, and have reviewed any code +generated by AI. We also expect a non-AI-generated summary of the PR (or issue) - +perfect wording is not needed. + +The same holds for documentation. AI tends to over-document and +duplicate information, which makes the documentation less readable. +Long AI-generated details will be rejected unless reduced to reasonable +human-readable levels. + +Our policy regarding AI contributions is in line with the respective +[pytest policy](https://github.com/pytest-dev/pytest/blob/main/CONTRIBUTING.rst#aillm-assisted-contributions-policy). +Please refer to that policy for more details and background. + +Thank you for taking the time to contribute to pytest-order! diff --git a/README.md b/README.md index ca552fa..c81a7dc 100644 --- a/README.md +++ b/README.md @@ -95,10 +95,20 @@ yields the output: Contributing ------------ -Contributions are very welcome. Tests can be run with + +Contributions are very welcome - refer to the +[contributing guide](https://pytest-order.readthedocs.io/en/latest/contributing.html) for details. Tests can be run with [tox](https://tox.readthedocs.io/en/latest/), please ensure the coverage at least stays the same before you submit a pull request. +We are always grateful for meaningful contributions - refer to the +[contributing guide](https://pytest-order.readthedocs.io/en/latest/contributing.html) +for more information. However, we value human contributions, not purly +AI-generated code. The usage of AI tools is helpful and completely fine, +provided that the authors use them as tools and understand what they are doing. +Our policy regarding AI contributions is in line with the respective +[pytest policy](https://github.com/pytest-dev/pytest/blob/main/CONTRIBUTING.rst#aillm-assisted-contributions-policy). +Please refer to that policy for details and background. License ------- Distributed under the terms of the [MIT](http://opensource.org/licenses/MIT) diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 374aae9..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -sphinx>=2.3.1 -furo diff --git a/docs/source/conf.py b/docs/source/conf.py index f68a225..3518b0e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -34,6 +34,7 @@ "sphinx.ext.coverage", "sphinx.ext.viewcode", "sphinx.ext.githubpages", # puts .nojekyll file into source + "myst_parser", ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst new file mode 100644 index 0000000..85af7bb --- /dev/null +++ b/docs/source/contributing.rst @@ -0,0 +1,5 @@ +Contributing Guide +================== + +.. include:: ../../CONTRIBUTING.md + :parser: myst_parser.sphinx_ diff --git a/docs/source/index.rst b/docs/source/index.rst index 8f7326d..27fbd49 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,3 +11,11 @@ Content of the documentation usage configuration other_plugins + +.. toctree:: + :caption: About the project + :hidden: + + release_notes + contributing + license diff --git a/docs/source/license.rst b/docs/source/license.rst new file mode 100644 index 0000000..8236b43 --- /dev/null +++ b/docs/source/license.rst @@ -0,0 +1,7 @@ +License +======= + +Distributed under the terms of the MIT license, pytest-order is free and open source software. + +.. include:: ../../LICENSE + :literal: diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst new file mode 100644 index 0000000..38ac82f --- /dev/null +++ b/docs/source/release_notes.rst @@ -0,0 +1,5 @@ +Release Notes +============= + +.. include:: ../../CHANGELOG.md + :parser: myst_parser.sphinx_ diff --git a/pyproject.toml b/pyproject.toml index 13bd15c..8a45f33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,11 @@ dev = [ "pytest-xdist>=1.29.0", "pytest-dependency>=0.5.1", ] +doc = [ + "sphinx>=7.0.0", + "furo>=2025.12.19", + "myst-parser>=5.0.0" +] [project.urls] homepage = "https://github.com/pytest-dev/pytest-order" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 4bf0bd2..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest>=6.2.4; python_version < "3.14" -pytest>=7.4; python_version >= "3.14" diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index 3413617..0000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,5 +0,0 @@ --r requirements.txt --e . -pytest-mock>=1.11.0 -pytest-xdist>=1.29.0 -pytest-dependency>=0.5.1