From e58d9b4d15d0dee6c70d9f56ec4e37525ad2fd16 Mon Sep 17 00:00:00 2001 From: Alex Rubinsteyn Date: Mon, 19 Oct 2026 22:38:22 -0400 Subject: [PATCH 1/2] Require Python 3.11 and test through 3.14 --- .github/workflows/tests.yml | 32 ++++++++++++++++++++++++++++++++ README.md | 4 +++- phipkit/__init__.py | 2 +- pyproject.toml | 2 +- setup.cfg | 6 +++++- test/test_integration.py | 6 ++++++ 6 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..b74a4b6 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + +jobs: + quality: + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13", "3.14"] + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python-version }} + - name: Install BLAST and Python dependencies + run: | + sudo apt-get update + sudo apt-get install -y ncbi-blast+ + python -m pip install --upgrade pip + python -m pip install -e . pytest build twine + python -m pip check + - name: Run tests + run: MPLBACKEND=Agg python -m pytest test -q + - name: Check release artifacts + run: | + python -m build + python -m twine check --strict dist/* diff --git a/README.md b/README.md index ed8ba95..99542b4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.com/openvax/phipkit.svg?branch=main)](https://travis-ci.com/openvax/phipkit) +[![Tests](https://github.com/openvax/phipkit/actions/workflows/tests.yml/badge.svg)](https://github.com/openvax/phipkit/actions/workflows/tests.yml) # phipkit PhIP-seq data analysis toolkit @@ -16,6 +16,8 @@ control comparisons or other analyses appropriate to the study. ## Installation +PhIPKit requires Python 3.11 or newer. + All dependencies except BLAST (required by `phipkit-blast` command) can be installed by pip: diff --git a/phipkit/__init__.py b/phipkit/__init__.py index c37270b..5bb938b 100644 --- a/phipkit/__init__.py +++ b/phipkit/__init__.py @@ -2,7 +2,7 @@ phipkit - analysis package for Phage Immunoprecipitation Sequencing (phip-seq) """ -__version__ = "0.0.2" +__version__ = "0.0.3" from . import antigen_analysis from . import call_antigens from . import call_hits diff --git a/pyproject.toml b/pyproject.toml index 374b58c..b1331b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=42", + "setuptools>=77", "wheel" ] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 3019430..e81e0ef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,13 +11,17 @@ project_urls = Bug Tracker = https://github.com/openvax/phipkit/issues classifiers = Programming Language :: Python :: 3 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 + Programming Language :: Python :: 3.14 Topic :: Scientific/Engineering :: Bio-Informatics License :: OSI Approved :: MIT License Operating System :: OS Independent [options] packages = find: -python_requires = >=3.3 +python_requires = >=3.11 install_requires = pandas dna_features_viewer diff --git a/test/test_integration.py b/test/test_integration.py index 6b9fa4c..16d14d0 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -1,9 +1,11 @@ import random +import shutil import tempfile import os import numpy import pandas +import pytest from phipkit.blast import run_blast from phipkit.score import compute_scores @@ -74,6 +76,10 @@ TEST_PROTEINS["S_redundant"] = TEST_PROTEINS["S"] +@pytest.mark.skipif( + not all(shutil.which(name) for name in ("makeblastdb", "blastp")), + reason="NCBI BLAST executables are not installed", +) def test_integrated(save_dir=None): """ Run the integration test. From 2ea7b6f43db1f27b3f3936e168f2d52057c6827e Mon Sep 17 00:00:00 2001 From: Alex Rubinsteyn Date: Mon, 19 Oct 2026 22:44:01 -0400 Subject: [PATCH 2/2] Use keyword axis for pandas 3 antigen plots --- phipkit/antigen_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phipkit/antigen_analysis.py b/phipkit/antigen_analysis.py index d8ce873..0e90449 100644 --- a/phipkit/antigen_analysis.py +++ b/phipkit/antigen_analysis.py @@ -195,7 +195,7 @@ def plot_antigen( title = antigen.split("OS")[0].strip() title += "\nHits in %d of %d clones" % ( self.clone_by_sample_hits_matrix.reindex( - all_coverage_by_clone.index).fillna(0)[all_samples].any(1).sum(), + all_coverage_by_clone.index).fillna(0)[all_samples].any(axis=1).sum(), len(all_coverage_by_clone)) pyplot.suptitle(title)