From 701737bb5df66f4d81de4d3ae04965cfaaa860ea Mon Sep 17 00:00:00 2001 From: igerber Date: Mon, 16 Feb 2026 10:39:23 -0500 Subject: [PATCH] Add Python 3.13 support with upper version cap Add 3.13 to build matrices (publish.yml), CI test matrix (rust-test.yml), classifiers (pyproject.toml), and docs (README.md). Cap requires-python at <3.14 to prevent broken installs on untested versions. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/publish.yml | 6 +++--- .github/workflows/rust-test.yml | 9 ++++++--- README.md | 2 +- pyproject.toml | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9dc65d9e..f1bcda19 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: - name: Build wheels run: | export PATH="$HOME/.cargo/bin:$PATH" - for pyver in 39 310 311 312; do + for pyver in 39 310 311 312 313; do pybin="/opt/python/cp${pyver}-cp${pyver}/bin/python" if [ -f "$pybin" ]; then /opt/python/cp312-cp312/bin/maturin build --release --out dist -i "$pybin" --features extension-module @@ -42,7 +42,7 @@ jobs: runs-on: macos-14 strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -72,7 +72,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 4bd2861d..293f346d 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -45,12 +45,13 @@ jobs: # Build and test with Python on multiple platforms python-tests: - name: Python Tests (${{ matrix.os }}) + name: Python Tests (${{ matrix.os }}, py${{ matrix.python-version }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.11', '3.13'] steps: - uses: actions/checkout@v4 @@ -58,12 +59,13 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ matrix.python-version }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Install test dependencies + # Keep in sync with pyproject.toml [project.dependencies] and [project.optional-dependencies.dev] run: pip install pytest pytest-xdist numpy pandas scipy - name: Build and install with maturin @@ -141,9 +143,10 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.13' - name: Install dependencies + # Keep in sync with pyproject.toml [project.dependencies] and [project.optional-dependencies.dev] run: pip install numpy pandas scipy pytest pytest-xdist - name: Verify pure Python mode diff --git a/README.md b/README.md index f7385ad4..cdf21c42 100644 --- a/README.md +++ b/README.md @@ -2452,7 +2452,7 @@ Returns DataFrame with columns: `unit`, `quality_score`, `outcome_trend_score`, ## Requirements -- Python >= 3.9 +- Python 3.9 - 3.13 - numpy >= 1.20 - pandas >= 1.3 - scipy >= 1.7 diff --git a/pyproject.toml b/pyproject.toml index cd32b103..44ca1451 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "2.3.1" description = "A library for Difference-in-Differences causal inference analysis" readme = "README.md" license = "MIT" -requires-python = ">=3.9" +requires-python = ">=3.9,<3.14" authors = [ {name = "diff-diff contributors"} ] @@ -28,6 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering :: Mathematics", ] dependencies = [