-
-
Notifications
You must be signed in to change notification settings - Fork 24
Add support for Python 3.15 #1471
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
base: main
Are you sure you want to change the base?
Changes from all commits
4036dac
2b23733
3d9bab4
fcd6abc
0557a2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -275,29 +275,28 @@ jobs: | |
| wheels: | ||
| needs: setup-jobs | ||
| if: needs.setup-jobs.outputs.allowed-jobs == 'Wheels' || needs.setup-jobs.outputs.allowed-jobs == 'All' | ||
| name: ${{ matrix.name }} ${{ matrix.py }} wheel | ||
| name: ${{ matrix.name }} Stable ABI wheel | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-15, ubuntu-24.04, ubuntu-24.04-arm, windows-2025-vs2026, windows-11-arm] | ||
| py: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | ||
| os: [macos-15, macos-15-intel, ubuntu-24.04, ubuntu-24.04-arm, windows-2025-vs2026, windows-11-arm] | ||
| py: ['3.14'] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only Python 3.14? What about Python 3.15 and probably even Python 3.13 (at least)?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only one needed now becuase we build with Python 3.14 but it will fit all Python versions from 3.10 upwards. |
||
| include: | ||
| - name: 'Windows' | ||
| os: windows-2025-vs2026 | ||
| - name: 'Windows ARM' | ||
| os: windows-11-arm | ||
| - name: 'Linux' | ||
| - name: 'LinuxARM' | ||
| os: ubuntu-24.04-arm | ||
| - name: 'Linux ARM' | ||
| - name: 'LinuxIntel' | ||
| os: ubuntu-24.04 | ||
| - name: 'macOS' | ||
| - name: 'macOSARM' | ||
| os: macos-15 | ||
| exclude: | ||
| - os: ubuntu-24.04 | ||
| py: '3.9' | ||
| - os: ubuntu-24.04-arm | ||
| py: '3.9' | ||
| - name: 'macOSIntel' | ||
| os: macos-15-intel | ||
| - name: 'WindowsARM' | ||
| os: windows-11-arm | ||
| arch: arm64 | ||
| - name: 'WindowsIntel' | ||
| os: windows-2025-vs2026 | ||
| arch: amd64 | ||
|
|
||
| steps: | ||
| - name: Check out libCellML | ||
|
|
@@ -309,57 +308,44 @@ jobs: | |
| id: setup | ||
| shell: bash | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME_TMP#refs/tags/v}" | ||
| if [[ "$OSTYPE" == "darwin*" ]]; then | ||
| VERSION="${GITHUB_REF#refs/tags/v}" | ||
| echo "Setting version as: VERSION=${VERSION}" | ||
| if [[ "$OSTYPE" == darwin* ]]; then | ||
| sed -i '' "s/__VERSION__/${VERSION}/" src/bindings/python/pyproject.toml | ||
| else | ||
| sed -i "s/__VERSION__/${VERSION}/" src/bindings/python/pyproject.toml | ||
| fi | ||
| grep '^version' src/bindings/python/pyproject.toml | ||
|
|
||
| v=${{ matrix.py }} | ||
| echo "Setting tag as: tag=${GITHUB_REF#refs/tags/}" | ||
| echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
| echo "Setting build as: build=cp${v/./}-*" | ||
| echo "build=cp${v/./}-*" >> $GITHUB_OUTPUT | ||
| if [[ "macOS" == "${{ matrix.name }}" ]]; then | ||
| echo "Setting macos_archs as: macos_archs='x86_64 arm64'" | ||
| echo "macos_archs=x86_64 arm64" >> $GITHUB_OUTPUT | ||
| echo "macos_deployment_target=14.0" >> $GITHUB_OUTPUT | ||
| elif [[ "Windows" == "${{ matrix.name }}" ]]; then | ||
| echo "Setting win_arch as: win_arch=amd64" | ||
| echo "win_arch=amd64" >> $GITHUB_OUTPUT | ||
| elif [[ "Windows ARM" == "${{ matrix.name }}" ]]; then | ||
| echo "Setting win_arch as: win_arch=arm64" | ||
| echo "win_arch=arm64" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Configure MSVC (Windows) | ||
| if: runner.os == 'Windows' | ||
| uses: TheMrMilchmann/setup-msvc-dev@v4 | ||
| with: | ||
| arch: ${{ steps.setup.outputs.win_arch }} | ||
| arch: ${{ matrix.arch }} | ||
|
|
||
| - name: Install SWIG (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: brew install swig | ||
|
|
||
| - name: Build wheels | ||
| uses: pypa/cibuildwheel@v3.4 | ||
| uses: pypa/cibuildwheel@v4.2 | ||
| env: | ||
| #CIBW_BUILD_VERBOSITY: 1 | ||
| CIBW_ARCHS: auto64 | ||
| CIBW_ARCHS_MACOS: ${{ steps.setup.outputs.macos_archs }} | ||
| CIBW_BUILD: ${{ steps.setup.outputs.build }} | ||
| CIBW_TEST_SKIP: "*_arm64" | ||
| CIBW_BEFORE_ALL_LINUX: yum install -y libxml2-devel || (apk add libxml2-dev && rm /usr/lib/cmake/libxml2/libxml2-config.cmake) | ||
| CIBW_ENVIRONMENT: > | ||
| LIBCELLML_VERSION_TAG=${{ steps.setup.outputs.tag }} | ||
| MACOSX_DEPLOYMENT_TARGET=${{ steps.setup.outputs.macos_deployment_target }} | ||
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" | ||
| LIBCELLML_VERSION_TAG=${{ github.event.release.tag_name }} | ||
| MACOSX_DEPLOYMENT_TARGET=14.0 | ||
| CIBW_BEFORE_BUILD_LINUX: pip install renamewheel | ||
| CIBW_BEFORE_BUILD_WINDOWS: cd src/bindings/python && cmake -S wheel_dependencies -B build-wheel_dependencies -G Ninja && cd build-wheel_dependencies && ninja | ||
| CIBW_REPAIR_WHEEL_COMMAND_LINUX: renamewheel -w {dest_dir} {wheel} | ||
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" | ||
| CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "" | ||
| with: | ||
| output-dir: wheelhouse | ||
| package-dir: src/bindings/python/ | ||
|
|
@@ -368,13 +354,13 @@ jobs: | |
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| path: ./wheelhouse/*.whl | ||
| name: ${{ matrix.name }}-${{ matrix.py }}-wheel | ||
| name: ${{ matrix.name }}-wheel | ||
| retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | ||
|
|
||
| publish-wheels: | ||
| if: needs.setup-jobs.outputs.binaries-destination == 'Publish' | ||
| needs: wheels | ||
| runs-on: ubuntu-22.04 | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 5 # Docker+network are slow sometimes. | ||
| permissions: | ||
| id-token: write | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| """ libCellML Library: A library for the parsing, printing, and manipulation | ||
| of CellML 2.0 compliant models. | ||
|
|
||
| """ | ||
|
|
||
| classifiers = """\ | ||
| Development Status :: 5 - Production/Stable | ||
| Intended Audience :: Developers | ||
| Intended Audience :: Education | ||
| Intended Audience :: Science/Research | ||
| Programming Language :: Python | ||
| Operating System :: Microsoft :: Windows | ||
| Operating System :: Unix | ||
| Operating System :: MacOS :: MacOS X | ||
| Topic :: Software Development :: Libraries :: Python Modules | ||
| """ | ||
|
|
||
| import os | ||
| import platform | ||
|
|
||
| from skbuild import setup | ||
|
|
||
| cmake_args = ["-DUNIT_TESTS=OFF", "-DCOVERAGE=OFF", "-DMEMCHECK=OFF", "-DLLVM_COVERAGE=OFF", "-DCLANG_TIDY=OFF"] | ||
|
|
||
| if platform.system() == "Windows": | ||
| cmake_args.append("-DLibXml2_DIR=C:/Program Files (x86)/libxml2/libxml2-2.9.10/CMake/") | ||
|
|
||
| doclines = __doc__.split("\n") | ||
|
|
||
| tag = os.environ.get("LIBCELLML_VERSION_TAG", "v0.0.0") | ||
|
|
||
| setup( | ||
| name="libcellml", | ||
| version=tag[1:], | ||
| description=doclines[0], | ||
| author="libCellML contributors", | ||
| url="https://libcellml.org", | ||
| license="Apache 2.0", | ||
| packages=["libcellml"], | ||
| classifiers=[cl for cl in classifiers.split("\n") if cl], | ||
| long_description=open('README.rst').read(), | ||
| long_description_content_type='text/x-rst', | ||
| include_package_data=True, | ||
| cmake_source_dir="../../../", | ||
| cmake_install_target="install-wheel", | ||
| cmake_args=cmake_args, | ||
| exclude_package_data={"": ["bin/*", "cmake/*", "include/*", "lib/*"]}, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not include the Python version anymore?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is becuase with the stable ABI we don’t need individual Python versions, we build against the stable ABI and it will work for all versions that don’t break our baseline stable ABI we use, which is Python 3.10.