From ccc07b8e6e8e9a5f297ba03743ebd2b84cfa523f Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 14:25:01 -0700 Subject: [PATCH 01/17] feat(ci): test with GitHub Actions --- .github/workflows/build.yml | 45 ++++++++++++ .github/workflows/manual.yml | 47 ------------ Dockerfile | 137 ----------------------------------- README.md | 2 +- pyproject.toml | 44 +++++++++++ scripts/testall.sh | 15 ---- 6 files changed, 90 insertions(+), 200 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/manual.yml delete mode 100644 Dockerfile create mode 100644 pyproject.toml delete mode 100755 scripts/testall.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7ddb206 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: build + +on: + push: + branches: [ "master", "gha" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Display Python verison + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest pytest-cov sortedcontainers + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest + diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml deleted file mode 100644 index ee9f72b..0000000 --- a/.github/workflows/manual.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: ci - -on: - push: - branches: - - "master" - -env: - TEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/intervaltree:test - LATEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/intervaltree:latest - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and export to Docker - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - load: true - tags: ${{ env.TEST_TAG }} - - - name: Test - run: docker run --rm ${{ env.TEST_TAG }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ env.LATEST_TAG }} - diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 1b7e32a..0000000 --- a/Dockerfile +++ /dev/null @@ -1,137 +0,0 @@ -# Modified by chaimleib March 2023 from -# https://github.com/vicamo/docker-pyenv/blob/main/alpine/Dockerfile -# -# Changes: -# * customize the versions of python installed -# * remove the dependency on github.com/momo-lab/xxenv-latest -# * forbid failures when building python -# * add other tools like parallel -# * run intervaltree tests - -FROM alpine:latest AS base - -ENV PYENV_ROOT="/opt/pyenv" -ENV PYENV_SHELL="bash" -ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:$PATH" - -# http://bugs.python.org/issue19846 -# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. -ENV LANG C.UTF-8 - -# runtime dependencies -RUN set -eux; \ - apk update; \ - apk add --no-cache \ - bash \ - build-base \ - bzip2 \ - ca-certificates \ - curl \ - expat \ - git \ - libffi \ - mpdecimal \ - ncurses-libs \ - openssl \ - parallel \ - readline \ - sqlite-libs \ - tk \ - xz \ - zlib \ - ; - -RUN set -eux; \ - curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash; \ - pyenv update - -FROM base AS builder - -# runtime dependencies -RUN set -eux; \ - apk update; \ - apk add --no-cache \ - bzip2-dev \ - libffi-dev \ - ncurses-dev \ - openssl-dev \ - readline-dev \ - sqlite-dev \ - tk-dev \ - xz-dev \ - zlib-dev \ - ; - -FROM builder AS build-2.7.18 -RUN set -eux; pyenv install 2.7.18; \ - find ${PYENV_ROOT}/versions -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + - -FROM builder AS build-3.6.15 -RUN set -eux; pyenv install 3.6.15; \ - find ${PYENV_ROOT}/versions -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + - -FROM builder AS build-3.7.16 -RUN set -eux; pyenv install 3.7.16; \ - find ${PYENV_ROOT}/versions -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + - -FROM builder AS build-3.8.16 -RUN set -eux; pyenv install 3.8.16; \ - find ${PYENV_ROOT}/versions -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + - -FROM builder AS build-3.9.16 -RUN set -eux; pyenv install 3.9.16; \ - find ${PYENV_ROOT}/versions -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + - -FROM builder AS build-3.10.10 -RUN set -eux; pyenv install 3.10.10; \ - find ${PYENV_ROOT}/versions -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + - -FROM builder AS build-3.11.2 -RUN set -eux; pyenv install 3.11.2; \ - find ${PYENV_ROOT}/versions -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \( -type f -a -name 'wininst-*.exe' \) \ - \) -exec rm -rf '{}' + - -FROM base AS tester -COPY --from=build-2.7.18 /opt/pyenv/versions/2.7.18 /opt/pyenv/versions/2.7.18 -COPY --from=build-3.6.15 /opt/pyenv/versions/3.6.15 /opt/pyenv/versions/3.6.15 -COPY --from=build-3.7.16 /opt/pyenv/versions/3.7.16 /opt/pyenv/versions/3.7.16 -COPY --from=build-3.8.16 /opt/pyenv/versions/3.8.16 /opt/pyenv/versions/3.8.16 -COPY --from=build-3.9.16 /opt/pyenv/versions/3.9.16 /opt/pyenv/versions/3.9.16 -COPY --from=build-3.10.10 /opt/pyenv/versions/3.10.10 /opt/pyenv/versions/3.10.10 -COPY --from=build-3.11.2 /opt/pyenv/versions/3.11.2 /opt/pyenv/versions/3.11.2 - -RUN set -eux; \ - pyenv rehash; \ - pyenv versions - -WORKDIR /intervaltree -COPY . . -CMD [ "scripts/testall.sh" ] - diff --git a/README.md b/README.md index b7e24ae..ad8a685 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ Licensed under the [Apache License, version 2.0][Apache]. The source code for this project is at https://github.com/chaimleib/intervaltree -[build status badge]: https://github.com/chaimleib/intervaltree/workflows/ci/badge.svg +[build status badge]: https://github.com/chaimleib/intervaltree/workflows/build/badge.svg [build status]: https://github.com/chaimleib/intervaltree/actions [GH]: https://github.com/chaimleib/intervaltree [issue tracker]: https://github.com/chaimleib/intervaltree/issues diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..95e2454 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "intervaltree" +description='Editable interval tree data structure' +version = "3.2.0" +authors = [ + { name="Chaim Leib Halbert", email="chaim.leib.halbert@gmail.com" }, +] +readme = "README.md" +requires-python = ">=3.7" +dependencies = [ + "sortedcontainers < 3", +] +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Programming Language :: Python :: Implementation :: PyPy', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: Science/Research', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'License :: OSI Approved :: Apache Software License', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Scientific/Engineering :: Bio-Informatics', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'Topic :: Software Development :: Libraries', + 'Topic :: Text Processing :: General', + 'Topic :: Text Processing :: Linguistic', + 'Topic :: Text Processing :: Markup', +] + +[project.urls] +Homepage = "https://github.com/chaimleib/intervaltree" +Issues = "https://github.com/chaimleib/intervaltree/issues" + +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" diff --git a/scripts/testall.sh b/scripts/testall.sh deleted file mode 100755 index 1364729..0000000 --- a/scripts/testall.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# Tests using `python setup.py test` using different versions of python. - -this_dir="$(dirname "$0")" -export base_dir="$(dirname "$this_dir")" - -set -x -code=0 -for ver in $(pyenv versions --bare | sort -V); do - pyenv global "$ver" - python --version - python "$base_dir/setup.py" test || code=1 -done -set +x -exit "$code" From 2dc2de2689c5e7d1378b38d19272359506e74f67 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 14:37:59 -0700 Subject: [PATCH 02/17] fix(test): disable standalone test/intervals.py, optimality_test imports intervaltree --- test/intervals.py | 4 ++-- test/optimality/optimality_test.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/intervals.py b/test/intervals.py index 7c2612e..1be24cb 100644 --- a/test/intervals.py +++ b/test/intervals.py @@ -126,10 +126,10 @@ def trepr(s): pprint(data, f) -if __name__ == '__main__': +# if __name__ == '__main__': # ivs = gaps_rand() # write_ivs_data('ivs3', ivs, docstring=""" # Random integer ranges, with gaps. # """ # ) - pprint(ivs) + # pprint(ivs) diff --git a/test/optimality/optimality_test.py b/test/optimality/optimality_test.py index eb2223d..a9faacf 100644 --- a/test/optimality/optimality_test.py +++ b/test/optimality/optimality_test.py @@ -25,8 +25,10 @@ from test.optimality.optimality_test_matrix import OptimalityTestMatrix from test import data +from intervaltree import IntervalTree -matrix = OptimalityTestMatrix(verbose=1) + +matrix = OptimalityTestMatrix(verbose=True) matrix.run() From e8cf497028a32bf54bf1a3558276d0b8dda4034e Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 14:41:56 -0700 Subject: [PATCH 03/17] feat(ci): test in Python 2.7, 3.6+ --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ddb206..e4670de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 From 30a1b41a85d5e6c4e6a216eb03cea9e524bc9bd7 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 15:17:38 -0700 Subject: [PATCH 04/17] fix(ci): where python is too old for ubuntu-latest, use earlier ubuntu --- .github/workflows/build.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4670de..5c232d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,27 @@ permissions: jobs: build: - - runs-on: ubuntu-latest strategy: matrix: - python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] - + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + include: + - python-version: "3.6" + os: ubuntu-20.04 + - python-version: "3.7" + os: ubuntu-22.04 + - python-version: "3.8" + os: ubuntu-24.04 + - python-version: "3.9" + os: ubuntu-24.04 + - python-version: "3.10" + os: ubuntu-24.04 + - python-version: "3.11" + os: ubuntu-24.04 + - python-version: "3.12" + os: ubuntu-24.04 + - python-version: "3.13" + os: ubuntu-24.04 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} From d3fb6beb1f2b0ec514d5c646a4c563625dc0a5fd Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 21:30:50 -0700 Subject: [PATCH 05/17] feat(ci): split flake8 from pytest --- .github/workflows/flake8.yml | 36 +++++++++++++++++++++ .github/workflows/{build.yml => pytest.yml} | 14 +++----- 2 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/flake8.yml rename .github/workflows/{build.yml => pytest.yml} (71%) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 0000000..1245e43 --- /dev/null +++ b/.github/workflows/flake8.yml @@ -0,0 +1,36 @@ +# This workflow will install Python dependencies, and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: flake8 + +on: + push: + branches: [ "master", "gha" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + flake8: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.13 + uses: actions/setup-python@v5 + with: + python-version: 3.13 + - name: Display Python verison + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + diff --git a/.github/workflows/build.yml b/.github/workflows/pytest.yml similarity index 71% rename from .github/workflows/build.yml rename to .github/workflows/pytest.yml index 5c232d8..066aa5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/pytest.yml @@ -1,7 +1,7 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python +# This workflow will install Python dependencies, and run tests supported versions of Python. # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: build +name: pytest on: push: @@ -13,7 +13,7 @@ permissions: contents: read jobs: - build: + pytest: strategy: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] @@ -46,14 +46,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest pytest-cov sortedcontainers + pip install pytest pytest-cov sortedcontainers if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | pytest From 6f347e963081efbb234f559f450d4d33a0b67642 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 21:37:44 -0700 Subject: [PATCH 06/17] refactor(ci): combine flake8 and pytest as 2 jobs of single workflow --- .github/workflows/flake8.yml | 36 --------------------- .github/workflows/{pytest.yml => tests.yml} | 26 +++++++++++++-- 2 files changed, 24 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/flake8.yml rename .github/workflows/{pytest.yml => tests.yml} (62%) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml deleted file mode 100644 index 1245e43..0000000 --- a/.github/workflows/flake8.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will install Python dependencies, and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: flake8 - -on: - push: - branches: [ "master", "gha" ] - pull_request: - branches: [ "master" ] - -permissions: - contents: read - -jobs: - flake8: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.13 - uses: actions/setup-python@v5 - with: - python-version: 3.13 - - name: Display Python verison - run: python -c "import sys; print(sys.version)" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - diff --git a/.github/workflows/pytest.yml b/.github/workflows/tests.yml similarity index 62% rename from .github/workflows/pytest.yml rename to .github/workflows/tests.yml index 066aa5c..dfdabe2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/tests.yml @@ -1,7 +1,7 @@ -# This workflow will install Python dependencies, and run tests supported versions of Python. +# This workflow will install Python dependencies, lint, and run tests in supported versions of Python. # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: pytest +name: tests on: push: @@ -13,6 +13,7 @@ permissions: contents: read jobs: + pytest: strategy: matrix: @@ -52,3 +53,24 @@ jobs: run: | pytest + flake8: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.13 + uses: actions/setup-python@v5 + with: + python-version: 3.13 + - name: Display Python verison + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + From 55b067af41aba766cad439030381922474fa68d2 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 21:45:17 -0700 Subject: [PATCH 07/17] build: use requirements.txt files --- .github/workflows/tests.yml | 5 ++--- requirements.txt | 1 + requirements/common.txt | 1 + requirements/flake8.txt | 1 + requirements/pytest.txt | 3 +++ 5 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 requirements.txt create mode 100644 requirements/common.txt create mode 100644 requirements/flake8.txt create mode 100644 requirements/pytest.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dfdabe2..1c5503c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,8 +47,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-cov sortedcontainers - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -r requirements/pytest.txt - name: Test with pytest run: | pytest @@ -66,7 +65,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 + pip install -r requirements/flake8.txt - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c58f7cb --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +-r requirements/common.txt diff --git a/requirements/common.txt b/requirements/common.txt new file mode 100644 index 0000000..1e73a3a --- /dev/null +++ b/requirements/common.txt @@ -0,0 +1 @@ +sortedcontainers==2.4.0 diff --git a/requirements/flake8.txt b/requirements/flake8.txt new file mode 100644 index 0000000..3930480 --- /dev/null +++ b/requirements/flake8.txt @@ -0,0 +1 @@ +flake8 diff --git a/requirements/pytest.txt b/requirements/pytest.txt new file mode 100644 index 0000000..5c843eb --- /dev/null +++ b/requirements/pytest.txt @@ -0,0 +1,3 @@ +-r common.txt +pytest +pytest-cov From e5aa4036baeb44d04392a995b527513db8f3c9f2 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 21:53:13 -0700 Subject: [PATCH 08/17] build: MANIFEST.in includes requirements dir --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 260c74a..40d2b19 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ include README.md CHANGELOG.md LICENSE.txt -recursive-include test * +recursive-include test requirements From 0b3bcca4e9c8f76c6d6fabd9a0f95ba046e80ca3 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 21:54:10 -0700 Subject: [PATCH 09/17] build: pyproject.toml allows Python 3.6; remove deps from toml, use requirements.txt --- pyproject.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 95e2454..9d9bd4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,7 @@ authors = [ { name="Chaim Leib Halbert", email="chaim.leib.halbert@gmail.com" }, ] readme = "README.md" -requires-python = ">=3.7" -dependencies = [ - "sortedcontainers < 3", -] +requires-python = ">=3.6" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: Implementation :: PyPy', @@ -18,6 +15,7 @@ classifiers = [ 'Intended Audience :: Science/Research', 'Programming Language :: Python', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', From dbb3f13863a98c4ead89d7a5c9bc15eee7e8253a Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 22:02:38 -0700 Subject: [PATCH 10/17] feat(ci): show test coverage --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1c5503c..c12f5cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,7 +50,8 @@ jobs: pip install -r requirements/pytest.txt - name: Test with pytest run: | - pytest + coverage run -m pytest + coverage report flake8: runs-on: ubuntu-latest From 22c00344251da49c2c4cc797f346380ed7c2c964 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 22:20:22 -0700 Subject: [PATCH 11/17] feat(ci): test on python 2.7 --- .github/workflows/tests.yml | 18 +++++++++++++++++- pyproject.toml | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c12f5cc..d09ec01 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,23 @@ jobs: - name: Test with pytest run: | coverage run -m pytest - coverage report + coverage report -m + + pytest-python27: + runs-on: ubuntu-latest + container: coatldev/six:latest + steps: + - uses: actions/checkout@v4 + - name: Display Python verison + run: python2 -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + python2 -m pip install --upgrade pip + pip2 install -r requirements/pytest.txt + - name: Test with pytest + run: | + coverage2 run -m pytest + coverage2 report -m flake8: runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index 9d9bd4d..3c6c1d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,8 @@ classifiers = [ 'Intended Audience :: Information Technology', 'Intended Audience :: Science/Research', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', From 353b192027f5fcd5350247d38553dcf65b905215 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 22:30:54 -0700 Subject: [PATCH 12/17] feat(ci): test on Python 3.14 --- .github/workflows/tests.yml | 4 +++- pyproject.toml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d09ec01..9dbab33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: pytest: strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.5"] include: - python-version: "3.6" os: ubuntu-20.04 @@ -35,6 +35,8 @@ jobs: os: ubuntu-24.04 - python-version: "3.13" os: ubuntu-24.04 + - python-version: "3.14.0-alpha.5" + os: ubuntu-24.04 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 3c6c1d0..b586c7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ classifiers = [ 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'License :: OSI Approved :: Apache Software License', 'Topic :: Scientific/Engineering :: Artificial Intelligence', 'Topic :: Scientific/Engineering :: Bio-Informatics', From e360dfd061cb2bf5477ab9dd93cb6611058787f1 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 22:42:05 -0700 Subject: [PATCH 13/17] feat(ci): test on Python 3.5 --- .github/workflows/tests.yml | 10 +++++++--- README.md | 2 +- pyproject.toml | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9dbab33..fc7da39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,8 +17,10 @@ jobs: pytest: strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.5"] + python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.5"] include: + - python-version: "3.5" + os: ubuntu-20.04 - python-version: "3.6" os: ubuntu-20.04 - python-version: "3.7" @@ -44,7 +46,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Display Python verison + env: + PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" + - name: Display Python version run: python -c "import sys; print(sys.version)" - name: Install dependencies run: | @@ -60,7 +64,7 @@ jobs: container: coatldev/six:latest steps: - uses: actions/checkout@v4 - - name: Display Python verison + - name: Display Python version run: python2 -c "import sys; print(sys.version)" - name: Install dependencies run: | diff --git a/README.md b/README.md index ad8a685..856084e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ pip install intervaltree Features -------- -* Supports Python 2.7 and Python 3.6+ (Tested under 2.7, and 3.6 thru 3.11) +* Supports Python 2.7 and Python 3.5+ (Tested under 2.7, and 3.5 thru 3.14) * Initializing * blank `tree = IntervalTree()` * from an iterable of `Interval` objects (`tree = IntervalTree(intervals)`) diff --git a/pyproject.toml b/pyproject.toml index b586c7c..1aa7ee6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ classifiers = [ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', From dacb875308b56ae897aaa71941e555c5a523ae51 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 23:00:03 -0700 Subject: [PATCH 14/17] doc(readme): copyright 2025 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 856084e..3be58d8 100644 --- a/README.md +++ b/README.md @@ -356,7 +356,7 @@ Based on Copyright --------- -* [Chaim Leib Halbert][GH], 2013-2023 +* [Chaim Leib Halbert][GH], 2013-2025 * Modifications, [Konstantin Tretyakov][Konstantin intervaltree], 2014 Licensed under the [Apache License, version 2.0][Apache]. From 1dec7a9878ad1d60b53ae03c9b0b5ae14339b821 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 23:02:37 -0700 Subject: [PATCH 15/17] doc(ci): update build badge URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3be58d8..985f9dc 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ Licensed under the [Apache License, version 2.0][Apache]. The source code for this project is at https://github.com/chaimleib/intervaltree -[build status badge]: https://github.com/chaimleib/intervaltree/workflows/build/badge.svg +[build status badge]: https://github.com/chaimleib/intervaltree/workflows/tests/badge.svg [build status]: https://github.com/chaimleib/intervaltree/actions [GH]: https://github.com/chaimleib/intervaltree [issue tracker]: https://github.com/chaimleib/intervaltree/issues From 9cc6b195bac88b8bc5c9cddbb56f534b0acf7a27 Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 23:36:48 -0700 Subject: [PATCH 16/17] build: pyproject.toml requires-python ~=2.7 or ~= 3.5; restore author; restore description for Py2&3 --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1aa7ee6..776a3e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,13 @@ [project] name = "intervaltree" -description='Editable interval tree data structure' +description='Editable interval tree data structure for Python 2 and 3' version = "3.2.0" authors = [ { name="Chaim Leib Halbert", email="chaim.leib.halbert@gmail.com" }, + { name="Konstantin Tretyakov" }, ] readme = "README.md" -requires-python = ">=3.6" +requires-python = ">= 2.7.18, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: Implementation :: PyPy', From 39069155eafa2311e050fcb5eb570cff08c8009d Mon Sep 17 00:00:00 2001 From: Chaim Halbert Date: Tue, 11 Mar 2025 23:48:56 -0700 Subject: [PATCH 17/17] doc: pyproject.toml license and keywords --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 776a3e0..db128d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,8 @@ authors = [ ] readme = "README.md" requires-python = ">= 2.7.18, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +license = "Apache-2.0" +keywords = ['interval-tree', 'data-structure', 'intervals', 'tree'] classifiers = [ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: Implementation :: PyPy',