diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 37f0d86cd..5a155a0c1 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -7,6 +7,7 @@ on: - main - "[0-9].[0-9]+-branch" tags: + - "*" # Build pull requests pull_request: @@ -15,34 +16,67 @@ jobs: strategy: matrix: py: - - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" - - "pypy-3.8" + - "3.13" + - "pypy-3.9" + - "pypy-3.10" + # Pre-release os: - - "ubuntu-20.04" - - "windows-2022" - - "macos-11" + - "ubuntu-22.04" + - "windows-latest" + - "macos-14" # arm64 + - "macos-13" # x64 architecture: - x64 - x86 - + - arm64 include: - # Only run coverage on ubuntu-20.04, except on pypy3 - - os: "ubuntu-20.04" + - os: "ubuntu-22.04" pytest-args: "--cov" - - os: "ubuntu-20.04" - py: "pypy-3.8" + - py: "pypy-3.9" + toxenv: "pypy39" + pytest-args: "" + - py: "pypy-3.10" + toxenv: "pypy310" pytest-args: "" - exclude: - # Linux and macOS don't have x86 python - - os: "ubuntu-20.04" + # Ubuntu does not have x86/arm64 Python + - os: "ubuntu-22.04" architecture: x86 - - os: "macos-11" + - os: "ubuntu-22.04" + architecture: arm64 + # MacOS we need to make sure to remove x86 on all + # We need to run no arm64 on macos-13 (Intel), but some + # Python versions: 3.9/3.10 + # + # From 3.11 onward, there is support for running x64 and + # arm64 on Apple Silicon based systems (macos-14) + - os: "macos-13" architecture: x86 + - os: "macos-13" + architecture: arm64 + - os: "macos-14" + architecture: x86 + - os: "macos-14" + architecture: x64 + py: "3.9" + - os: "macos-14" + architecture: x64 + py: "3.10" + # Windows does not have arm64 releases + - os: "windows-latest" + architecture: arm64 + # Don't run all PyPy versions except latest on + # Windows/macOS. They are expensive to run. + - os: "windows-latest" + py: "pypy-3.9" + - os: "macos-13" + py: "pypy-3.9" + - os: "macos-14" + py: "pypy-3.9" name: "Python: ${{ matrix.py }}-${{ matrix.architecture }} on ${{ matrix.os }}" runs-on: ${{ matrix.os }} @@ -54,41 +88,49 @@ jobs: python-version: ${{ matrix.py }} architecture: ${{ matrix.architecture }} - run: pip install tox - - name: Running tox + - name: Running tox with specific toxenv + if: ${{ matrix.toxenv != '' }} + env: + TOXENV: ${{ matrix.toxenv }} + run: tox + - name: Running tox for current python version + if: ${{ matrix.toxenv == '' }} run: tox -e py -- ${{ matrix.pytest-args }} + coverage: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 name: Validate coverage steps: - uses: actions/checkout@v4 - name: Setup python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: "3.13" architecture: x64 + - run: pip install tox - - run: tox -e py312-cover,coverage + - run: tox -e py313-cover,coverage docs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 name: Build the documentation steps: - uses: actions/checkout@v4 - name: Setup python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.13" architecture: x64 - run: pip install tox - run: tox -e docs lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 name: Lint the package steps: - uses: actions/checkout@v4 - name: Setup python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.13" architecture: x64 - run: pip install tox - run: tox -e lint diff --git a/src/pyramid/scripts/pshell.py b/src/pyramid/scripts/pshell.py index 4d3817ffb..6e392b1ae 100644 --- a/src/pyramid/scripts/pshell.py +++ b/src/pyramid/scripts/pshell.py @@ -193,7 +193,7 @@ def setup_env(self): if k not in orig_env or v is not orig_env[k]: if getattr(v, '__doc__', False): env_help[k] = v.__doc__.replace("\n", " ") - else: + else: # pragma: nocover -- Python >= 3.13 has a __doc__ env_help[k] = v del orig_env diff --git a/tests/test_util.py b/tests/test_util.py index bf4c08988..c96e7bb1f 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -66,13 +66,10 @@ def worker(obj): self.assertEqual(1, foo.y) def test_property_without_name(self): - def worker(obj): # pragma: no cover - pass - foo = Dummy() helper = self._getTargetClass() self.assertRaises( - ValueError, helper.set_property, foo, property(worker) + ValueError, helper.set_property, foo, "has_no___name__" ) def test_property_with_name(self): @@ -271,11 +268,8 @@ def worker(obj): self.assertEqual(1, foo.y) def test_property_without_name(self): - def worker(obj): # pragma: no cover - pass - foo = self._makeOne() - self.assertRaises(ValueError, foo.set_property, property(worker)) + self.assertRaises(ValueError, foo.set_property, "has_no___name__") def test_property_with_name(self): def worker(obj): diff --git a/tox.ini b/tox.ini index ff962a935..8336991f7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = lint, - py38,py39,py310,py311,py312,pypy3, - py312-cover,coverage, + py38,py39,py310,py311,py312,py313,pypy39,pypy310, + coverage, docs isolated_build = true @@ -10,17 +10,16 @@ isolated_build = true [testenv] commands = python --version - pytest {posargs:} + python -mpytest \ + pypy39: --no-cov \ + pypy310: --no-cov \ + cover: --cov \ + {posargs:} extras = testing setenv = COVERAGE_FILE=.coverage.{envname} -[testenv:py312-cover] -commands = - python --version - pytest --cov {posargs:} - [testenv:lint] skip_install = true commands =