Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update CI to newest actions and Python 3.13 #285

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

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 42 additions & 28 deletions .github/workflows/build_dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,78 @@ on:
types: [created]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work
- name: Install Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install setuptools
run: pip install setuptools
- name: Build sdist
run: python setup.py sdist
- name: Save sdist
uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work
- name: Install Python 3.x
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install setuptools
run: pip install setuptools
- name: Build sdist
run: python setup.py sdist
- name: Save sdist
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

wheels:
name: Build wheels on ${{ matrix.os }} CIBW_BUILD=${{ matrix.cibw_build }}
runs-on: ${{ matrix.os }}
strategy:
# since multiple builds run at the same time, cancelling them all when one
# fails is wasteful and forces handling build problems one by one instead
# of showing a "full picture"
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cibw_build: [cp38-*, cp39-*, cp310-*, cp311-*, cp312-*]
os:
- ubuntu-latest
- macos-13 # x86
- macos-latest # arm
- windows-latest
cibw_build: [cp39-*, cp310-*, cp311-*, cp312-*, cp313-*]
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work
fetch-depth: 0 # To ensure tags are retrieved to enabe setuptools_scm to work
- name: Install Python 3.x
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Set up QEMU # Needed to build aarch64 wheels
- name: Set up QEMU # Needed to build aarch64 wheels
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.21
env:
CIBW_ENVIRONMENT: PYLZ4_USE_SYSTEM_LZ4="False"
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64"
CIBW_ARCHS_MACOS: "x86_64 arm64" # universal2"
CIBW_ARCHS_MACOS: "auto64" # since we have both runner arches
CIBW_ARCHS_WINDOWS: "AMD64 x86"
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_SKIP: "cp*-musllinux*"
CIBW_TEST_COMMAND: "tox -c {project}"
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64 *-*linux_{aarch64,ppc64le,s390x}"
CIBW_BEFORE_BUILD: "python -m pip install -U pip && python -m pip install tox"
- name: Save wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ strategy.job-index }}
path: wheelhouse/*.whl

upload_pypi:
Expand All @@ -75,9 +89,9 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: cibw-*
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def pkgconfig_installed_check(lib, required_version, default):
use_scm_version={
'write_to': "lz4/version.py",
},
python_requires=">=3.8",
python_requires=">=3.9",
setup_requires=[
'setuptools_scm',
'pkgconfig',
Expand Down Expand Up @@ -200,10 +200,10 @@ def pkgconfig_installed_check(lib, required_version, default):
'Intended Audience :: Developers',
'Programming Language :: C',
'Programming Language :: Python',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
)