From 4635b4bdee8264f4be0fa2f2a7d1b1258fef6325 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sun, 4 Feb 2024 13:17:42 -0500 Subject: [PATCH 1/5] Promote arm64 macOS to tier 1 Github recently added a new macOS runner that is using the m1 CPU that is usable for open source projects. [1] Previously rustworkx had support for arm64 macOS at tier 4 because we were only able to cross compile for the platform and not test the binaries. Now that we can run CI jobs on the platform we're able to run both unit tests and test our binaries on release. This commit adds a new set of test jobs and wheel builds that use the macos-14 runner that mirrors the existing x86_64 macOS jobs we have. This brings arm64 macOS to the same support level as arm64. [1] https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ --- .github/workflows/main.yml | 1 + .github/workflows/wheels.yml | 41 ++++++------------- docs/source/install.rst | 2 +- .../arm64-macos-tier-1-6be760ee2ac3975d.yaml | 12 ++++++ 4 files changed, 26 insertions(+), 30 deletions(-) create mode 100644 releasenotes/notes/arm64-macos-tier-1-6be760ee2ac3975d.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f077e692..3ab94c771 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,6 +60,7 @@ jobs: python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] platform: [ { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, + { os: "macOS-14", python-architecture: "aarch64", rust-target: "aarch64-apple-darwin" }, { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }, { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" }, ] diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0c805dc9b..da5afe7b8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -46,7 +46,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest, macos-14] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -56,7 +56,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -70,7 +70,7 @@ jobs: environment: release permissions: id-token: write - needs: ["build_wheels", "build-mac-arm-wheels", "build-win32-wheels"] + needs: ["build_wheels", "build-win32-wheels"] steps: - uses: actions/download-artifact@v3 with: @@ -103,7 +103,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -140,7 +140,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -177,7 +177,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -215,7 +215,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -253,7 +253,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -290,7 +290,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -327,7 +327,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -364,7 +364,7 @@ jobs: platforms: all - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -378,23 +378,6 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: wheelhouse/ - build-mac-arm-wheels: - name: Build wheels on macos for arm and universal2 - runs-on: macos-latest - environment: release - steps: - - uses: actions/checkout@v4 - - name: Build wheels - uses: joerick/cibuildwheel@v2.16.2 - env: - CIBW_BEFORE_ALL: rustup target add aarch64-apple-darwin - CIBW_ARCHS_MACOS: arm64 universal2 - CIBW_BEFORE_BUILD: pip install -U setuptools-rust - CIBW_ENVIRONMENT: CARGO_BUILD_TARGET="aarch64-apple-darwin" PYO3_CROSS_LIB_DIR="/Library/Frameworks/Python.framework/Versions/$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')/lib/python$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')" - - uses: actions/upload-artifact@v4 - with: - path: ./wheelhouse/*.whl - name: shared-wheel-builds build-win32-wheels: name: Build wheels on win32 runs-on: windows-latest @@ -413,7 +396,7 @@ jobs: run: rustup default stable-i686-pc-windows-msvc - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.16.5 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse diff --git a/docs/source/install.rst b/docs/source/install.rst index b2f961ec2..88d83f49e 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -103,7 +103,7 @@ source. - * - macOS (11 or newer) - arm64 - - :ref:`tier-4` + - :ref:`tier-1` - * - Windows 64bit - x86_64 diff --git a/releasenotes/notes/arm64-macos-tier-1-6be760ee2ac3975d.yaml b/releasenotes/notes/arm64-macos-tier-1-6be760ee2ac3975d.yaml new file mode 100644 index 000000000..e3c5c642a --- /dev/null +++ b/releasenotes/notes/arm64-macos-tier-1-6be760ee2ac3975d.yaml @@ -0,0 +1,12 @@ +--- +other: + - | + Support for the arm64 macOS platform has been promoted from :ref:`tier-4` + to :ref:`tier-1`. Previously the platform was at :ref:`tier-4` because + there was no available CI environment for testing rustworkx on the platform. + Now that Github has made an arm64 macOS environment available to open source + projects [#]_ we're testing the platform along with the other :ref:`tier-1` + supported platforms. + + .. [#] https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ + From d5a2a61afab2214e878fd059d5f68798bdac8bfb Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sun, 4 Feb 2024 13:38:18 -0500 Subject: [PATCH 2/5] Specify patch version for main test ci job The setup-python action on macos-14 only has python 3.12 installers for specific patch versions. This commit specifies that we use 3.12.0 as this lets us start using stestr again to improve test throughput. Using 3.12.1 is blocked as there was a breaking api change made to unittest in that Python release which is causing skip tests to be reported as errors. --- .github/workflows/main.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ab94c771..f48dd9587 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: strategy: matrix: rust: [stable] - python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"] platform: [ { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, { os: "macOS-14", python-architecture: "aarch64", rust-target: "aarch64-apple-darwin" }, diff --git a/tox.ini b/tox.ini index 0258a17c5..e2c1e2ad7 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ passenv = RUSTWORKX_DEBUG changedir = {toxinidir}/tests commands = - python -m unittest discover {posargs} + stestr run {posargs} [testenv:lint] basepython = python3 From d9fe8fdbde3b2ef80030cb27f2a7ea3e259689de Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sun, 4 Feb 2024 13:43:07 -0500 Subject: [PATCH 3/5] Use correct architecture string for Python --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f48dd9587..a5540d23e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,7 +60,7 @@ jobs: python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"] platform: [ { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, - { os: "macOS-14", python-architecture: "aarch64", rust-target: "aarch64-apple-darwin" }, + { os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }, { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }, { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" }, ] From 2852a905369090100810e64f1982dc31bb49325a Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 5 Feb 2024 11:53:56 -0500 Subject: [PATCH 4/5] Skip py3.8 and 3.9 until the setup-python action is updated --- .github/workflows/main.yml | 6 ++++++ docs/source/install.rst | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5540d23e..d0fdd1322 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,6 +70,12 @@ jobs: python-version: 3.8 platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" } msrv: "MSRV" + # Exclude python 3.8 and 3.9 on arm64 until actions/setup-python#808 is resolved + exclude: + - platform: {os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" } + python-version: 3.8 + - platform: {os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" } + python-version: 3.9 steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/docs/source/install.rst b/docs/source/install.rst index 88d83f49e..942614b2c 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -103,7 +103,7 @@ source. - * - macOS (11 or newer) - arm64 - - :ref:`tier-1` + - :ref:`tier-1` [#f1]_ - * - Windows 64bit - x86_64 @@ -117,6 +117,11 @@ source. .. _manylinux 2014: https://peps.python.org/pep-0599/> +.. [#f1] Due to CI environment limitations tests for macOS arm64 are only run with + Python >= 3.10. The published binaries are still built and tested for all supported + Python versions, but the tests run on proposed changes are only run with Python >=3.10 + + .. _tier-1: Tier 1 From ecf713b2246fb0d8fa0415fe6e0594cd1619a6ac Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 22 Feb 2024 06:33:08 -0500 Subject: [PATCH 5/5] Revert Python 3.12 job constraint and stestr usage --- .github/workflows/main.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0fdd1322..27022f5a0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: strategy: matrix: rust: [stable] - python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] platform: [ { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, { os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }, diff --git a/tox.ini b/tox.ini index e2c1e2ad7..0258a17c5 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ passenv = RUSTWORKX_DEBUG changedir = {toxinidir}/tests commands = - stestr run {posargs} + python -m unittest discover {posargs} [testenv:lint] basepython = python3