Skip to content

Commit

Permalink
Add Python 3.11 to the wheel matrix, remove 2.7 and 3.6
Browse files Browse the repository at this point in the history
- tests are still done on 2.7 and 3.6
- update `actions/checkout` and `actions/setup-python`
- use  `pypa/cibuildwheel` for publishing
  • Loading branch information
naufraghi committed Nov 3, 2022
1 parent a8eb6eb commit 483322b
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 97 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on: [push]

jobs:
build-linux:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -24,14 +24,14 @@ jobs:
just script/unix/ci-test
build-macos:
runs-on: macos-10.15
runs-on: macos-11
strategy:
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -47,11 +47,11 @@ jobs:
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
136 changes: 55 additions & 81 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,66 @@
name: Upload Python Package
name: Build and upload to PyPI

on:
push:
release:
types: [created]
types: [published]

jobs:
deploy-linux:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Update submodules
run: |
git submodule update --init
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2010_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
build-requirements: 'cython'
system-packages: 'patchelf'
- name: Publish wheels to PyPI
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine
twine upload --skip-existing dist/*-manylinux*.whl
deploy-macos:
runs-on: macos-10.15
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-20.04, windows-2019, macos-11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
curl -L https://github.com/casey/just/releases/download/v0.5.8/just-v0.5.8-x86_64-apple-darwin.tar.gz | tar -vzx just
sudo mv just /usr/local/bin
just script/unix/ci-bootstrap
- name: Build wheels
run: |
just script/unix/ci-dist
- name: Publish wheels to PyPI
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine
twine upload --skip-existing dist/*.whl dist/*.tar.gz
- uses: actions/checkout@v3
with:
submodules: true

deploy-windows:
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-*"
CIBW_SKIP: "pp* *-musllinux* *_aarch64 *_ppc64le *_s390x *_i686 *_universal2"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
$JustVersion = "v0.5.8"
Invoke-WebRequest -Uri https://github.com/casey/just/releases/download/$JustVersion/just-$JustVersion-x86_64-pc-windows-msvc.zip -OutFile just-$JustVersion-x86_64-pc-windows-msvc.zip
Expand-Archive .\just-$JustVersion-x86_64-pc-windows-msvc.zip unzipped
$Env:Path = (Join-Path (Get-Location) "unzipped") + ";" + $Env:Path
just script/windows/ci-bootstrap
- name: Build wheels
run: |
$Env:Path = (Join-Path (Get-Location) "unzipped") + ";" + $Env:Path
just script/windows/ci-dist
- name: Publish wheels to PyPI
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine
twine upload --skip-existing dist/*.whl
- uses: actions/checkout@v3
with:
submodules: true

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
skip_existing: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
# To test: repository_url: https://test.pypi.org/legacy/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Given the C API works modifying a buffer in-place, the wrapper offers:
the buffer in-place.

## Release notes

- 1.0.4rc1 (Oct 24, 2022)
- add Python 3.11 to the matrix, remove Python 2.7 and 3.6
- **1.0.3** (Feb 22, 2022)
- Final release with Python 3.10
- 1.0.3rc1 (Nov 4, 2021):
- add Python 3.10 to the matrix
- **1.0.2** (Nov 4, 2021):
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
description="tiny-AES-c wrapper in Cython",
long_description=long_description,
long_description_content_type="text/markdown",
version="1.0.3",
version="1.0.4rc1",
author="Matteo Bertini",
author_email="naufraghi@develer.com",
url="https://github.com/naufraghi/tinyaes-py",
Expand Down Expand Up @@ -60,10 +60,6 @@
# that you indicate whether you support Python 2, Python 3 or both.
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
# Source language
"Programming Language :: Cython",
],
Expand Down

0 comments on commit 483322b

Please sign in to comment.