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

Release Traits 6.4.3 #1756

Merged
merged 11 commits into from
Oct 9, 2023
25 changes: 8 additions & 17 deletions .github/workflows/release-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Install Python packages needed for wheel build and upload
run: |
python -m pip install --upgrade pip setuptools
python -m pip install twine wheel
run: python -m pip install twine

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: 'pp*'
CIBW_ARCHS_LINUX: "auto aarch64"
CIBW_ARCHS_MACOS: "auto universal2"
uses: pypa/[email protected]

- name: Check and upload wheels
env:
Expand All @@ -60,21 +54,18 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Install Python packages needed for sdist build and upload
run: |
python -m pip install --upgrade pip setuptools
python -m pip install twine
run: python -m pip install build twine

- name: Build sdist
run: |
python setup.py sdist
run: python -m build --sdist

- name: Publish sdist to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine check --strict dist/*.tar.gz
python -m twine upload dist/*.tar.gz
python -m twine check --strict dist/*
python -m twine upload dist/*
4 changes: 2 additions & 2 deletions .github/workflows/run-core-traits-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

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

Expand All @@ -21,9 +21,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install local package
run: |
python -m pip install --upgrade pip
# Uninstall setuptools so that the tests will catch any accidental
# dependence of the Traits source on setuptools. Note that in future
# setuptools may not exist in a newly-created venv
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/run-style-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@ on:

jobs:
style:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8']

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10'
- name: Install dependencies and local packages
run: |
python -m pip install --upgrade pip
python -m pip install flake8
python -m pip install flake8-ets
- name: Run style checks
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-traits-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- workflow_dispatch

env:
# Temporary workaround prior to release of Traits 8.0
# Temporary workaround prior to release of TraitsUI 8.0
# xref: enthought/traits#1742
ETS_QT4_IMPORTS: 1

Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

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

Expand All @@ -37,9 +37,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies and local packages
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
python -m pip install traits-stubs/[test]
- name: Create clean test directory
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/test-documentation-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@ on:

jobs:
docs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8']

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10'
- name: Install dependencies and local packages
run: |
python -m pip install --upgrade pip
python -m pip install ".[docs]"
run: python -m pip install .[docs]
- name: Build HTML documentation with Sphinx
run: |
cd docs
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/test-from-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ on:
# Run at 03:27 UTC on the 8th and 22nd of every month
- cron: '27 3 8,22 * *'

env:
# Temporary workaround prior to release of Traits 8.0
# xref: enthought/traits#1742
ETS_QT4_IMPORTS: 1

jobs:
test-pypi-sdist:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
Expand Down Expand Up @@ -40,12 +45,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install prerequisites
allow-prereleases: true
- name: Install test dependencies and Traits from PyPI sdist (no PySide6)
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install Traits and test dependencies from PyPI sdist
python -m pip install --no-binary traits Cython numpy Sphinx traits traitsui
if: matrix.python-version == '3.12' || matrix.python-architecture == 'x86'
- name: Install test dependencies and Traits from PyPI sdist (PySide6)
run: |
python -m pip install --no-binary traits traits[test]
python -m pip install --no-binary traits Cython numpy PySide6 Sphinx traits traitsui
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
mkdir testdir
Expand All @@ -60,7 +68,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
Expand Down Expand Up @@ -89,12 +97,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install prerequisites
allow-prereleases: true
- name: Install test dependencies and Traits from PyPI wheel (no PySide6)
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install Traits and test dependencies from PyPI wheel
python -m pip install --only-binary traits Cython numpy Sphinx traits traitsui
if: matrix.python-version == '3.12' || matrix.python-architecture == 'x86'
- name: Install test dependencies and Traits from PyPI wheel (PySide6)
run: |
python -m pip install --only-binary traits traits[test]
python -m pip install --only-binary traits Cython numpy PySide6 Sphinx traits traitsui
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
mkdir testdir
Expand Down
16 changes: 16 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Traits CHANGELOG
================

Release 6.4.3
-------------

Released: 2023-09-12

This is a bugfix release that fixes test failures with Sphinx 7.2 and later,
and adds support for Python 3.12.

Fixes
~~~~~
* Use ``pathlib.Path`` instead of ``sphinx.testing.path.path`` for Sphinx
7.2 and later. (#1755)
* Fix uses of the deprecated ``datetime.utcnow`` method. (#1758)
* Update CI and workflows for Python 3.12 support. (#1757)


Release 6.4.2
-------------

Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ profile = 'black'
line_length = 79
order_by_type = 'False'

[tool.cibuildwheel]
skip = 'pp*'

[tool.cibuildwheel.macos]
archs = ['auto', 'universal2']

[tool.cibuildwheel.linux]
archs = ['auto', 'aarch64']

[tool.pytest.ini_options]
addopts = '--ignore=traits-stubs'
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# into the package source.
MAJOR = 6
MINOR = 4
MICRO = 2
MICRO = 3
PRERELEASE = ""
IS_RELEASED = True

Expand Down Expand Up @@ -281,6 +281,7 @@ def get_long_description():
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering
Topic :: Software Development
Expand Down Expand Up @@ -313,7 +314,9 @@ def get_long_description():
"flake8",
"flake8-ets",
"mypy",
"numpy",
# NumPy is not yet available for Python 3.12, but that should be
# fixed soon: https://github.com/numpy/numpy/issues/23808
"numpy; python_version < '3.12'",
"pyface",
# Doc builds are hanging with pygments 2.15.0 and 2.15.1.
# Maybe related: https://github.com/pygments/pygments/issues/2427
Expand Down
6 changes: 3 additions & 3 deletions traits/util/event_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import os
import threading
from contextlib import contextmanager
from datetime import datetime
from datetime import datetime, timezone

from traits import trait_notifiers

Expand Down Expand Up @@ -228,7 +228,7 @@ def pre_tracer(self, obj, name, old, new, handler):

"""
indent = self.indent
time = datetime.utcnow().isoformat(" ")
time = datetime.now(timezone.utc).isoformat(" ")
container = self.container
container.record(
ChangeMessageRecord(
Expand All @@ -255,7 +255,7 @@ def post_tracer(self, obj, name, old, new, handler, exception=None):
""" Record a string representation of the trait change return

"""
time = datetime.utcnow().isoformat(" ")
time = datetime.now(timezone.utc).isoformat(" ")
self.indent -= 1
indent = self.indent
if exception:
Expand Down
8 changes: 6 additions & 2 deletions traits/util/tests/test_trait_documenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
if sphinx is not None:
from sphinx.ext.autodoc import ClassDocumenter, INSTANCEATTR, Options
from sphinx.ext.autodoc.directive import DocumenterBridge
from sphinx.testing.path import path
from sphinx.testing.util import SphinxTestApp
from sphinx.util.docutils import LoggingReporter

Expand All @@ -37,6 +36,11 @@
TraitDocumenter,
)

if sphinx.version_info < (7, 2):
from sphinx.testing.path import path as Path
else:
from pathlib import Path


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

app = SphinxTestApp(srcdir=path(tmpdir))
app = SphinxTestApp(srcdir=Path(tmpdir))
app.builder.env.app = app
app.builder.env.temp_data["docname"] = "dummy"

Expand Down