Skip to content

Commit 8fca473

Browse files
Update packaging. (#95)
* Update packaging. * Switch to Ruff for pre-commit. * Do some additional cleanup. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e8f9c78 commit 8fca473

File tree

16 files changed

+407
-167
lines changed

16 files changed

+407
-167
lines changed

.github/contributing.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,29 @@ File an issue in GitHub
44
and we can discuss your bug/feature/idea.
55
If you are ready to start coding...
66

7-
pytest-tap uses the `venv` module
8-
and a requirements file
9-
to manage development.
7+
pytest-tap uses [uv](https://docs.astral.sh/uv/) for development.
108

119
```bash
1210
$ git clone [email protected]:python-tap/pytest-tap.git
1311
$ cd pytest-tap
14-
$ python3 -m venv venv
15-
$ source venv/bin/activate
16-
$ pip install -r requirements-dev.txt
1712
$ # Edit some files and run the tests.
18-
$ pytest
13+
$ make test
1914
```
2015

2116
Once your feature or bug fix is ready,
2217
[submit a Pull Request](https://help.github.com/articles/creating-a-pull-request/>).
2318

2419
...profit! :moneybag:
2520

26-
# Making Releases
21+
# Release checklist
2722

28-
pytest-tap uses `bump2version`
29-
to set the proper version
30-
for releases.
23+
These are notes for my release process,
24+
so I don't have to remember all the steps.
25+
Other contributors are free to ignore this.
3126

32-
The steps to release are roughly:
33-
34-
```bash
35-
# Set docs/releases.rst with an appropriate changelog.
36-
$ bump2version minor
37-
$ python -m build
38-
$ twine upload dist/*
39-
```
27+
1. Update `docs/releases.rst`.
28+
2. Update version in `pyproject.toml` and `src/pytest_tap/__init__.py`.
29+
3. `rm -rf dist && uv build`
30+
4. `uv publish`
31+
5. `git tag -a vX.X -m "Version X.X"`
32+
6. `git push --tags`

.github/workflows/tests.yml

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,18 @@ name: Python package
33
on: [push]
44

55
jobs:
6-
lint:
7-
runs-on: ubuntu-latest
8-
9-
steps:
10-
- uses: actions/checkout@v3
11-
12-
- name: Setup Python
13-
uses: actions/setup-python@v4
14-
with:
15-
python-version: '3.11'
16-
17-
- name: Install tox and any other packages
18-
run: pip install tox
19-
20-
- name: Check for lint
21-
run: tox -e lint
22-
236
build:
24-
needs: lint
257
runs-on: ${{ matrix.os }}
268
strategy:
279
matrix:
28-
python: [3.8, 3.9, '3.10', '3.11']
10+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
2911
os: [macos-latest, ubuntu-latest, windows-latest]
3012

3113
steps:
32-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
3315

3416
- name: Setup Python
35-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
3618
with:
3719
python-version: ${{ matrix.python }}
3820

@@ -48,21 +30,34 @@ jobs:
4830
runs-on: ubuntu-latest
4931

5032
steps:
51-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
5234

5335
- name: Setup Python
54-
uses: actions/setup-python@v4
36+
uses: actions/setup-python@v5
5537
with:
56-
python-version: '3.11'
38+
python-version: '3.13'
5739

5840
- name: Install tox and any other packages
5941
run: pip install tox
6042

6143
- name: Collect coverage data
6244
run: tox -e coverage
6345

64-
- name: Upload coverage to Codecov
65-
uses: codecov/codecov-action@v2
46+
- name: Combine coverage & fail if it's <100%
47+
run: |
48+
python -Im pip install --upgrade coverage[toml]
49+
50+
python -Im coverage html --skip-covered --skip-empty
51+
52+
# Report and write to summary.
53+
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
54+
55+
# Report again and fail if under 100%.
56+
python -Im coverage report --fail-under=100
57+
58+
- name: Upload HTML report if check failed
59+
uses: actions/upload-artifact@v4
6660
with:
67-
fail_ci_if_error: true
68-
verbose: true
61+
name: html-report
62+
path: htmlcov
63+
if: ${{ failure() }}

.pre-commit-config.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 24.10.0
4-
hooks:
5-
- id: black
6-
language_version: python3.9
7-
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v1.4.0
9-
hooks:
10-
- id: flake8
11-
language_version: python3.9
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.7.4
4+
hooks:
5+
# Run the linter.
6+
- id: ruff
7+
args: [ --fix, --unsafe-fixes ]
8+
# Run the formatter.
9+
- id: ruff-format

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

MANIFEST.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test:
2+
uv run tox -e py312

README.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ pytest-tap
99
.. |license| image:: https://img.shields.io/pypi/l/pytest-tap.svg
1010
:target: https://raw.githubusercontent.com/python-tap/pytest-tap/master/LICENSE
1111
:alt: BSD license
12-
.. |coverage| image:: https://img.shields.io/codecov/c/github/python-tap/pytest-tap.svg
13-
:target: https://codecov.io/github/python-tap/pytest-tap
14-
:alt: Coverage
1512

1613
Test Anything Protocol (TAP) reporting plugin for
1714
`pytest <http://pytest.org/latest/>`_

docs/releases.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1+
pytest-tap is a reporting plugin for pytest that outputs
2+
`Test Anything Protocol (TAP) <http://testanything.org/>`_ data.
3+
TAP is a line based test protocol for recording test data in a standard way.
4+
5+
Use ``pytest --tap`` after installing to get started.
6+
7+
Follow `GitHub <https://github.com/python-tap/pytest-tap>`_
8+
for more information or to follow this plugin's development.
9+
Additional developer documentation about Python and TAP is on
10+
`Read the Docs <https://tappy.readthedocs.io/>`_.
11+
112
Releases
213
========
314

15+
Version 3.5, To Be Released
16+
---------------------------
17+
18+
* Diagnostics now output logs, stdout, stderr for failed tests.
19+
Use the standard ``--show-capture`` flag to control the output.
20+
* Diagnostics can display for passing tests using the
21+
``--tap-log-passing-tests`` flag.
22+
* Add support for Python 3.12.
23+
* Add support for Python 3.13.
24+
* Drop support for Python 3.8 (it is end-of-life).
25+
426
Version 3.4, July 15, 2023
527
--------------------------
628

pyproject.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[project]
2+
name = "pytest-tap"
3+
version = "3.5"
4+
description = "Test Anything Protocol (TAP) reporting plugin for pytest"
5+
readme = "docs/releases.rst"
6+
authors = [
7+
{ name = "Matt Layman", email = "[email protected]" }
8+
]
9+
license = { text = "BSD" }
10+
homepage = "https://github.com/python-tap/pytest-tap"
11+
dependencies = [
12+
"pytest>=3.0",
13+
"tap.py>=3.2,<4.0"
14+
]
15+
requires-python = ">=3.9"
16+
keywords = ["TAP", "unittest", "pytest"]
17+
classifiers = [
18+
"Development Status :: 5 - Production/Stable",
19+
"Framework :: Pytest",
20+
"Intended Audience :: Developers",
21+
"License :: OSI Approved :: BSD License",
22+
"Operating System :: OS Independent",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
28+
"Topic :: Software Development :: Testing"
29+
]
30+
31+
[project.entry-points.pytest11]
32+
tap = "pytest_tap.plugin"
33+
34+
[dependency-groups]
35+
dev = [
36+
"pytest-tap",
37+
"tox>=4.24.1",
38+
]
39+
40+
[build-system]
41+
requires = ["hatchling"]
42+
build-backend = "hatchling.build"
43+
44+
[tool.hatch.build.targets.sdist]
45+
include = [
46+
"/src",
47+
"/docs",
48+
"/tests",
49+
]
50+
sources = ["src"]
51+
52+
[tool.hatch.build.targets.wheel]
53+
sources = ["src"]
54+
packages = ["pytest_tap"]
55+
56+
[tool.pytest.ini_options]
57+
pythonpath = [".", "src"]
58+
59+
[tool.uv.sources]
60+
pytest-tap = { workspace = true }
61+
62+
[tool.ruff.lint]
63+
select = [
64+
# pycodestyle
65+
"E",
66+
"W",
67+
# Pyflakes
68+
"F",
69+
# pyupgrade
70+
"UP",
71+
# flake8-bandit
72+
"S",
73+
# flake8-bugbear
74+
"B",
75+
# flake8-simplify
76+
"SIM",
77+
# isort
78+
"I",
79+
]
80+
ignore = [
81+
# bandit: Use of `assert` detected
82+
"S101",
83+
]

requirements-dev.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)