From 483322bdd208be0a17cd24daf1db6027aff1763f Mon Sep 17 00:00:00 2001 From: Matteo Bertini Date: Thu, 3 Nov 2022 09:33:14 +0000 Subject: [PATCH] Add Python 3.11 to the wheel matrix, remove 2.7 and 3.6 - tests are still done on 2.7 and 3.6 - update `actions/checkout` and `actions/setup-python` - use `pypa/cibuildwheel` for publishing --- .github/workflows/pythonpackage.yml | 22 ++--- .github/workflows/pythonpublish.yml | 136 +++++++++++----------------- README.md | 5 + setup.py | 6 +- 4 files changed, 72 insertions(+), 97 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 287435e..b1d80b2 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index a401c4f..60f52a4 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -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/ diff --git a/README.md b/README.md index 9fb0e3c..6d591e2 100644 --- a/README.md +++ b/README.md @@ -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): diff --git a/setup.py b/setup.py index 1161758..96d49d8 100644 --- a/setup.py +++ b/setup.py @@ -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", @@ -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", ],