Skip to content

Update packaging. #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 30, 2025
Merged
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
31 changes: 12 additions & 19 deletions .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,29 @@ File an issue in GitHub
and we can discuss your bug/feature/idea.
If you are ready to start coding...

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

```bash
$ git clone git@github.com:python-tap/pytest-tap.git
$ cd pytest-tap
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements-dev.txt
$ # Edit some files and run the tests.
$ pytest
$ make test
```

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

...profit! :moneybag:

# Making Releases
# Release checklist

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

The steps to release are roughly:

```bash
# Set docs/releases.rst with an appropriate changelog.
$ bump2version minor
$ python -m build
$ twine upload dist/*
```
1. Update `docs/releases.rst`.
2. Update version in `pyproject.toml` and `src/pytest_tap/__init__.py`.
3. `rm -rf dist && uv build`
4. `uv publish`
5. `git tag -a vX.X -m "Version X.X"`
6. `git push --tags`
51 changes: 23 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,18 @@ name: Python package
on: [push]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

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

- name: Check for lint
run: tox -e lint

build:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [3.8, 3.9, '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -48,21 +30,34 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.13'

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

- name: Collect coverage data
run: tox -e coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
- name: Combine coverage & fail if it's <100%
run: |
python -Im pip install --upgrade coverage[toml]

python -Im coverage html --skip-covered --skip-empty

# Report and write to summary.
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

# Report again and fail if under 100%.
python -Im coverage report --fail-under=100

- name: Upload HTML report if check failed
uses: actions/upload-artifact@v4
with:
fail_ci_if_error: true
verbose: true
name: html-report
path: htmlcov
if: ${{ failure() }}
18 changes: 8 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
repos:
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
language_version: python3.9
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.4.0
hooks:
- id: flake8
language_version: python3.9
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
# Run the linter.
- id: ruff
args: [ --fix, --unsafe-fixes ]
# Run the formatter.
- id: ruff-format
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
uv run tox -e py312
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ pytest-tap
.. |license| image:: https://img.shields.io/pypi/l/pytest-tap.svg
:target: https://raw.githubusercontent.com/python-tap/pytest-tap/master/LICENSE
:alt: BSD license
.. |coverage| image:: https://img.shields.io/codecov/c/github/python-tap/pytest-tap.svg
:target: https://codecov.io/github/python-tap/pytest-tap
:alt: Coverage

Test Anything Protocol (TAP) reporting plugin for
`pytest <http://pytest.org/latest/>`_
Expand Down
22 changes: 22 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
pytest-tap is a reporting plugin for pytest that outputs
`Test Anything Protocol (TAP) <http://testanything.org/>`_ data.
TAP is a line based test protocol for recording test data in a standard way.

Use ``pytest --tap`` after installing to get started.

Follow `GitHub <https://github.com/python-tap/pytest-tap>`_
for more information or to follow this plugin's development.
Additional developer documentation about Python and TAP is on
`Read the Docs <https://tappy.readthedocs.io/>`_.

Releases
========

Version 3.5, To Be Released
---------------------------

* Diagnostics now output logs, stdout, stderr for failed tests.
Use the standard ``--show-capture`` flag to control the output.
* Diagnostics can display for passing tests using the
``--tap-log-passing-tests`` flag.
* Add support for Python 3.12.
* Add support for Python 3.13.
* Drop support for Python 3.8 (it is end-of-life).

Version 3.4, July 15, 2023
--------------------------

Expand Down
83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[project]
name = "pytest-tap"
version = "3.5"
description = "Test Anything Protocol (TAP) reporting plugin for pytest"
readme = "docs/releases.rst"
authors = [
{ name = "Matt Layman", email = "matthewlayman@gmail.com" }
]
license = { text = "BSD" }
homepage = "https://github.com/python-tap/pytest-tap"
dependencies = [
"pytest>=3.0",
"tap.py>=3.2,<4.0"
]
requires-python = ">=3.9"
keywords = ["TAP", "unittest", "pytest"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Testing"
]

[project.entry-points.pytest11]
tap = "pytest_tap.plugin"

[dependency-groups]
dev = [
"pytest-tap",
"tox>=4.24.1",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.sdist]
include = [
"/src",
"/docs",
"/tests",
]
sources = ["src"]

[tool.hatch.build.targets.wheel]
sources = ["src"]
packages = ["pytest_tap"]

[tool.pytest.ini_options]
pythonpath = [".", "src"]

[tool.uv.sources]
pytest-tap = { workspace = true }

[tool.ruff.lint]
select = [
# pycodestyle
"E",
"W",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bandit
"S",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]
ignore = [
# bandit: Use of `assert` detected
"S101",
]
10 changes: 0 additions & 10 deletions requirements-dev.txt

This file was deleted.

16 changes: 0 additions & 16 deletions setup.cfg

This file was deleted.

53 changes: 0 additions & 53 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/pytest_tap/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.4"
__version__ = "3.5"
Loading