Skip to content

Commit

Permalink
Configuring for buildout-recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Jul 15, 2024
1 parent 92d3008 commit 455efd0
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 20 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ source =

[report]
precision = 2
ignore_errors = True
exclude_lines =
except ImportError:
if __name__ == '__main__':
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,30 @@ jobs:
fail-fast: false
matrix:
os:
- ["ubuntu", "ubuntu-20.04"]
- ["ubuntu", "ubuntu-latest"]
config:
# [Python version, tox env]
- ["3.9", "lint"]
- ["3.7", "py37"]
- ["3.11", "release-check"]
- ["3.11", "lint"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["pypy-3.9", "pypy3"]
- ["3.9", "coverage"]
- ["3.12", "py312"]
- ["pypy-3.10", "pypy3"]
- ["3.11", "coverage"]

runs-on: ${{ matrix.os[1] }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
Expand All @@ -51,7 +52,11 @@ jobs:
python -m pip install --upgrade pip
pip install tox
- name: Test
if: ${{ !startsWith(runner.os, 'Mac') }}
run: tox -e ${{ matrix.config[1] }}
- name: Test (macOS)
if: ${{ startsWith(runner.os, 'Mac') }}
run: tox -e ${{ matrix.config[1] }}-universal2
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
Expand Down
3 changes: 2 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
[meta]
template = "buildout-recipe"
commit-id = "fe63cb4c"
commit-id = "6e808865"

[python]
with-pypy = true
with-sphinx-doctests = false
with-windows = false
with-future-python = false
with-macos = false
with-docs = false

[coverage]
fail-under = 100
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/buildout-recipe
[bdist_wheel]
universal = 0

[flake8]
doctests = 1
Expand Down
36 changes: 27 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,54 @@
[tox]
minversion = 3.18
envlist =
release-check
lint
py37
py38
py39
py310
py311
py312
pypy3
coverage

[testenv]
usedevelop = true
deps =
setuptools < 69
setenv =
py312: VIRTUALENV_PIP=23.1.2
py312: PIP_REQUIRE_VIRTUALENV=0
commands =
zope-testrunner --test-path=src {posargs:-vc}
extras =
test

[testenv:lint]
[testenv:release-check]
description = ensure that the distribution is ready to release
basepython = python3
skip_install = true
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 src setup.py
check-manifest
check-python-versions
deps =
twine
build
check-manifest
check-python-versions >= 0.19.1
check-python-versions >= 0.20.0
wheel
flake8
commands_pre =
commands =
check-manifest
check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml
python -m build --sdist --no-isolation
twine check dist/*

[testenv:lint]
basepython = python3
skip_install = true
deps =
isort
flake8
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 src setup.py

[testenv:isort-apply]
basepython = python3
Expand All @@ -52,6 +69,7 @@ setenv =
COVERAGE_PROCESS_START={toxinidir}/.coveragerc
deps =
coverage
setuptools < 69
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage erase
Expand Down

0 comments on commit 455efd0

Please sign in to comment.