Skip to content

Commit

Permalink
Bump and fix CI for new setuptools (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Jun 22, 2024
1 parent d7add0e commit 0a41076
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
fail-fast: false
matrix:
py:
- "3.13.0-beta.2"
- "3.12"
- "3.11"
- "3.10"
Expand All @@ -37,8 +38,8 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install tox
run: python -m pip install tox
- name: Install tox-uv
run: python -m pip install tox-uv
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -84,8 +85,8 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install tox
run: python -m pip install tox
- name: Install tox-uv
run: python -m pip install tox-uv
- name: Run check for ${{ matrix.tox_env }}
run: tox -e ${{ matrix.tox_env }}
env:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ repos:
rev: "2.1.3"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
additional_dependencies: ["tox>=4.15.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.9"
rev: "v0.4.10"
hooks:
- id: ruff-format
- id: ruff
Expand Down
22 changes: 10 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.18",
"hatchling>=1.24.2",
]

[project]
Expand Down Expand Up @@ -46,23 +46,21 @@ dynamic = [
"version",
]
dependencies = [
"packaging>=23.2",
"packaging>=24.1",
"tomli>=2.0.1; python_version<'3.11'",
]
optional-dependencies.docs = [
"furo>=2023.9.10",
"sphinx<7.2",
"sphinx-autodoc-typehints>=1.25.2",
"furo>=2024.5.6",
"sphinx-autodoc-typehints>=2.2.1",
]
optional-dependencies.testing = [
"covdefaults>=2.3",
"pytest>=7.4.3",
"pytest-cov>=4.1",
"pytest-mock>=3.12",
"setuptools>=69.0.2",
"wheel>=0.42",
"pytest>=8.2.2",
"pytest-cov>=5",
"pytest-mock>=3.14",
"setuptools>=70.1",
]
urls.Homepage = "http://pyproject-api.readthedocs.io"
urls.Homepage = "https://pyproject-api.readthedocs.io"
urls.Source = "https://github.com/tox-dev/pyproject-api"
urls.Tracker = "https://github.com/tox-dev/pyproject-api/issues"

Expand All @@ -81,7 +79,7 @@ lint.select = [
]
lint.ignore = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod"
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Dynamically typed expressions
"COM812", # Conflict with formatter
"CPY", # No copyright statements
Expand Down
5 changes: 1 addition & 4 deletions tests/test_frontend_setuptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import TYPE_CHECKING, Iterator, NamedTuple

import pytest
from packaging.requirements import Requirement

from pyproject_api._frontend import BackendFailed
from pyproject_api._via_fresh_subprocess import SubprocessFrontend
Expand Down Expand Up @@ -59,9 +58,7 @@ def test_setuptools_get_requires_for_build_sdist(frontend_setuptools: Subprocess

def test_setuptools_get_requires_for_build_wheel(frontend_setuptools: SubprocessFrontend) -> None:
result = frontend_setuptools.get_requires_for_build_wheel()
for left, right in zip(result.requires, (Requirement("wheel"),)):
assert isinstance(left, Requirement)
assert str(left) == str(right)
assert not result.requires
assert isinstance(result.out, str)
assert isinstance(result.err, str)

Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ requires =
tox>=4.2
env_list =
fix
py313
py312
py311
py310
Expand Down Expand Up @@ -37,7 +38,7 @@ labels = test
description = run formatter and linters
skip_install = true
deps =
pre-commit>=3.5
pre-commit>=3.7.1
pass_env =
{[testenv]passenv}
PROGRAMDATA
Expand All @@ -47,7 +48,7 @@ commands =
[testenv:type]
description = run type check on code base
deps =
mypy==1.7.1
mypy==1.10
set_env =
{tty:MYPY_FORCE_COLOR = 1}
commands =
Expand All @@ -66,9 +67,9 @@ commands =
description = check that the long description is valid
skip_install = true
deps =
build[virtualenv]>=1.0.3
build[virtualenv]>=1.2.1
check-wheel-contents>=0.6
twine>=4.0.2
twine>=5.1
commands =
python -m build -o {envtmpdir} -s -w .
twine check --strict {envtmpdir}{/}*
Expand All @@ -83,3 +84,4 @@ extras =
commands =
python -m pip list --format=columns
python -c "print(r'{envpython}')"
uv_seed = true

0 comments on commit 0a41076

Please sign in to comment.