Skip to content

Commit

Permalink
Merge pull request #371 from jnwatson/3.13-support
Browse files Browse the repository at this point in the history
CI support for building and publishing 3.13

* Use newer versions of 3p actions
* Initial support for publishing aarch64 manylinux wheels
  • Loading branch information
jnwatson authored Jan 5, 2025
2 parents 5cf07a3 + 92c0d1a commit bbc3ff7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
70 changes: 36 additions & 34 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', pypy-3.10]
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13', pypy-3.10]
impl: [cpython, cffi]
purity: [pure, with-pylmdb-mods]

Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
pytest
- name: Save wheel
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.impl }}-${{ matrix.purity }}.whl"
path: dist/lmdb-*.whl
Expand All @@ -112,7 +112,7 @@ jobs:
if: >-
matrix.python-version == '3.10' && runner.os == 'Linux' &&
matrix.purity == 'with-pylmdb-mods' && matrix.impl == 'cpython'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: vers.txt
name: vers.txt
Expand All @@ -124,7 +124,7 @@ jobs:
matrix.python-version == '3.10' && runner.os == 'Linux' &&
matrix.purity == 'with-pylmdb-mods' && matrix.impl == 'cpython'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: dist/lmdb*.tar.gz
name: source
Expand All @@ -136,7 +136,7 @@ jobs:
uses: RalfG/python-wheels-manylinux-build@v0.7.1
with:
python-versions: >-
cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312
cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313
build-requirements: 'patch-ng'

- name: What do we have
Expand All @@ -148,7 +148,7 @@ jobs:
if: >-
matrix.python-version == '3.10' && runner.os == 'Linux' &&
matrix.purity == 'with-pylmdb-mods' && matrix.impl == 'cpython'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: dist/lmdb*manylinux*.whl
name: manylinux
Expand All @@ -160,7 +160,7 @@ jobs:
matrix:
impl: [cpython, cffi]
purity: [pure, with-pylmdb-mods]
PYTHON: ["cp37-cp37m" , "cp38-cp38" , "cp39-cp39", "cp310-cp310", "cp311-cp311", 'cp312-cp312']
PYTHON: ["cp37-cp37m" , "cp38-cp38" , "cp39-cp39", "cp310-cp310", "cp311-cp311", 'cp312-cp312', 'cp313-cp313']
steps:
- uses: actions/checkout@v2
- run: |
Expand Down Expand Up @@ -190,60 +190,54 @@ jobs:
echo \"Windows: Envs are cpython=$Env:LMDB_FORCE_CPYTHON
cffi=$Env:LMDB_FORCE_CFFI pure=$Env:LMDB_PURE system=$Env:LMDB_FORCE_SYSTEM\";
.venv/bin/pip install setuptools flake8 pytest patch-ng;
/opt/python/${{ matrix.PYTHON }}/bin/python -m pip install setuptools;
/opt/python/${{ matrix.PYTHON }}/bin/python setup.py develop bdist_wheel;
ls dist;
/opt/python/${{ matrix.PYTHON }}/bin/python -m pip install pytest;
if \[ ${{ matrix.PYTHON }} != cp36-cp36 \] && \[ ${{ matrix.PYTHON }} != cp38-cp38 \] ; then
echo \"Envs are cpython=$LMDB_FORCE_CPYTHON cffi=$LMDB_FORCE_CFFI pure=$LMDB_PURE system=$LMDB_FORCE_SYSTEM\";
echo \"Envs are cpython=$LMDB_FORCE_CPYTHON cffi=$LMDB_FORCE_CFFI pure=$LMDB_PURE system=$LMDB_FORCE_SYSTEM\";
if \[ ${{ matrix.PYTHON }} != cp36-cp36 \] && \[ ${{ matrix.PYTHON }} != cp38-cp38 \] && \[ ${{ matrix.PYTHON }} != cp311-cp311 \] ; then
/opt/python/${{ matrix.PYTHON }}/bin/python -m pytest;
fi;
if \[ ${{ matrix.PYTHON }} == cp310-cp310 \] && \[ ${{ runner.os }} == 'Linux' \] && \[ ${{ matrix.purity }} == 'with-pylmdb-mods' \] && \[ ${{ matrix.impl }} == 'cpython' \] ; then
/opt/python/${{ matrix.PYTHON }}/bin/python -c \"import lmdb; print(lmdb.__version__, end='')\" > vers.txt;
fi;"
- uses: actions/upload-artifact@v2
/opt/python/${{ matrix.PYTHON }}/bin/python -c \"import lmdb; print(lmdb.__version__, end='')\" > vers.txt;
- uses: actions/upload-artifact@v4
with:
name: "${{ runner.os }}-${{ matrix.PYTHON }}-${{ matrix.impl }}-${{ matrix.purity }}.whl"
path: dist/lmdb-*.whl

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: >-
matrix.PYTHON == 'cp310-cp310' && runner.os == 'Linux' &&
matrix.purity == 'with-pylmdb-mods' && matrix.impl == 'cpython'
with:
path: vers.txt
name: vers.txt
- uses: actions/upload-artifact@v2
if: >-
matrix.PYTHON == 'cp310-cp310' && runner.os == 'Linux' &&
matrix.purity == 'with-pylmdb-mods' && matrix.impl == 'cpython'
with:
path: dist/lmdb*.tar.gz
name: source
name: vers.txt.aarch64
- uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_aarch64
if: >-
matrix.PYTHON == 'cp310-cp310' && runner.os == 'Linux' &&
matrix.purity == 'with-pylmdb-mods' && matrix.impl == 'cpython'
with:
python-versions: >-
cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312
cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313
build-requirements: 'patch-ng'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: >-
matrix.PYTHON == 'cp310-cp310' && runner.os == 'Linux' &&
matrix.purity == 'with-pylmdb-mods' && matrix.impl == 'cpython'
with:
path: dist/lmdb*manylinux*.whl
name: manylinux
name: manylinux.aarch64

publish:
needs: build
permissions:
id-token: write # This is required for passwordless publishing to PyPI
needs: [build, build_aarch64]
# N.B. the host running twine to upload is distinct from the target image
runs-on: ubuntu-20.04
strategy:
# We publish a subset of the targets we test
matrix:
os: [macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', pypy-3.10]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', pypy-3.10]
impl: [cpython, cffi]
purity: [with-pylmdb-mods]

Expand All @@ -264,6 +258,8 @@ jobs:
impl: cffi
- python-version: '3.12'
impl: cffi
- python-version: '3.13'
impl: cffi

include:
# Ubuntu artifacts apply to all python versions
Expand All @@ -275,21 +271,28 @@ jobs:
steps:
- name: Download source
if: matrix.os == 'ubuntu-20.04'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: source
path: dist

- name: Download manylinux artifact
- name: Download manylinux artifacts
if: matrix.os == 'ubuntu-20.04'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: manylinux
path: dist

- name: Download aarch64 manylinux artifacts
if: matrix.os == 'ubuntu-20.04'
uses: actions/download-artifact@v4
with:
name: manylinux.aarch64
path: dist

- name: Download non-Linux wheel
if: matrix.os != 'ubuntu-20.04'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: "${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.impl }}-${{ matrix.purity }}.whl"
path: dist
Expand All @@ -302,12 +305,11 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1

with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# with: password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion lmdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ def _reading_docs():
from lmdb.cffi import __all__
from lmdb.cffi import __doc__

__version__ = '1.5.1'
__version__ = '1.5.1.dev0'
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def grep_version():
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Database",
"Topic :: Database :: Database Engines/Servers",
],
Expand Down

0 comments on commit bbc3ff7

Please sign in to comment.