Skip to content

Commit 57a4b87

Browse files
committed
build(tox): initial support
1 parent 636d967 commit 57a4b87

File tree

5 files changed

+46
-15
lines changed

5 files changed

+46
-15
lines changed

.github/workflows/testing.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
name: Lint
32

4-
name: Build, Lint and Test
5-
6-
on:
7-
push:
8-
branches: [ "master" ]
9-
pull_request:
10-
branches: [ "master" ]
3+
on: [push, pull_request]
114

125
permissions:
136
contents: read
@@ -17,10 +10,12 @@ jobs:
1710
runs-on: ubuntu-latest
1811
steps:
1912
- uses: actions/checkout@v3
20-
- name: Set up Python 3.8
13+
14+
- name: Set up Python 3.12
2115
uses: actions/setup-python@v3
2216
with:
23-
python-version: "3.8"
17+
python-version: "3.12"
18+
2419
- name: Install dependencies
2520
run: |
2621
python -m pip install --upgrade pip
@@ -30,6 +25,3 @@ jobs:
3025
pre-commit run --all-files
3126
- name: Run Ruff
3227
run: ruff check --output-format=github .
33-
- name: Test with pytest
34-
run: |
35-
pytest

.github/workflows/tox.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run Tests with Tox
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.8", "3.9", "3.10", "3.11"]
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install tox
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r dev-requirements.txt
28+
29+
- name: Run tox
30+
run: tox -e py$(echo ${{ matrix.python-version }} | tr -d .)

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: python3.8
2+
python: python3.12
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
55
rev: v4.5.0

dev-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ pytest-cov==5.0.0
44
pytest==8.3.5
55
ruff==0.1.15
66
packaging==23.0
7+
tox==3.28.0
8+
setuptools==75.8.2

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[tox]
2+
envlist = py38, py39, py310, py311, py312
3+
4+
[testenv]
5+
deps =
6+
-r dev-requirements.txt
7+
commands = pytest

0 commit comments

Comments
 (0)