Skip to content
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

Update all the packaging #149

Merged
merged 20 commits into from
Jan 25, 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
2 changes: 0 additions & 2 deletions .codecov.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ source =
omit =
tap/tests/*
# This is tested with tox -e module in CI.
tap/__main__.py
src/tap/__main__.py
45 changes: 20 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [3.7, 3.8, 3.9, '3.10', 'pypy-3.7']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
os: [macos-latest, ubuntu-latest, windows-latest]

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

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

Expand All @@ -31,39 +31,34 @@ jobs:
runs-on: ubuntu-latest

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

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

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

- name: Run tox
run: tox -e with_optional,runner,module,integration
run: tox -e with_optional,runner,module,integration,coverage

coverage:
needs: extra
runs-on: ubuntu-latest
- name: Combine coverage & fail if it's <100%
run: |
python -Im pip install --upgrade coverage[toml]

steps:
- uses: actions/checkout@v2
python -Im coverage html --skip-covered --skip-empty

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install tox and any other packages
run: pip install tox
# Report and write to summary.
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

- name: Collect coverage data
run: tox -e coverage
# Report again and fail if under 100%.
python -Im coverage report --fail-under=100

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
- 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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
uv run pytest
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ tappy
=====

[![PyPI version][pypishield]](https://pypi.python.org/pypi/tap.py)
[![Coverage][coverage]](https://codecov.io/github/python-tap/tappy)

<img align="right" src="https://github.com/python-tap/tappy/blob/main/docs/images/tap.png"
alt="TAP logo" />
Expand Down Expand Up @@ -111,7 +110,6 @@ for tips on how to get started.

[tap]: http://testanything.org/
[pypishield]: https://img.shields.io/pypi/v/tap.py.svg
[coverage]: https://img.shields.io/codecov/c/github/python-tap/tappy.svg
[rtd]: http://tappy.readthedocs.io/en/latest/
[pypi]: https://pypi.python.org/pypi/tap.py
[stream]: https://github.com/python-tap/tappy/blob/main/docs/images/stream.gif
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# tappy documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 11 20:21:22 2014.
Expand All @@ -12,8 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys

sys.path.append(os.path.abspath(".."))
from tap import __version__ # noqa
Expand Down
30 changes: 22 additions & 8 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tappy should be easy to contribute to. If anything is unclear about how to
contribute, please submit an issue on GitHub so that we can fix it!

How
-----
---

Fork tappy on `GitHub <https://github.com/python-tap/tappy>`_ and
`submit a Pull Request <https://help.github.com/articles/creating-a-pull-request/>`_
Expand All @@ -20,17 +20,14 @@ so we can discuss the change.
Setup
-----

tappy uses the built-in `venv` module.
tappy uses [uv](https://docs.astral.sh/uv/) for development.

.. code-block:: console

$ git clone [email protected]:python-tap/tappy.git
$ cd tappy
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements-dev.txt
$ # Edit some files and run the tests.
$ pytest
$ make test

The commands above show how to get a tappy clone configured.
If you've executed those commands
Expand All @@ -40,9 +37,26 @@ you should be ready to develop.
Guidelines
----------

1. Code uses Black style. Please run it through ``black tap`` to autoformat.
2. Make sure your change works against main with unit tests.
1. Code uses Ruff for formatting and linting.
If you have `pre-commit`, you can add ruff hooks via `pre-commit install`.
These hooks will run as part of CI.
Changes will not be accepted unless CI passes.
2. Make sure your change works with unit tests.
3. Document your change in the ``docs/releases.rst`` file.
4. For first time contributors, please add your name to ``AUTHORS``
so you get attribution for you effort.
This is also to recognize your claim to the copyright in the project.

Release checklist
-----------------

These are notes for my release process,
so I don't have to remember all the steps.
Other contributors are free to ignore this.

1. Update ``docs/releases.rst``.
2. Update version in ``pyproject.toml`` and ``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``
13 changes: 13 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
tappy is a set of tools for working with the `Test Anything Protocol (TAP)
<http://testanything.org/>`_, a line based test protocol for recording test
data in a standard way.

Follow tappy development on `GitHub <https://github.com/python-tap/tappy>`_.
Developer documentation is on
`Read the Docs <https://tappy.readthedocs.io/>`_.

Releases
========

Version 3.2, To Be Released
---------------------------

* Drop support for Python 3.6 (it is end-of-life).
* Drop support for Python 3.7 (it is end-of-life).
* Drop support for Python 3.8 (it is end-of-life).
* Add support for Python 3.11.
* Add support for Python 3.12.
* Add support for Python 3.13.

Version 3.1, Released December 29, 2021
---------------------------------------
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 = "tap.py"
version = "3.2"
description = "Test Anything Protocol (TAP) tools"
readme = "docs/releases.rst"
license = {text = "BSD"}
authors = [
{ name = "Matt Layman", email = "[email protected]" }
]
homepage = "https://github.com/python-tap/tappy"
requires-python = ">=3.9"
dependencies = []
keywords = ["TAP", "unittest"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"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.optional-dependencies]
yaml = ["more-itertools", "PyYAML>=5.1"]

[project.scripts]
tappy = "tap.main:main"
tap = "tap.main:main"

[dependency-groups]
dev = [
"coverage>=7.6.10",
"pytest>=8.3.4",
"ruff>=0.9.3",
"sphinx>=7.4.7",
"tox>=4.24.1",
# These are the optional dependencies to enable TAP version 13 support.
"more-itertools>=10.6.0",
"pyyaml>=6.0.2",
]

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

[tool.hatch.build.targets.sdist]
include = ["src/*", "docs/releases.rst", "LICENSE"]
sources = ["src"]

[tool.hatch.build.targets.wheel]
include = ["src/*", "docs/releases.rst", "LICENSE"]
sources = ["src"]

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

[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",
]
16 changes: 0 additions & 16 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 tap/__init__.py → src/tap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .runner import TAPTestRunner

__all__ = ["TAPTestRunner"]
__version__ = "3.1"
__version__ = "3.2"
File renamed without changes.
Loading
Loading