Skip to content

Commit 9479b45

Browse files
authored
Improve the CI (#123)
1 parent 7608321 commit 9479b45

File tree

6 files changed

+111
-115
lines changed

6 files changed

+111
-115
lines changed

.github/workflows/check.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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=20"
52+
DIFF_AGAINST: HEAD

.github/workflows/check.yml

Lines changed: 0 additions & 72 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/pytest-print/${{ 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/gh-action-pypi-publish@v1.10.1
47+
with:
48+
attestations: true

.github/workflows/release.yml

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

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytest-print?style=flat-square)](https://pypi.org/project/pytest-print)
66
[![Downloads](https://static.pepy.tech/badge/pytest-print/month)](https://pepy.tech/project/pytest-print)
77
[![PyPI - License](https://img.shields.io/pypi/l/pytest-print?style=flat-square)](https://opensource.org/licenses/MIT)
8-
[![check](https://github.com/pytest-dev/pytest-print/workflows/check/badge.svg)](https://github.com/pytest-dev/pytest-print/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/pytest-dev/pytest-print/actions/workflows/check.yaml/badge.svg)](https://github.com/pytest-dev/pytest-print/actions/workflows/check.yaml)
119

1210
Allows to print extra content onto the PyTest reporting. This can be used for example to report sub-steps for long
1311
running tests, or to print debug information in your tests when you cannot debug the code.
@@ -31,8 +29,7 @@ The plugin provides ability to print information during the tests runs.
3129

3230
### sub-step reporting
3331

34-
For tests that are long running this can provide a feedback to the end-user that what is just happening in the
35-
background.
32+
For tests that are long running this can provide feedback to the end-user that what is just happening in the background.
3633

3734
```python
3835
def test_server_parallel_requests(printer, tmpdir):

tox.ini

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env_list =
1010
3.9
1111
3.8
1212
type
13-
readme
13+
pkg_meta
1414
skip_missing_interpreters = true
1515

1616
[testenv]
@@ -20,15 +20,15 @@ wheel_build_env = .pkg
2020
extras =
2121
test
2222
set_env =
23-
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}{/}.coverage.{envname}}
23+
COVERAGE_FILE = {env:COVERAGE_FILE:{work_dir}{/}.coverage.{env_name}}
2424
commands =
2525
coverage erase
2626
coverage run -m pytest {tty:--color=yes} \
27-
--junitxml {toxworkdir}{/}junit.{envname}.xml \
27+
--junitxml {work_dir}{/}junit.{env_name}.xml \
2828
{posargs:tests}
2929
coverage combine
3030
coverage report
31-
coverage html -d {envtmpdir}{/}htmlcov
31+
coverage html -d {env_tmp_dir}{/}htmlcov
3232

3333
[testenv:fix]
3434
description = run static analysis and style check using flake8
@@ -49,17 +49,17 @@ commands =
4949
mypy --strict src
5050
mypy --strict tests
5151

52-
[testenv:readme]
52+
[testenv:pkg_meta]
5353
description = check that the long description is valid
5454
skip_install = true
5555
deps =
56-
build[uv]>=1.2.2
5756
check-wheel-contents>=0.6
5857
twine>=5.1.1
58+
uv>=0.4.10
5959
commands =
60-
pyproject-build --installer uv --outdir {envtmpdir} --sdist --wheel .
61-
twine check {envtmpdir}{/}*
62-
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}
6363

6464
[testenv:dev]
6565
description = generate a DEV environment

0 commit comments

Comments
 (0)