Skip to content

Commit cd0381d

Browse files
committed
wip! tox
1 parent 24db4e1 commit cd0381d

File tree

2 files changed

+25
-48
lines changed

2 files changed

+25
-48
lines changed

.github/workflows/build.yaml

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ jobs:
106106
uses: actions/setup-python@v5
107107
with:
108108
python-version: ${{ matrix.python-version }}
109-
- name: Create virtual environment
110-
run: |
111-
python3 -m venv venv
112-
- name: Install Python dependencies
113-
run: |
114-
./venv/bin/python -m pip install --upgrade pip
115-
./venv/bin/python -m pip install -r requirements-dev.txt
116109
- name: Install package manager dependencies
117110
run: |
118111
sudo apt-get update
@@ -127,6 +120,10 @@ jobs:
127120
libfl-dev \
128121
libbenchmark-dev \
129122
libz-dev
123+
- name: Install Python dependencies
124+
run: |
125+
pip install -U pip
126+
pip install tox
130127
- name: Run tests
131128
env:
132129
BMQ_BROKER_URI: tcp://localhost:30114
@@ -153,39 +150,19 @@ jobs:
153150
key: ${{ needs.blazingmq-dependency.outputs.blazingmq_sha }}
154151
- name: Restore cached BlazingMQ build artifacts
155152
run: tar xzf blazingmq_artifacts.tar.gz
156-
- name: Set up Python 3.9
153+
- name: Set up Python 3.13
157154
uses: actions/setup-python@v5
158155
with:
159-
python-version: "3.9"
160-
- name: Create virtual environment
161-
run: |
162-
python3 -m venv venv
163-
- name: Install Python dependencies
164-
run: |
165-
./venv/bin/python -m pip install --upgrade pip
166-
./venv/bin/python -m pip install -r requirements-dev.txt
167-
- name: Set up dependencies
168-
run:
169-
sudo apt-get install clang-format
170-
- name: Install Package
171-
run: |
172-
./venv/bin/python -m pip install -e .
173-
env:
174-
PREFIX: blazingmq_artifacts
175-
PYTHON: ./venv/bin/python
176-
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig:./blazingmq_artifacts/lib64/pkgconfig
156+
python-version: "3.13"
157+
- name: Install tox
158+
run: pip install tox
177159
- name: Lint sources
178-
run: tox run -e lint-types
160+
run: |
161+
tox run -e lint
162+
tox run -e lint-cython
179163
env:
180164
PREFIX: blazingmq_artifacts
181165
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig:./blazingmq_artifacts/lib64/pkgconfig
182-
- name: Build docs
183-
run: |
184-
./venv/bin/python -m towncrier build --version 99.99 --name blazingmq --keep
185-
make docs
186-
env:
187-
PYTHON: ./venv/bin/python
188-
SPHINXBUILD: ../venv/bin/sphinx-build
189166

190167
coverage:
191168
name: Coverage

tox.ini

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
[tox]
2-
envlist = py39,lint, lint-cython, lint-types, black, docs
3-
minversion = 3.2.1
2+
requires = tox>=4
3+
envlist = lint, lint-cython, lint-types, black, docs, py3{9,10,11,12,13}
44
isolated_build = true
55

66
[testenv]
7+
description =
8+
Run tests under {basepython}
9+
cov: with coverage
10+
711
setenv =
812
cov: CYTHON_TEST_MACROS=1
913

@@ -26,51 +30,47 @@ commands =
2630

2731
commands_cov = {basepython} -m pytest -v --timeout=30 --cov --cov-report=term --cov-fail-under=100 --cov-append --junitxml={toxworkdir}/{envname}_integration.xml --cov-report=xml:{toxworkdir}/coverage.xml
2832

29-
description =
30-
Run tests under {basepython}
31-
cov: with coverage
32-
3333
[testenv:.package]
3434
description = Isolated build environment
35-
basepython = python3.9
35+
basepython = python3.13
3636

37-
[testenv:py39-cov]
37+
[testenv:py313-cov]
3838
usedevelop = True
3939
commands = {[testenv]commands_cov}
4040
deps = -rrequirements-test-coverage.txt
4141

4242
[testenv:lint]
4343
description = Run lint checker on Python files
44-
basepython = python3.9
44+
basepython = python3.13
4545
deps = flake8
4646
skip_install = true
4747
commands = {basepython} -m flake8 --config={toxinidir}/.flake8 src
4848

4949
[testenv:lint-cython]
5050
description = Run lint checker on Cython files
51-
basepython = python3.9
51+
basepython = python3.13
5252
deps = flake8
5353
skip_install = true
5454
commands = {basepython} -m flake8 --config={toxinidir}/.flake8.cython src
5555

5656

5757
[testenv:lint-types]
5858
description = Run mypy checker on examples
59-
basepython = python3.9
59+
basepython = python3.13
6060
deps =
6161
mypy
62-
commands = {basepython} -m mypy --strict examples
62+
commands = {basepython} -m mypy --strict {posargs:src/blazingmq examples}
6363

6464
[testenv:black]
6565
description = Check that python files are formatted with black
66-
basepython = python3.9
66+
basepython = python3.13
6767
deps = black
6868
skip_install = true
6969
commands = {basepython} -m black --check --verbose src tests
7070

7171
[testenv:docs]
7272
description = Generate library documentation
73-
basepython = python3.9
73+
basepython = python3.13
7474
deps = -rrequirements-lint-docs.txt
7575
commands = make -C docs html
7676
{basepython} -c 'print("documentation available under file://{toxworkdir}/docs_out/index.html")'

0 commit comments

Comments
 (0)