Skip to content

Commit

Permalink
Backport #1757 to the release branch and bring CI workflows in line w…
Browse files Browse the repository at this point in the history
…ith main
  • Loading branch information
mdickinson committed Sep 11, 2023
1 parent 20f6a3f commit b49bf72
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 61 deletions.
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
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'
15 changes: 6 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
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 All @@ -302,25 +303,21 @@ def get_long_description():
extras_require={
"docs": [
"enthought-sphinx-theme",
# Doc builds are hanging with pygments 2.15.0 and 2.15.1.
# Maybe related: https://github.com/pygments/pygments/issues/2427
"pygments<2.15",
"Sphinx",
"Sphinx>=2.1.0",
"sphinx-copybutton",
],
"test": [
"Cython",
"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
"pygments<2.15",
"PySide6; python_version >= '3.7' and python_version < '3.12'",
"setuptools",
"Sphinx",
"Sphinx>=2.1.0",
"traitsui",
],
"examples": [
Expand Down

0 comments on commit b49bf72

Please sign in to comment.