Skip to content

Commit 83d1356

Browse files
committed
v2.0
- pep621 - add GitHUB Actions - add pre-commit
1 parent 659ea85 commit 83d1356

27 files changed

+778
-626
lines changed

.github/workflows/release.yml

+48
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@v5
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-env/${{ 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/tests.yml

+51
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+
- type
28+
- dev
29+
- pkg_meta
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
- name: Install the latest version of uv
35+
uses: astral-sh/setup-uv@v5
36+
with:
37+
enable-cache: true
38+
cache-dependency-glob: "pyproject.toml"
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Install tox
41+
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
42+
- name: Install Python
43+
if: startsWith(matrix.env, '3.') && matrix.env != '3.13'
44+
run: uv python install --python-preference only-managed ${{ matrix.env }}
45+
- name: Setup test suite
46+
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
47+
- name: Run test suite
48+
run: tox run --skip-pkg-install -e ${{ matrix.env }}
49+
env:
50+
PYTEST_ADDOPTS: "-vv --durations=20"
51+
DIFF_AGAINST: HEAD

.gitignore

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
.idea
2-
.cache
3-
.envrc
4-
.tox
1+
.*
2+
~*
53
dist
6-
pytest_echo.egg-info
4+
build
5+
*.egg-info
76
*.pyc
87
__pycache__
98
docs/_build
10-
.coverage
11-
~build
12-
build
9+
/src/pytest_echo/version.py
10+
!.gitignore
11+
!.github
12+
!.coveragerc
13+
!.pre-commit-config.yaml

.pre-commit-config.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- repo: https://github.com/python-jsonschema/check-jsonschema
8+
rev: 0.31.0
9+
hooks:
10+
- id: check-github-workflows
11+
args: ["--verbose"]
12+
# - repo: https://github.com/codespell-project/codespell
13+
# rev: v2.4.0
14+
# hooks:
15+
# - id: codespell
16+
# additional_dependencies: ["tomli>=2.0.1"]
17+
- repo: https://github.com/tox-dev/tox-ini-fmt
18+
rev: "1.5.0"
19+
hooks:
20+
- id: tox-ini-fmt
21+
args: ["-p", "lint"]
22+
- repo: https://github.com/tox-dev/pyproject-fmt
23+
rev: "v2.5.0"
24+
hooks:
25+
- id: pyproject-fmt
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: "v0.9.4"
28+
hooks:
29+
- id: ruff-format
30+
- id: ruff
31+
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
32+
- repo: https://github.com/rbubley/mirrors-prettier
33+
rev: "v3.4.2"
34+
hooks:
35+
- id: prettier
36+
additional_dependencies:
37+
38+
- "@prettier/[email protected]"
39+
- repo: meta
40+
hooks:
41+
- id: check-hooks-apply
42+
- id: check-useless-excludes

.travis.yml

-26
This file was deleted.

CHANGELOG

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.0
2+
---
3+
* add support python 3.9..3.13
4+
*
5+
16
1.8.1
27
-----
38
* drop support for python < 3.9
@@ -26,7 +31,7 @@
2631

2732
1.5
2833
---
29-
* add support for 'globbing' package version and enviromnent variables
34+
* add support for 'globbing' package version and environment variables
3035
* add python 3.5 and 3.6 support
3136

3237
1.4

MANIFEST.in

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
graft docs
22
include CHANGELOG
33
include LICENSE
4-
include pytest_echo.py
5-
include README.rst
6-
include setup.py
7-
include test_echo.py
8-
include tox.ini
4+
include src/*.py
5+
include README.md

Makefile

-13
This file was deleted.

0 commit comments

Comments
 (0)