Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.13, remove Python 3.8 and update CI Workflow #3767

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 64 additions & 22 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- main
- "[0-9].[0-9]+-branch"
tags:
- "*"
# Build pull requests
pull_request:

Expand All @@ -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 }}
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/pyramid/scripts/pshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 2 additions & 8 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
15 changes: 7 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
[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

[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 =
Expand Down
Loading