Skip to content

Commit 889e90a

Browse files
authored
Improve the CI (#134)
1 parent 6fcc54d commit 889e90a

File tree

7 files changed

+119
-137
lines changed

7 files changed

+119
-137
lines changed

.github/workflows/check.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: check
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: ["main"]
6+
tags-ignore: ["**"]
7+
pull_request:
8+
schedule:
9+
- cron: "0 8 * * *"
10+
11+
concurrency:
12+
group: check-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
env:
22+
- "3.13"
23+
- "3.12"
24+
- "3.11"
25+
- "3.10"
26+
- "3.9"
27+
- "3.8"
28+
- type
29+
- dev
30+
- pkg_meta
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
- name: Install the latest version of uv
36+
uses: astral-sh/setup-uv@v3
37+
with:
38+
enable-cache: true
39+
cache-dependency-glob: "pyproject.toml"
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
- name: Install tox
42+
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
43+
- name: Install Python
44+
if: startsWith(matrix.env, '3.') && matrix.env != '3.13'
45+
run: uv python install --python-preference only-managed ${{ matrix.env }}
46+
- name: Setup test suite
47+
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
48+
- name: Run test suite
49+
run: tox run --skip-pkg-install -e ${{ matrix.env }}
50+
env:
51+
PYTEST_ADDOPTS: "-vv --durations=5"

.github/workflows/check.yml

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

.github/workflows/release.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release to PyPI
2+
on:
3+
push:
4+
tags: ["*"]
5+
6+
env:
7+
dists-artifact-name: python-package-distributions
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Install the latest version of uv
17+
uses: astral-sh/setup-uv@v3
18+
with:
19+
enable-cache: true
20+
cache-dependency-glob: "pyproject.toml"
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Build package
23+
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: ${{ env.dists-artifact-name }}
28+
path: dist/*
29+
30+
release:
31+
needs:
32+
- build
33+
runs-on: ubuntu-latest
34+
environment:
35+
name: release
36+
url: https://pypi.org/project/devpi-process/${{ github.ref_name }}
37+
permissions:
38+
id-token: write
39+
steps:
40+
- name: Download all the dists
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: ${{ env.dists-artifact-name }}
44+
path: dist/
45+
- name: Publish to PyPI
46+
uses: pypa/[email protected]
47+
with:
48+
attestations: true

.github/workflows/release.yml

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

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/devpi-process?style=flat-square)](https://pypi.org/project/devpi-process)
66
[![Downloads](https://static.pepy.tech/badge/devpi-process/month)](https://pepy.tech/project/devpi-process)
77
[![PyPI - License](https://img.shields.io/pypi/l/devpi-process?style=flat-square)](https://opensource.org/licenses/MIT)
8-
[![check](https://github.com/tox-dev/devpi-process/workflows/check/badge.svg)](https://github.com/tox-dev/devpi-process/actions?query=workflow%3Acheck)
9-
[![Code style:
10-
black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
8+
[![check](https://github.com/tox-dev/devpi-process/actions/workflows/check.yaml/badge.svg)](https://github.com/tox-dev/devpi-process/actions/workflows/check.yaml)
119

1210
Allows you to create [devpi](https://devpi.net/docs/devpi/devpi/stable/+d/index.html) server process with indexes, and
1311
upload artifacts to that programmatically.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ dependencies = [
5151
"devpi-server>=6.12.1",
5252
"typing-extensions>=4.12.2; python_version<'3.11'",
5353
]
54-
optional-dependencies.test = [
54+
optional-dependencies.testing = [
5555
"covdefaults>=2.3",
5656
"httpx>=0.27.2",
5757
"pytest>=8.3.2",

tox.ini

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,33 @@ env_list =
1111
3.9
1212
3.8
1313
type
14-
readme
14+
pkg_meta
1515
skip_missing_interpreters = true
1616

1717
[testenv]
18-
description = run the unit tests with pytest under {basepython}
18+
description = run the unit tests with pytest under {base_python}
1919
package = wheel
2020
wheel_build_env = .pkg
2121
extras =
22-
test
22+
testing
23+
pass_env =
24+
DIFF_AGAINST
25+
PYTEST_*
2326
set_env =
24-
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
25-
COVERAGE_PROCESS_START = {toxinidir}/pyproject.toml
26-
_COVERAGE_SRC = {envsitepackagesdir}/devpi_process
27+
COVERAGE_FILE = {work_dir}/.coverage.{env_name}
2728
commands =
28-
pytest {tty:--color=yes} {posargs: \
29-
--junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}devpi_process \
30-
--cov {toxinidir}{/}tests --cov-fail-under=100 \
29+
python -m pytest {tty:--color=yes} {posargs: \
30+
--cov {env_site_packages_dir}{/}devpi_process --cov {tox_root}{/}tests \
3131
--cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
32-
--cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \
32+
--cov-report html:{env_tmp_dir}{/}htmlcov --cov-report xml:{work_dir}{/}coverage.{env_name}.xml \
33+
--junitxml {work_dir}{/}junit.{env_name}.xml \
3334
tests}
3435

3536
[testenv:fix]
36-
description = run static analysis and style check using flake8
37+
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
3738
skip_install = true
3839
deps =
39-
pre-commit-uv>=4.1
40-
pass_env =
41-
HOMEPATH
42-
PROGRAMDATA
40+
pre-commit-uv>=4.1.1
4341
commands =
4442
pre-commit run --all-files --show-diff-on-failure
4543

@@ -51,24 +49,21 @@ commands =
5149
mypy src
5250
mypy tests
5351

54-
[testenv:readme]
52+
[testenv:pkg_meta]
5553
description = check that the long description is valid
5654
skip_install = true
5755
deps =
58-
build[uv]>=1.2.2
5956
check-wheel-contents>=0.6
6057
twine>=5.1.1
58+
uv>=0.4.10
6159
commands =
62-
pyproject-build --installer uv --outdir {envtmpdir} --sdist --wheel .
63-
twine check {envtmpdir}{/}*
64-
check-wheel-contents --no-config {envtmpdir}
60+
uv build --sdist --wheel --out-dir {env_tmp_dir} .
61+
twine check {env_tmp_dir}{/}*
62+
check-wheel-contents --no-config {env_tmp_dir}
6563

6664
[testenv:dev]
6765
description = generate a DEV environment
6866
package = editable
69-
extras =
70-
docs
71-
test
7267
commands =
7368
uv pip tree
7469
python -c 'import sys; print(sys.executable)'

0 commit comments

Comments
 (0)