Skip to content

Commit 6cc4e9e

Browse files
authored
Release Traits 6.4.3 (#1756)
This PR: - backports PR #1755 to the release branch - updates the version and changelog in preparation for a Traits 6.4.3 release EDIT: Updated 2023-09-11 to backport PRs #1757 and #1758.
1 parent 93583b9 commit 6cc4e9e

11 files changed

+89
-68
lines changed

Diff for: .github/workflows/release-to-pypi.yml

+13-22
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,29 @@ jobs:
1616
steps:
1717

1818
- name: Check out the release commit
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Set up QEMU
22-
uses: docker/setup-qemu-action@v2
22+
uses: docker/setup-qemu-action@v3
2323
with:
2424
platforms: arm64
2525
if: runner.os == 'Linux'
2626

2727
- name: Set up Python
2828
uses: actions/setup-python@v4
2929
with:
30-
python-version: '3.8'
30+
python-version: '3.10'
3131

3232
- name: Install Python packages needed for wheel build and upload
33-
run: |
34-
python -m pip install --upgrade pip setuptools
35-
python -m pip install twine wheel
33+
run: python -m pip install twine
3634

3735
- name: Build wheels
38-
uses: pypa/[email protected]
39-
env:
40-
CIBW_SKIP: 'pp*'
41-
CIBW_ARCHS_LINUX: "auto aarch64"
42-
CIBW_ARCHS_MACOS: "auto universal2"
36+
uses: pypa/[email protected]
4337

4438
- name: Check and upload wheels
4539
env:
46-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
47-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
40+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
41+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
4842
run: |
4943
python -m twine check --strict wheelhouse/*.whl
5044
python -m twine upload wheelhouse/*.whl
@@ -55,26 +49,23 @@ jobs:
5549
steps:
5650

5751
- name: Check out the release commit
58-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
5953

6054
- name: Set up Python
6155
uses: actions/setup-python@v4
6256
with:
63-
python-version: '3.8'
57+
python-version: '3.10'
6458

6559
- name: Install Python packages needed for sdist build and upload
66-
run: |
67-
python -m pip install --upgrade pip setuptools
68-
python -m pip install twine
60+
run: python -m pip install build twine
6961

7062
- name: Build sdist
71-
run: |
72-
python setup.py sdist
63+
run: python -m build --sdist
7364

7465
- name: Publish sdist to PyPI
7566
env:
7667
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
7768
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
7869
run: |
79-
python -m twine check --strict dist/*.tar.gz
80-
python -m twine upload dist/*.tar.gz
70+
python -m twine check --strict dist/*
71+
python -m twine upload dist/*

Diff for: .github/workflows/run-core-traits-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: [ubuntu-latest, windows-latest]
14-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
14+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1515

1616
runs-on: ${{ matrix.os }}
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Set up Python ${{ matrix.python-version }}
2121
uses: actions/setup-python@v4
2222
with:
2323
python-version: ${{ matrix.python-version }}
24+
allow-prereleases: true
2425
- name: Install local package
2526
run: |
26-
python -m pip install --upgrade pip
2727
# Uninstall setuptools so that the tests will catch any accidental
2828
# dependence of the Traits source on setuptools. Note that in future
2929
# setuptools may not exist in a newly-created venv

Diff for: .github/workflows/run-style-checks.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,16 @@ on:
55

66
jobs:
77
style:
8-
strategy:
9-
matrix:
10-
os: [ubuntu-latest]
11-
python-version: ['3.8']
12-
13-
runs-on: ${{ matrix.os }}
8+
runs-on: ubuntu-latest
149

1510
steps:
16-
- uses: actions/checkout@v3
17-
- name: Set up Python ${{ matrix.python-version }}
11+
- uses: actions/checkout@v4
12+
- name: Set up Python 3.10
1813
uses: actions/setup-python@v4
1914
with:
20-
python-version: ${{ matrix.python-version }}
15+
python-version: '3.10'
2116
- name: Install dependencies and local packages
2217
run: |
23-
python -m pip install --upgrade pip
2418
python -m pip install flake8
2519
python -m pip install flake8-ets
2620
- name: Run style checks

Diff for: .github/workflows/run-traits-tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- workflow_dispatch
66

77
env:
8-
# Temporary workaround prior to release of Traits 8.0
8+
# Temporary workaround prior to release of TraitsUI 8.0
99
# xref: enthought/traits#1742
1010
ETS_QT4_IMPORTS: 1
1111

@@ -14,12 +14,12 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, windows-latest, macos-latest]
17-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
17+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1818

1919
runs-on: ${{ matrix.os }}
2020

2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- name: Install Linux packages for Qt support
2424
run: |
2525
sudo apt-get update
@@ -37,9 +37,9 @@ jobs:
3737
uses: actions/setup-python@v4
3838
with:
3939
python-version: ${{ matrix.python-version }}
40+
allow-prereleases: true
4041
- name: Install dependencies and local packages
4142
run: |
42-
python -m pip install --upgrade pip
4343
python -m pip install .[test]
4444
python -m pip install traits-stubs/[test]
4545
- name: Create clean test directory

Diff for: .github/workflows/test-documentation-build.yml

+5-12
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,16 @@ on:
55

66
jobs:
77
docs:
8-
strategy:
9-
matrix:
10-
os: [ubuntu-latest]
11-
python-version: ['3.8']
12-
13-
runs-on: ${{ matrix.os }}
8+
runs-on: ubuntu-latest
149

1510
steps:
16-
- uses: actions/checkout@v3
17-
- name: Set up Python ${{ matrix.python-version }}
11+
- uses: actions/checkout@v4
12+
- name: Set up Python 3.10
1813
uses: actions/setup-python@v4
1914
with:
20-
python-version: ${{ matrix.python-version }}
15+
python-version: '3.10'
2116
- name: Install dependencies and local packages
22-
run: |
23-
python -m pip install --upgrade pip
24-
python -m pip install ".[docs]"
17+
run: python -m pip install .[docs]
2518
- name: Build HTML documentation with Sphinx
2619
run: |
2720
cd docs

Diff for: .github/workflows/test-from-pypi.yml

+21-10
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ on:
66
# Run at 03:27 UTC on the 8th and 22nd of every month
77
- cron: '27 3 8,22 * *'
88

9+
env:
10+
# Temporary workaround prior to release of Traits 8.0
11+
# xref: enthought/traits#1742
12+
ETS_QT4_IMPORTS: 1
13+
914
jobs:
1015
test-pypi-sdist:
1116
strategy:
1217
matrix:
1318
os: [ubuntu-latest, windows-latest, macos-latest]
14-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
19+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
1520
python-architecture: [x86, x64]
1621
exclude:
1722
- os: macos-latest
@@ -40,12 +45,15 @@ jobs:
4045
with:
4146
python-version: ${{ matrix.python-version }}
4247
architecture: ${{ matrix.python-architecture }}
43-
- name: Install prerequisites
48+
allow-prereleases: true
49+
- name: Install test dependencies and Traits from PyPI sdist (no PySide6)
4450
run: |
45-
python -m pip install --upgrade pip setuptools wheel
46-
- name: Install Traits and test dependencies from PyPI sdist
51+
python -m pip install --no-binary traits Cython numpy Sphinx traits traitsui
52+
if: matrix.python-version == '3.12' || matrix.python-architecture == 'x86'
53+
- name: Install test dependencies and Traits from PyPI sdist (PySide6)
4754
run: |
48-
python -m pip install --no-binary traits traits[test]
55+
python -m pip install --no-binary traits Cython numpy PySide6 Sphinx traits traitsui
56+
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
4957
- name: Create clean test directory
5058
run: |
5159
mkdir testdir
@@ -60,7 +68,7 @@ jobs:
6068
strategy:
6169
matrix:
6270
os: [ubuntu-latest, windows-latest, macos-latest]
63-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
71+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
6472
python-architecture: [x86, x64]
6573
exclude:
6674
- os: macos-latest
@@ -89,12 +97,15 @@ jobs:
8997
with:
9098
python-version: ${{ matrix.python-version }}
9199
architecture: ${{ matrix.python-architecture }}
92-
- name: Install prerequisites
100+
allow-prereleases: true
101+
- name: Install test dependencies and Traits from PyPI wheel (no PySide6)
93102
run: |
94-
python -m pip install --upgrade pip setuptools wheel
95-
- name: Install Traits and test dependencies from PyPI wheel
103+
python -m pip install --only-binary traits Cython numpy Sphinx traits traitsui
104+
if: matrix.python-version == '3.12' || matrix.python-architecture == 'x86'
105+
- name: Install test dependencies and Traits from PyPI wheel (PySide6)
96106
run: |
97-
python -m pip install --only-binary traits traits[test]
107+
python -m pip install --only-binary traits Cython numpy PySide6 Sphinx traits traitsui
108+
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
98109
- name: Create clean test directory
99110
run: |
100111
mkdir testdir

Diff for: CHANGES.rst

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Traits CHANGELOG
22
================
33

4+
Release 6.4.3
5+
-------------
6+
7+
Released: 2023-10-09
8+
9+
This is a bugfix release that fixes test failures with Sphinx 7.2 and later,
10+
and adds support for Python 3.12.
11+
12+
Fixes
13+
~~~~~
14+
* Use ``pathlib.Path`` instead of ``sphinx.testing.path.path`` for Sphinx
15+
7.2 and later. (#1755)
16+
* Fix uses of the deprecated ``datetime.utcnow`` method. (#1758)
17+
* Update CI and workflows for Python 3.12 support. (#1757)
18+
19+
420
Release 6.4.2
521
-------------
622

Diff for: pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@ profile = 'black'
1111
line_length = 79
1212
order_by_type = 'False'
1313

14+
[tool.cibuildwheel]
15+
skip = 'pp*'
16+
17+
[tool.cibuildwheel.macos]
18+
archs = ['auto', 'universal2']
19+
20+
[tool.cibuildwheel.linux]
21+
archs = ['auto', 'aarch64']
22+
1423
[tool.pytest.ini_options]
1524
addopts = '--ignore=traits-stubs'

Diff for: setup.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# into the package source.
2121
MAJOR = 6
2222
MINOR = 4
23-
MICRO = 2
23+
MICRO = 3
2424
PRERELEASE = ""
2525
IS_RELEASED = True
2626

@@ -281,6 +281,7 @@ def get_long_description():
281281
Programming Language :: Python :: 3.9
282282
Programming Language :: Python :: 3.10
283283
Programming Language :: Python :: 3.11
284+
Programming Language :: Python :: 3.12
284285
Programming Language :: Python :: Implementation :: CPython
285286
Topic :: Scientific/Engineering
286287
Topic :: Software Development
@@ -313,7 +314,9 @@ def get_long_description():
313314
"flake8",
314315
"flake8-ets",
315316
"mypy",
316-
"numpy",
317+
# NumPy is not yet available for Python 3.12, but that should be
318+
# fixed soon: https://github.com/numpy/numpy/issues/23808
319+
"numpy; python_version < '3.12'",
317320
"pyface",
318321
# Doc builds are hanging with pygments 2.15.0 and 2.15.1.
319322
# Maybe related: https://github.com/pygments/pygments/issues/2427

Diff for: traits/util/event_tracer.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import os
1616
import threading
1717
from contextlib import contextmanager
18-
from datetime import datetime
18+
from datetime import datetime, timezone
1919

2020
from traits import trait_notifiers
2121

@@ -228,7 +228,7 @@ def pre_tracer(self, obj, name, old, new, handler):
228228
229229
"""
230230
indent = self.indent
231-
time = datetime.utcnow().isoformat(" ")
231+
time = datetime.now(timezone.utc).isoformat(" ")
232232
container = self.container
233233
container.record(
234234
ChangeMessageRecord(
@@ -255,7 +255,7 @@ def post_tracer(self, obj, name, old, new, handler, exception=None):
255255
""" Record a string representation of the trait change return
256256
257257
"""
258-
time = datetime.utcnow().isoformat(" ")
258+
time = datetime.now(timezone.utc).isoformat(" ")
259259
self.indent -= 1
260260
indent = self.indent
261261
if exception:

Diff for: traits/util/tests/test_trait_documenter.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
if sphinx is not None:
2828
from sphinx.ext.autodoc import ClassDocumenter, INSTANCEATTR, Options
2929
from sphinx.ext.autodoc.directive import DocumenterBridge
30-
from sphinx.testing.path import path
3130
from sphinx.testing.util import SphinxTestApp
3231
from sphinx.util.docutils import LoggingReporter
3332

@@ -37,6 +36,11 @@
3736
TraitDocumenter,
3837
)
3938

39+
if sphinx.version_info < (7, 2):
40+
from sphinx.testing.path import path as Path
41+
else:
42+
from pathlib import Path
43+
4044

4145
# Configuration file content for testing.
4246
CONF_PY = """\
@@ -223,7 +227,7 @@ def create_directive(self):
223227
with open(conf_file, "w", encoding="utf-8") as f:
224228
f.write(CONF_PY)
225229

226-
app = SphinxTestApp(srcdir=path(tmpdir))
230+
app = SphinxTestApp(srcdir=Path(tmpdir))
227231
app.builder.env.app = app
228232
app.builder.env.temp_data["docname"] = "dummy"
229233

0 commit comments

Comments
 (0)