Files
CoolProp/.github/workflows/python_buildwheels.yml
Niels Holswilder fbb2d587bd Python 3.13 and replace distutils with setuptools PEP 632 – Deprecate distutils (#2436)
* Update setup.py replace distutils with setuptools

PEP 632 – Deprecate distutils module.

Edit line 4-6:
from distutils.version import LooseVersion
from distutils.sysconfig import get_config_var
from setuptools.command.build_ext import build_ext
To
from packaging.version import Version
from sysconfig import get_config_var
from setuptools.command.build_ext import build_ext

Edit line 291:
cython_version = Version (Cython.__version__)
To
cython_version = str(Version (Cython.__version__))

Edit line 353:
from distutils.errors import CompileError
To
from setuptools import CompileError

Edit line 394:
from Cython.Distutils.extension import Extension
To
from setuptools.extension import Extension

Delete line 396:
from Cython.Distutils import build_ext
This is now handled with line 6 and thus redundant
from setuptools.command.build_ext import build_ext

Edit line 3, 60, 61 62, 66, 77, 229, and 291
Replace all instances of LooseVersion with Version

* Update python_buildwheels.yml

* Update python_cibuildwheel.yml

* Update setup.py

* Update setup.py

* Update setup.py

* Update python_buildwheels.yml

Added module packaging to the list of dependencies.

* Update python_cibuildwheel.yml

Updated cibuildwheel version form 2.17.0 to latest edition 2.21.3 for python 3.13 support.

* Update python_buildwheels.yml

Deleted lines with python specific exclusions for Windows ARM64 as it already excluded generically.

* Update python_buildwheels.yml

Deleted lines with python specific exclusions for MacOS as these are no longer supported.
2024-11-07 20:45:25 -05:00

148 lines
4.1 KiB
YAML

name: Python cibuildwheel
on:
push:
branches: [ 'master', 'main', 'develop', 'actions_pypi' ]
tags: [ 'v*' ]
pull_request:
branches: [ 'master', 'main', 'develop' ]
jobs:
python_source:
name: Build source package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13.x
- name: Install dependencies
run: pip install setuptools wheel Cython requests jinja2 pyyaml packaging
- name: Build package, sdist
working-directory: ./wrappers/Python/pypi
run: python prepare_pypi.py --dist-dir=${GITHUB_WORKSPACE}/Python
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: Python-sdist
path: |
./Python/*.tar.gz
python_ubuntu:
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [ubuntu]
python-version: [38, 39, 310, 311, 312, 313]
arch: [i686, x86_64, aarch64, ppc64le, s390x]
exclude:
- os: ubuntu
arch: i686 # reduce the build time until people ask for the binaries
- os: ubuntu
arch: ppc64le # reduce the build time until people ask for the binaries
- os: ubuntu
arch: s390x # reduce the build time until people ask for the binaries
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
python_windows:
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [windows]
python-version: [38, 39, 310, 311, 312, 313]
arch: [AMD64, x86, ARM64]
exclude:
- os: windows
arch: ARM64 # creates problems with msgpack-c
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
python_macos:
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
os: [macos]
python-version: [38, 39, 310, 311, 312, 313]
arch: [x86_64, arm64, universal2]
exclude:
- os: macos
arch: universal2 # is redundant
uses: ./.github/workflows/python_cibuildwheel.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
arch: ${{ matrix.arch }}
merge_wheels:
runs-on: ubuntu-latest
needs: [python_source, python_ubuntu, python_windows, python_macos]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: Python
pattern: Python-*
upload_python_bindings_to_pypi:
needs: merge_wheels
name: Upload to PyPi
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13.x
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine requests packaging
if [[ "$GITHUB_REF" == *"refs/tags"* ]]; then
TWINE_REPOSITORY=pypi
TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
else
TWINE_REPOSITORY=testpypi
TWINE_PASSWORD=${{ secrets.TESTPYPI_TOKEN }}
fi;
echo "Using TWINE_REPOSITORY=$TWINE_REPOSITORY"
echo "TWINE_REPOSITORY=$TWINE_REPOSITORY" >> $GITHUB_ENV
echo "TWINE_PASSWORD=$TWINE_PASSWORD" >> $GITHUB_ENV
- name: Download ALL wheels
uses: actions/download-artifact@v4.1.7
with:
name: Python
path: Python
- name: Display structure of downloaded files
run: |
set -x
ls -R
du -sh
- name: Publish wheels to (Test)PyPI
if: ${{ github.event_name != 'pull_request' }}
env:
TWINE_USERNAME: __token__
run: python -m twine upload --skip-existing Python/*.whl Python/*.tar.gz