From 06397a9e25b091960382074ec53abf2d2621ee21 Mon Sep 17 00:00:00 2001 From: Daniel McDonald Date: Tue, 3 Dec 2024 14:00:32 -0700 Subject: [PATCH] Add py313 to CI, remove outdated Python versions (#986) * Update testing mechanism to use pytest over setuptools test command * Add py313 to CI, remove outdated Python versions * Editable install * Editable install for aarch64: * DOC: changelog mention: --------- Co-authored-by: Matt Aton --- .github/workflows/python-package-conda.yml | 6 ++-- .github/workflows/release.yml | 2 +- ChangeLog.md | 4 +++ Makefile | 4 +-- aarch64.Dockerfile | 2 +- setup.py | 33 ---------------------- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index b0fe15d7..4f07e5c3 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -10,7 +10,7 @@ on: env: latest_python: "3.12" - supported_pythons: '["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]' + supported_pythons: '["3.9", "3.10", "3.11", "3.12", "3.13"]' miniforge_version: "22.9.0-2" miniforge_variant: "Mambaforge" @@ -98,13 +98,13 @@ jobs: shell: bash -l {0} run: | conda install -q --yes -c conda-forge --file ci/conda_requirements.txt - pip install . --no-deps + pip install -e . --no-deps conda list - name: Install dependencies (pip) if: ${{ !matrix.use_conda }} shell: bash -l {0} run: | - pip install . + pip install -e . conda list - name: Run unit tests shell: bash -l {0} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5268d137..7561fad1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - '*' env: - earliest_python: "3.8" + earliest_python: "3.9" latest_python: "3.12" miniforge_version: "23.11.0-0" miniforge_variant: "Mambaforge" diff --git a/ChangeLog.md b/ChangeLog.md index 74a799ed..3e28019d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,10 @@ BIOM-Format ChangeLog biom-2.1.16-dev --------------- +Maintenance: + +* Python 3.7 and 3.8 removed from CI as they are [end-of-life](https://devguide.python.org/versions/). Python 3.13 added to CI. See PR[#986](https://github.com/biocore/biom-format/pull/986). + biom 2.1.16 ----------- diff --git a/Makefile b/Makefile index 3cc24266..997a7c9f 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,9 @@ # ---------------------------------------------------------------------------- ifeq ($(WITH_DOCTEST), TRUE) - TEST_COMMAND = python setup.py test -a --doctest-modules --doctest-glob='*.pyx' + TEST_COMMAND = pytest --doctest-modules --doctest-glob='*.pyx' else - TEST_COMMAND = python setup.py test + TEST_COMMAND = pytest endif .PHONY: doc lint test diff --git a/aarch64.Dockerfile b/aarch64.Dockerfile index b067a656..08046872 100644 --- a/aarch64.Dockerfile +++ b/aarch64.Dockerfile @@ -10,6 +10,6 @@ COPY . /work WORKDIR /work RUN bash -c ". /opt/conda/etc/profile.d/conda.sh && conda activate testing && conda env update -q -f ci/conda_host_env.yml" RUN bash -c ". /opt/conda/etc/profile.d/conda.sh && conda activate testing && conda install -q --yes --file ci/aarch64.conda_requirements.txt" -RUN bash -c ". /opt/conda/etc/profile.d/conda.sh && conda activate testing && pip install . --no-deps" +RUN bash -c ". /opt/conda/etc/profile.d/conda.sh && conda activate testing && pip install -e . --no-deps" RUN bash -c ". /opt/conda/etc/profile.d/conda.sh && conda activate testing && conda list" RUN bash -c ". /opt/conda/etc/profile.d/conda.sh && conda activate testing && make test" diff --git a/setup.py b/setup.py index d940c05d..5cfb1594 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,6 @@ from setuptools import setup, find_packages from setuptools.extension import Extension -from setuptools.command.test import test as TestCommand import numpy as np from Cython.Build import cythonize @@ -37,37 +36,6 @@ __email__ = "mcdonadt@colorado.edu" -# derived from https://docs.pytest.org/en/3.8.0/goodpractices.html -class PyTest(TestCommand): - user_options = [("pytest-args=", "a", "Arguments to pass to pytest")] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.pytest_args = "" - - def run_tests(self): - try: - import numpy - try: - # NumPy 1.14 changed repr output breaking our doctests, - # request the legacy 1.13 style - numpy.set_printoptions(legacy="1.13") - except TypeError: - # Old Numpy, output should be fine as it is :) - # TypeError: set_printoptions() got an unexpected - # keyword argument 'legacy' - pass - except ImportError: - numpy = None - - import shlex - - # import here, cause outside the eggs aren't loaded - import pytest - errno = pytest.main(shlex.split(self.pytest_args)) - sys.exit(errno) - - long_description = """BIOM: Biological Observation Matrix http://www.biom-format.org @@ -152,7 +120,6 @@ def run_tests(self): 'anndata': ["anndata"], }, classifiers=classifiers, - cmdclass={"pytest": PyTest}, entry_points=''' [console_scripts] biom=biom.cli:cli