Skip to content
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

Numpy 2 support #199

Closed
wants to merge 8 commits into from
Closed
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
11 changes: 3 additions & 8 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,7 @@ 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 numpy==1.23.5
pip install --user -r python/requirements/development.txt
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- run:
Expand Down Expand Up @@ -72,17 +72,12 @@ jobs:
command: |
cd python
rm -fR build
python setup.py sdist
python -m venv venv
source venv/bin/activate
pip install --upgrade setuptools pip wheel numpy
pip install build
python -m build
python setup.py build_ext
python setup.py egg_info
python setup.py bdist_wheel
pip wheel dist/*.tar.gz
pip install dist/*.tar.gz
pip install dist/*.whl
- run:
name: Run Python with C coverage
command: |
Expand Down
42 changes: 38 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ jobs:
pip install clang-format==6.0.1
- uses: pre-commit/action@v3.0.0


test:
name: Python
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:
Expand All @@ -46,12 +45,47 @@ jobs:
python-version: ${{matrix.python}}

- name: Install pip deps
run: pip install -r python/requirements/CI/tests/requirements.txt
run: python -m pip install -r python/requirements/CI/tests/requirements.txt

- name: Build module
working-directory: python
run: |
python setup.py build_ext --inplace
python -m pip install .

- name: Run tests
working-directory: python
run: |
python -m pytest tests

numpy-versions:
name: Numpy compat
runs-on: ubuntu-latest
strategy:
matrix:
numpy: [ 1.23.5, "2.0" ]
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install numpy
run: python -m pip install numpy==${{matrix.numpy}}

- name: Install package
working-directory: python
run: |
python -m pip install .

- name: Install pip deps
run: |
python -m pip install -r python/requirements/CI/tests/requirements.txt
# Make sure we're still using the same version of numpy
python -m pip install numpy==${{matrix.numpy}}

- name: Run tests
working-directory: python
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: macos-latest
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
Expand Down Expand Up @@ -93,10 +93,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

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

- name: Build sdist
shell: bash
Expand Down Expand Up @@ -164,12 +164,12 @@ jobs:
pip install -r python/requirements/CI/tests/requirements.txt
python -m pytest -v python

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

- name: Run tests (3.8)
- 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 Down
26 changes: 13 additions & 13 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 All @@ -41,4 +41,4 @@ pull_request_rules:
actions:
label:
remove:
- AUTOMERGE-REQUESTED
- AUTOMERGE-REQUESTED
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] - 2024-06-20
--------------------

kastore now requires Python 3.8 or later.
Maintenance release:

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


--------------------
Expand Down
4 changes: 2 additions & 2 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"numpy>=2",
"setuptools>=42",
"wheel",
"oldest-supported-numpy"
]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"
9 changes: 5 additions & 4 deletions python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ classifiers =
Topic :: Scientific/Engineering :: Bio-Informatics
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
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 :: Only
keywords =
binary store
Expand All @@ -35,10 +35,11 @@ platforms =

[options]
packages = kastore
python_requires = >=3.8
include_package_data = True
python_requires = >=3.9
include_package_data = False
# Follow https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-abi-handling
install_requires =
numpy>=1.7
numpy>=1.23.5
humanize

[options.entry_points]
Expand Down
Loading