From 17bab854fdad69c71c68ac8d6696a2eaa5a1abe8 Mon Sep 17 00:00:00 2001 From: Zolisa Bleki Date: Sat, 9 Nov 2024 03:05:23 +0200 Subject: [PATCH] BUILD: Add support for Python 3.13 and drop 3.9. This adds python 3.13 to build process and drops support for 3.9 --- .github/workflows/build-and-test.yml | 7 ++++--- .github/workflows/release.yml | 4 ++-- pyproject.toml | 13 +++---------- requirements-dev.txt | 12 ++++++------ 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7ef78e0..0e220f5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ ubuntu-20.04, macOS-12, windows-2019 ] - python-version: [ '3.9', 'pypy3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.10', 'pypy3.10', '3.11', '3.12', '3.13' ] fail-fast: false name: Python version - ${{ matrix.python-version }} - ${{ matrix.os }} @@ -49,12 +49,13 @@ jobs: env: BUILD_WITH_COVERAGE: true run: | - cythonize polyagamma/*.pyx -X linetrace=${{ contains(fromJSON('["3.12", "pypy3.9"]'), matrix.python-version) && 'False' || 'True' }} + cythonize polyagamma/*.pyx -X linetrace=${{ contains(fromJSON('["pypy3.10"]'), matrix.python-version) && 'False' || 'True' }} python3 -m pip install -e . pytest -v --cov-branch --cov=polyagamma tests/ --cov-report=xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml fail_ci_if_error: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 913b225..c1a707f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' - name: Cythonize C-extensions run: | @@ -44,7 +44,7 @@ jobs: cythonize polyagamma/*.pyx - name: Build wheels - uses: pypa/cibuildwheel@v2.19.2 + uses: pypa/cibuildwheel@v2.21.3 with: package-dir: . output-dir: wheelhouse diff --git a/pyproject.toml b/pyproject.toml index 6fa9092..084f0d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,16 +3,9 @@ requires = [ "wheel", "setuptools>=61.0.0", "setuptools-scm", - # Here we build the project using the earliest numpy version supported by - # the used version of python. This does not affect required numpy version at - # installation time; `project.dependencies` is most relevant for required numpy - # when installtng at user level. - "numpy==2.0.0; python_version=='3.12' and platform_python_implementation!='PyPy'", - "numpy==2.0.0; python_version=='3.11' and platform_python_implementation!='PyPy'", - "numpy==2.0.0; python_version=='3.10' and platform_python_implementation!='PyPy'", - "numpy==2.0.0; python_version=='3.9' and platform_python_implementation!='PyPy'", + "numpy==2.1.3; python_version>='3.10' and platform_python_implementation!='PyPy'", # PyPy specific requirements - "numpy==2.0.0; python_version=='3.9' and platform_python_implementation=='PyPy'", + "numpy==2.1.3; python_version=='3.10' and platform_python_implementation=='PyPy'", ] build-backend = "setuptools.build_meta" @@ -25,7 +18,7 @@ authors = [ description = "Efficiently generate samples from the Polya-Gamma distribution using a NumPy/SciPy compatible interface." readme = "README.md" dynamic = ["version"] -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = ["numpy >= 1.19.0"] license = {text = "BSD 3-Clause License"} keywords = ['polya-gamma distribution', 'polya-gamma random sampling'] diff --git a/requirements-dev.txt b/requirements-dev.txt index d921df4..c2ea27f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ -cython==3.0.* -numpy==2.0.0 -pre-commit==3.4.0 -pytest==7.4.0 -pytest-cov==4.1.0 -setuptools==70.3.0 +cython==3.0.11 +numpy==2.1.3 +pre-commit==4.0.1 +pytest==8.3.3 +pytest-cov==6.0.0 +setuptools==75.3.0