From 0beab6050975a76b67a340e44c43c508815330c1 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Fri, 12 Dec 2025 14:39:19 -0500 Subject: [PATCH 1/2] CI: Use Tox Signed-off-by: Patrick M. Niedzielski --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 853d956..f4457a7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -175,10 +175,10 @@ jobs: PYTHON: ./venv/bin/python PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig:./blazingmq_artifacts/lib64/pkgconfig - name: Lint sources + run: tox run -e lint-types env: - PYTHON: ./venv/bin/python - run: | - make lint + PREFIX: blazingmq_artifacts + PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig:./blazingmq_artifacts/lib64/pkgconfig - name: Build docs run: | ./venv/bin/python -m towncrier build --version 99.99 --name blazingmq --keep From 03a55de63153e5e8e3cc7f7725273db7f6571d67 Mon Sep 17 00:00:00 2001 From: "Patrick M. Niedzielski" Date: Mon, 15 Dec 2025 11:45:51 -0500 Subject: [PATCH 2/2] wip! tox --- .github/workflows/build.yaml | 35 ++++++++--------------------------- tox.ini | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f4457a7..928bd1d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -153,39 +153,20 @@ jobs: key: ${{ needs.blazingmq-dependency.outputs.blazingmq_sha }} - name: Restore cached BlazingMQ build artifacts run: tar xzf blazingmq_artifacts.tar.gz - - name: Set up Python 3.9 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: "3.9" - - name: Create virtual environment - run: | - python3 -m venv venv - - name: Install Python dependencies - run: | - ./venv/bin/python -m pip install --upgrade pip - ./venv/bin/python -m pip install -r requirements-dev.txt - - name: Set up dependencies - run: - sudo apt-get install clang-format - - name: Install Package - run: | - ./venv/bin/python -m pip install -e . - env: - PREFIX: blazingmq_artifacts - PYTHON: ./venv/bin/python - PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig:./blazingmq_artifacts/lib64/pkgconfig + python-version: "3.13" + - name: Install tox + run: pip install tox - name: Lint sources - run: tox run -e lint-types + run: | + tox run -e lint + tox run -e lint-cython + tox run -e lint-types env: PREFIX: blazingmq_artifacts PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig:./blazingmq_artifacts/lib64/pkgconfig - - name: Build docs - run: | - ./venv/bin/python -m towncrier build --version 99.99 --name blazingmq --keep - make docs - env: - PYTHON: ./venv/bin/python - SPHINXBUILD: ../venv/bin/sphinx-build coverage: name: Coverage diff --git a/tox.ini b/tox.ini index 5a47a21..8eba74d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,13 @@ [tox] -envlist = py39,lint, lint-cython, lint-types, black, docs -minversion = 3.2.1 +requires = tox>=4 +envlist = lint, lint-cython, lint-types, black, docs, py3{9,10,11,12,13} isolated_build = true [testenv] +description = + Run tests under {basepython} + cov: with coverage + setenv = cov: CYTHON_TEST_MACROS=1 @@ -26,29 +30,25 @@ commands = 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 -description = - Run tests under {basepython} - cov: with coverage - [testenv:.package] description = Isolated build environment -basepython = python3.9 +basepython = python3.13 -[testenv:py39-cov] +[testenv:py313-cov] usedevelop = True commands = {[testenv]commands_cov} deps = -rrequirements-test-coverage.txt [testenv:lint] description = Run lint checker on Python files -basepython = python3.9 +basepython = python3.13 deps = flake8 skip_install = true commands = {basepython} -m flake8 --config={toxinidir}/.flake8 src [testenv:lint-cython] description = Run lint checker on Cython files -basepython = python3.9 +basepython = python3.13 deps = flake8 skip_install = true commands = {basepython} -m flake8 --config={toxinidir}/.flake8.cython src @@ -56,21 +56,21 @@ commands = {basepython} -m flake8 --config={toxinidir}/.flake8.cython src [testenv:lint-types] description = Run mypy checker on examples -basepython = python3.9 +basepython = python3.13 deps = mypy -commands = {basepython} -m mypy --strict examples +commands = {basepython} -m mypy --strict {posargs:src/blazingmq examples} [testenv:black] description = Check that python files are formatted with black -basepython = python3.9 +basepython = python3.13 deps = black skip_install = true commands = {basepython} -m black --check --verbose src tests [testenv:docs] description = Generate library documentation -basepython = python3.9 +basepython = python3.13 deps = -rrequirements-lint-docs.txt commands = make -C docs html {basepython} -c 'print("documentation available under file://{toxworkdir}/docs_out/index.html")'