Skip to content

Commit

Permalink
Upgrade actions infrastructure, numpy2 support, osx ARM wheels.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjeffery committed Jun 25, 2024
1 parent dd693ed commit dc776a3
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 135 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
jobs:
build:
docker:
- image: cimg/python:3.8
- image: cimg/python:3.9
steps:
- checkout
- run:
Expand All @@ -16,7 +16,6 @@ jobs:
sudo apt-get install -y ninja-build libcunit1-dev valgrind clang doxygen python3-pip
# Install meson as root so we can install to the system below.
sudo pip install meson
pip install numpy==1.18.5
pip install --user -r python/requirements/development.txt
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies and set path
run: |
sudo apt-get update
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
Expand All @@ -27,21 +27,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ 3.8, 3.11 ]
python: [ 3.9, 3.12 ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}

Expand All @@ -51,9 +51,15 @@ jobs:
- name: Build module
working-directory: python
run: |
python setup.py build_ext --inplace
python -m build
python -m pip install dist/*.whl
- name: Run tests
working-directory: python
run: |
python -m pytest tests
python -m pytest python/tests
- name: Run tests (numpy < 2)
run: |
pip install setuptools
pip install "numpy<2"
python -m pytest python/tests
79 changes: 40 additions & 39 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: [3.8, 3.9, "3.10", 3.11]
python: [3.9, "3.10", 3.11, 3.12]
wordsize: [64]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build wheel
env:
PYTHON: "py -${{ matrix.python }}-${{ matrix.wordsize }}"
Expand Down Expand Up @@ -49,21 +49,21 @@ jobs:
rm -rf python/kastore python/*.pyd
${PYTHON} -m pytest -v python
- name: Upload Wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: win-wheel-${{ matrix.python }}-${{ matrix.wordsize }}
path: python/dist

OSX:
runs-on: macos-latest
OSX-ARM:
runs-on: macos-14
strategy:
matrix:
python: [3.8, 3.9, "3.10", 3.11]
python: [3.9, "3.10", 3.11, 3.12]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Build Wheel
Expand All @@ -82,21 +82,22 @@ jobs:
rm -rf python/kastore python/*.so
python -m pytest -v python
- name: Upload Wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: osx-wheel-${{ matrix.python }}
name: osxarm-wheel-${{ matrix.python }}
path: python/dist


manylinux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9

- name: Build sdist
shell: bash
Expand All @@ -106,7 +107,7 @@ jobs:
python setup.py sdist
- name: Upload sdist
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: sdist
path: python/dist
Expand All @@ -116,12 +117,12 @@ jobs:
run: |
docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2014_x86_64 bash docker/buildwheel.sh
- name: Set up Python 3.11
uses: actions/setup-python@v2
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12

- name: Run tests (3.11)
- name: Run tests (3.12)
run: |
python -VV
# We install in this odd way to make sure we get both deps and a local kastore
Expand All @@ -132,12 +133,12 @@ jobs:
pip install -r python/requirements/CI/tests/requirements.txt
python -m pytest -v python
- name: Set up Python 3.10
uses: actions/setup-python@v2
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: 3.12

- name: Run tests (3.10)
- name: Run tests (3.11)
run: |
python -VV
# We install in this odd way to make sure we get both deps and a local kastore
Expand All @@ -148,12 +149,12 @@ jobs:
pip install -r python/requirements/CI/tests/requirements.txt
python -m pytest -v python
- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.10"

- name: Run tests (3.9)
- name: Run tests (3.10)
run: |
python -VV
# We install in this odd way to make sure we get both deps and a local kastore
Expand All @@ -164,12 +165,12 @@ jobs:
pip install -r python/requirements/CI/tests/requirements.txt
python -m pytest -v python
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9

- name: Run tests (3.8)
- name: Run tests (3.9)
run: |
python -VV
# We install in this odd way to make sure we get both deps and a local kastore
Expand All @@ -181,30 +182,30 @@ jobs:
python -m pytest -v python
- name: Upload Wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: linux-wheels
path: python/dist/wheelhouse


PyPI_Upload:
runs-on: ubuntu-latest
needs: ['windows', 'OSX', 'manylinux']
environment: release
needs: ['windows', 'OSX-ARM', 'manylinux']
permissions:
id-token: write
steps:
- name: Download all
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
- name: Move to dist
run: |
mkdir dist
cp */*.{whl,gz} dist/.
- name: Publish distribution to Test PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && !contains(github.event.ref, 'C_')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PRODUCTION PyPI
if: github.event_name == 'release' && !startsWith(github.event.release.tag_name, 'C_')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
uses: pypa/gh-action-pypi-publish@release/v1
24 changes: 12 additions & 12 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ queue_rules:
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- status-success=Lint
- status-success=Python (3.8, macos-latest)
- status-success=Python (3.11, macos-latest)
- status-success=Python (3.8, ubuntu-latest)
- status-success=Python (3.11, ubuntu-latest)
- status-success=Python (3.8, windows-latest)
- status-success=Python (3.11, windows-latest)
- status-success=Python (3.9, macos-latest)
- status-success=Python (3.12, macos-latest)
- status-success=Python (3.9, ubuntu-latest)
- status-success=Python (3.12, ubuntu-latest)
- status-success=Python (3.9, windows-latest)
- status-success=Python (3.12, windows-latest)
- "status-success=ci/circleci: build"

pull_request_rules:
Expand All @@ -21,12 +21,12 @@ pull_request_rules:
- base=main
- label=AUTOMERGE-REQUESTED
- status-success=Lint
- status-success=Python (3.8, macos-latest)
- status-success=Python (3.11, macos-latest)
- status-success=Python (3.8, ubuntu-latest)
- status-success=Python (3.11, ubuntu-latest)
- status-success=Python (3.8, windows-latest)
- status-success=Python (3.11, windows-latest)
- status-success=Python (3.9, macos-latest)
- status-success=Python (3.12, macos-latest)
- status-success=Python (3.9, ubuntu-latest)
- status-success=Python (3.12, ubuntu-latest)
- status-success=Python (3.9, windows-latest)
- status-success=Python (3.12, windows-latest)
- "status-success=ci/circleci: build"
actions:
queue:
Expand Down
3 changes: 1 addition & 2 deletions docker/shared.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
PYTHON_VERSIONS=(
cp312-cp312
cp311-cp311
cp310-cp310
cp39-cp39
cp38-cp38
cp37-cp37m
)
7 changes: 5 additions & 2 deletions python/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
--------------------
[0.3.X] - 202X-XX-XX
[0.3.3] - 202X-XX-XX
--------------------

kastore now requires Python 3.8 or later.
Maintenance release:

- Support for numpy 1.x and 2.x
- Require Python >= 3.9


--------------------
Expand Down
53 changes: 48 additions & 5 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,50 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"oldest-supported-numpy"
requires = ["setuptools>=45", "wheel", "numpy>=2"]
build-backend = "setuptools.build_meta"

[project]
name = "kastore"
dynamic = ["version"]
authors = [
{name = "Tskit Developers", email = "[email protected]"},
]
build-backend = "setuptools.build_meta"
description = "A write-once-read-many store for simple numerical data"
readme = "README.md"
license = {text = "MIT"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
]
keywords = ["binary store", "numerical", "arrays"]
dependencies = [
"numpy>=1.23.5",
"humanize",
]
requires-python = ">=3.9"

[project.urls]
Homepage = "https://github.com/tskit-dev/kastore"
Documentation = "https://kastore.readthedocs.io/en/latest/"
Changelog = "https://kastore.readthedocs.io/en/latest/changelogs.html"
"Bug Tracker" = "https://github.com/tskit-dev/kastore/issues"
GitHub = "https://github.com/tskit-dev/kastore"

[project.scripts]
kastore = "kastore.__main__:main"

[tool.setuptools]
packages = ["kastore"]

[tool.setuptools.dynamic]
version = {attr = "kastore._version.kastore_version"}

[tool.pytest.ini_options]
testpaths = ["tests"]
2 changes: 2 additions & 0 deletions python/requirements/CI/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
attrs
build
hypothesis
humanize
pytest
pytest-cov
numpy
mock
setuptools
Loading

0 comments on commit dc776a3

Please sign in to comment.