Skip to content

Commit

Permalink
BUILD: Add support for Python 3.13 and drop 3.9.
Browse files Browse the repository at this point in the history
This adds python 3.13 to build process and drops support for 3.9
  • Loading branch information
zoj613 committed Nov 9, 2024
1 parent 3d81a7f commit 17bab85
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down
13 changes: 3 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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']
Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 17bab85

Please sign in to comment.