diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 853d956..35bb20e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -106,13 +106,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - 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: Install package manager dependencies run: | sudo apt-get update @@ -127,6 +120,10 @@ jobs: libfl-dev \ libbenchmark-dev \ libz-dev + - name: Install Python dependencies + run: | + pip install -U pip + pip install tox - name: Run tests env: BMQ_BROKER_URI: tcp://localhost:30114 @@ -153,39 +150,19 @@ 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 + python-version: "3.13" + - name: Install tox + run: pip install tox + - name: Lint sources run: | - ./venv/bin/python -m pip install -e . + tox run -e lint + tox run -e lint-cython 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 - - name: Lint sources - env: - PYTHON: ./venv/bin/python - run: | - make lint - - 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")'