Skip to content
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
29 changes: 15 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,29 @@ name: Release
on:
push:
tags:
- 'v[0-9]*'
- "v[0-9]*"

jobs:
publish-wheel:

publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # mandatory for trusted publishing
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: "3.13"

- run: |
pip install -U pip setuptools wheel tox
git config --global user.name tester
git config --global user.email tester@example.com
- run: tox -e py,docs,style,security
- run: python setup.py sdist bdist_wheel --universal
- name: Configure git
run: |
git config --global user.name "GH-actions-bot"
git config --global user.email "gh-actions-bot@noreply.github.com"

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: astral-sh/setup-uv@v7
- run: uvx --with tox-uv tox -e py,docs,style
- run: uv build
- uses: pypa/gh-action-pypi-publish@release/v1
83 changes: 53 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,86 @@ on:
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:

name: Test py${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- run: |
pip install -U pip tox
git config --global user.name tester
git config --global user.email tester@example.com
- run: tox -e py
- uses: codecov/codecov-action@v4
- name: Configure git
run: |
git config --global user.name "GH-actions-bot"
git config --global user.email "gh-actions-bot@noreply.github.com"

- uses: astral-sh/setup-uv@v7
- run: uvx --with tox-uv tox -e py

- uses: coverallsapp/github-action@v2
with:
files: .tox/test-reports/coverage.xml
file: .tox/test-reports/coverage.xml
flag-name: python-${{ matrix.python-version }}
parallel: true

test-eol:
# EOL-ed versions of python are exercised on older linux distros
# Testing against these versions will eventually be retired
runs-on: ubuntu-20.04
name: Test py${{ matrix.python-version }} (EOL)
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
python-version: ["3.7"] # Only one ancient python needed for test coverage...

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: deadsnakes/action@v3.2.0
with:
python-version: ${{ matrix.python-version }}

- run: |
pip install -U pip tox
git config --global user.name tester
git config --global user.email tester@example.com
- run: tox -e py
- uses: codecov/codecov-action@v4
- name: Configure git
run: |
git config --global user.name "GH-actions-bot"
git config --global user.email "gh-actions-bot@noreply.github.com"

- uses: astral-sh/setup-uv@v7
- run: uvx --with tox-uv tox -e py

- uses: coverallsapp/github-action@v2
with:
files: .tox/test-reports/coverage.xml
file: .tox/test-reports/coverage.xml
flag-name: python-${{ matrix.python-version }}
parallel: true

linters:
coveralls-finish:
name: Finish Coveralls
needs: [test, test-eol]
runs-on: ubuntu-latest
steps:
- name: Finish parallel build
uses: coverallsapp/github-action@v2
with:
parallel-finished: true

linters:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'
python-version: "3.14"

- run: pip install -U pip tox
- run: tox -e docs,style,security
- uses: astral-sh/setup-uv@v7
- run: uvx --with tox-uv tox -e docs,style
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.DS_Store*
*.lock
.*version
.coverage
.idea/

# Build artifacts
Expand Down
14 changes: 14 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
Release notes
=============

3.9.0 (2026-02-09)
------------------

* Test with py3.14, publish sdist with py3.13

* Removed post-version-bump hook support (unused, unnecessary, and was not well documented)

* Internal project modernizations (use ``uv``, ``ruff``, enabled more linter rules, etc)

* Use coveralls_ for test coverage reporting


3.8.0 (2025-03-25)
------------------

Expand Down Expand Up @@ -555,3 +567,5 @@ Release notes
.. _pip-compile: https://pypi.org/project/pip-tools/

.. _hdeps: https://pypi.org/project/hdeps/

.. _coveralls: https://coveralls.io/
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Simplify your setup.py
:target: https://github.com/codrsquad/setupmeta/actions
:alt: Tested with Github Actions

.. image:: https://codecov.io/gh/codrsquad/setupmeta/branch/main/graph/badge.svg
:target: https://codecov.io/gh/codrsquad/setupmeta
:alt: Test code codecov
.. image:: https://coveralls.io/repos/github/codrsquad/setupmeta/badge.svg?branch=main
:target: https://coveralls.io/github/codrsquad/setupmeta?branch=main
:alt: Code coverage with coveralls

.. image:: https://img.shields.io/pypi/pyversions/setupmeta.svg
:target: https://github.com/codrsquad/setupmeta
Expand Down
4 changes: 1 addition & 3 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ locally installed. You can use pyenv_ for example to get python installations.

Run:

* ``tox -e py310`` (for example) to limit test run to only one python version.
* ``tox -e py314`` (for example) to limit test run to only one python version.

* ``tox -e style`` to run style checks only

* ``tox -e docs`` to verify that the main README.rst renders properly

* ``tox -e security`` to run the security checks


Test coverage
=============
Expand Down
1 change: 0 additions & 1 deletion examples/direct/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from setuptools import setup


setup(
name="direct",
setup_requires=["setupmeta"],
Expand Down
1 change: 0 additions & 1 deletion examples/direct/tests/README.md

This file was deleted.

Empty file removed examples/direct/tests/__init__.py
Empty file.
1 change: 0 additions & 1 deletion examples/hierarchical/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from setuptools import setup


setup(
name="hierarchical",
setup_requires=["setupmeta"],
Expand Down
1 change: 0 additions & 1 deletion examples/single/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from setuptools import setup


setup(
name="single",
setup_requires=["setupmeta"],
Expand Down
1 change: 0 additions & 1 deletion examples/via-cfg/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from setuptools import setup


setup(
setup_requires=["setupmeta"],
)
52 changes: 51 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
[build-system]
requires = ["setuptools!=77.0.3"] # Temporarily avoid 77.0.3, see https://github.com/pypa/setuptools/issues/4902
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.ruff]
cache-dir = ".tox/.ruff_cache"
line-length = 140

[tool.ruff.lint]
ignore = ["RUF005", "RUF012"]
extend-select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # mccabe
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"ERA", # eradicate
"EXE", # flake8-executable
"F", # pyflakes
"FLY", # flynt
"G", # flake8-logging-format
"I", # isort
"INT", # flake8-gettext
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PT", # flake8-pytest
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RSE", # flake8-raise
"RUF", # ruff-specific
"S", #flake8-bandit
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"T10", # flake8-debugger
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"TD", # flake8-todos
"TRY", # tryceratops
"W", # pycodestyle warnings
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S101"] # Sigh `bandit` devs...

[tool.ruff.lint.isort]
order-by-type = false

[tool.ruff.lint.mccabe]
max-complexity = 24

[tool.ruff.lint.pydocstyle]
convention = "numpy"
22 changes: 11 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# This library is self-using and auto-bootstraps itself

import os
import subprocess # nosec
import subprocess
import sys

import setuptools


HERE = os.path.dirname(os.path.abspath(__file__))
EGG = os.path.join(HERE, "setupmeta.egg-info")

Expand Down Expand Up @@ -36,7 +35,7 @@ def decode(text):

def run_bootstrap(message):
sys.stderr.write("--- Bootstrapping %s\n" % message)
p = subprocess.Popen([sys.executable, "setup.py", "egg_info"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # nosec
p = subprocess.Popen([sys.executable, "setup.py", "egg_info"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) # noqa: S603
output, error = p.communicate()
if p.returncode:
print(decode(output))
Expand All @@ -57,13 +56,13 @@ def complete_args(args):
have_egg = os.path.isdir(EGG)

# Explicit on entry points due to bootstrap
args = dict(
name="setupmeta",
entry_points=ENTRY_POINTS,
packages=["setupmeta"],
python_requires=">=3.7",
zip_safe=True,
classifiers=[
args = {
"name": "setupmeta",
"entry_points": ENTRY_POINTS,
"packages": ["setupmeta"],
"python_requires": ">=3.7",
"zip_safe": True,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: MacOS :: MacOS X",
Expand All @@ -78,6 +77,7 @@ def complete_args(args):
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Build Tools",
Expand All @@ -87,7 +87,7 @@ def complete_args(args):
"Topic :: System :: Software Distribution",
"Topic :: Utilities",
],
)
}
if have_egg:
# We're bootstrapped, we can self-refer
complete_args(args)
Expand Down
Loading