Skip to content

Commit e92410d

Browse files
committed
ci: build and test rez with and without mypyc
Add a 'mypyc' axis to the installation and tests workflows so CI exercises both the pure-python build (REZ_MYPYC=0) and the mypyc-compiled build (REZ_MYPYC=1) across the full OS x Python matrix. fail-fast is off, so each configuration reports independently and we can see exactly which ones the compiled build supports. Point the pyproject build requirement at our mypy fork (github.com/chadrik/mypy@rez-mypyc-fixes), which carries the fixes needed to compile rez. This makes an isolated build (pip install ., install.py, ...) automatically pick up the right mypy when building with mypyc, with no extra CI steps. Verified end to end: an isolated REZ_MYPYC=1 build pulls the fork and produces the compiled extensions.
1 parent 824b91a commit e92410d

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/installation.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ permissions:
2727

2828
jobs:
2929
main:
30-
name: ${{ matrix.os }} - ${{ matrix.python-version }} - ${{ matrix.method }}
30+
name: ${{ matrix.os }} - ${{ matrix.python-version }} - ${{ matrix.method }} - mypyc=${{ matrix.mypyc }}
3131
runs-on: ${{ matrix.os }}
3232
strategy:
3333
fail-fast: false
3434
matrix:
3535
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
3636
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
3737
method: ['install' ,'pip']
38+
mypyc: [false, true]
3839

3940
include:
4041
# ubuntu
@@ -76,6 +77,7 @@ jobs:
7677
- name: Install
7778
env:
7879
MATRIX_PYTHON_VERSION: ${{ matrix.python-version }}
80+
REZ_MYPYC: ${{ matrix.mypyc && '1' || '0' }}
7981
run: |
8082
${{ matrix.REZ_INSTALL_COMMAND }}
8183

.github/workflows/tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
matrix:
4040
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
4141
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
42+
mypyc: [false, true]
43+
4244
include:
4345
- os: macos-latest
4446
shells: 'sh,csh,bash,tcsh,zsh,pwsh'
@@ -73,6 +75,8 @@ jobs:
7375
sudo apt-get install -y csh tcsh zsh
7476
7577
- name: Install rez
78+
env:
79+
REZ_MYPYC: ${{ matrix.mypyc && '1' || '0' }}
7680
run: python ./install.py ./installdir
7781

7882
- name: Install test system dependencies (macOS)

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[build-system]
2-
requires = ["setuptools", "mypy[mypyc]"]
2+
# Building rez with mypyc (the default; set REZ_MYPYC=0 to build pure-python)
3+
# requires our fork of mypy, which carries fixes needed to compile rez. Those
4+
# fixes are pending upstreaming; until they land, pin the fork so that an
5+
# isolated build (pip install ., install.py, etc.) picks up the right mypy.
6+
requires = ["setuptools", "mypy[mypyc] @ git+https://github.com/chadrik/mypy@rez-mypyc-fixes"]
37
build-backend = "setuptools.build_meta"
48

59
[tool.mypy]

0 commit comments

Comments
 (0)