From 509fe1b66e0d1b5bc8acb1edafd86f598ce20a50 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 08:57:44 -0700 Subject: [PATCH 01/13] Increase upper bound of python to include 3.12 --- environment.yml | 2 +- environment_dlc.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index 7fa1b51ea..5ed798fc8 100644 --- a/environment.yml +++ b/environment.yml @@ -29,7 +29,7 @@ dependencies: - pybind11 # req by mountainsort4 -> isosplit5 - pydotplus - pyfftw<=0.12.0 # ghostipy req. install from conda-forge for Mac ARM - - python>=3.9,<3.10 + - python>=3.9,<3.13 - pytorch<1.12.0 - ripple_detection - seaborn diff --git a/environment_dlc.yml b/environment_dlc.yml index 9870a0424..0e81d4adb 100644 --- a/environment_dlc.yml +++ b/environment_dlc.yml @@ -29,7 +29,7 @@ dependencies: - pybind11 # req by mountainsort4 -> isosplit5 - pydotplus>=2.0.* - pyfftw<=0.12.0 # ghostipy req. install from conda-forge for Mac ARM - - python>=3.9,<3.10 + - python>=3.9,<3.13 - pytorch<1.12.0 - ripple_detection - seaborn diff --git a/pyproject.toml b/pyproject.toml index ed3a570c8..4e77d9a5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" name = "spyglass-neuro" description = "Neuroscience data analysis framework for reproducible research" readme = "README.md" -requires-python = ">=3.9,<3.10" +requires-python = ">=3.9,<3.13" license = { file = "LICENSE" } authors = [ { name = "Loren Frank", email = "loren.frank@ucsf.edu" }, From 29390647abd03557d300aa663244a8f77d6a498c Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 08:57:58 -0700 Subject: [PATCH 02/13] Add tests for different python versions --- .github/workflows/test-package-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 3513bb664..4d8ca7ceb 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -50,6 +50,7 @@ jobs: needs: [build] strategy: matrix: + python-version: [3.9, 3.10, 3.11, 3.12] package: ['wheel', 'sdist', 'archive'] steps: - name: Download sdist and wheel artifacts @@ -66,7 +67,7 @@ jobs: path: archive/ - uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} - name: Display Python version run: python -c "import sys; print(sys.version)" - name: Update pip From f41ce0dfc5433472b06a0b4d35086bc2c8c41a56 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 08:58:08 -0700 Subject: [PATCH 03/13] Minor formatting --- pyproject.toml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4e77d9a5e..e9218f4a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,9 +48,9 @@ dependencies = [ "non_local_detector", "numpy<1.24", "opencv-python", - "panel>=1.4.0", # panel #6325 resolved + "panel>=1.4.0", # panel #6325 resolved "position_tools>=0.1.0", - "pubnub<6.4.0", # TODO: remove this when sortingview is updated + "pubnub<6.4.0", # TODO: remove this when sortingview is updated "pydotplus", "pynwb>=2.2.0,<3", "ripple_detection", @@ -62,21 +62,21 @@ dependencies = [ [project.optional-dependencies] dlc = [ - "ffmpeg", - "deeplabcut[tf]", # removing dlc pin removes need to pin tf/numba + "ffmpeg", + "deeplabcut[tf]", # removing dlc pin removes need to pin tf/numba ] test = [ - "click", # for CLI subpackage only - "docker", # for tests in a container + "click", # for CLI subpackage only + "docker", # for tests in a container "ghostipy", - "kachery", # database access + "kachery", # database access "kachery-client", "kachery-cloud>=0.4.0", "opencv-python-headless", # for headless testing of Qt - "pre-commit", # linting - "pytest", # unit testing - "pytest-cov", # code coverage - "pytest-xvfb", # for headless testing of Qt + "pre-commit", # linting + "pytest", # unit testing + "pytest-cov", # code coverage + "pytest-xvfb", # for headless testing of Qt ] docs = [ "hatch", # Get version from env @@ -134,7 +134,7 @@ addopts = [ # "--no-dlc", # don't run DLC tests "--show-capture=no", "--pdbcls=IPython.terminal.debugger:TerminalPdb", # use ipython debugger - "--doctest-modules", # run doctests in all modules + "--doctest-modules", # run doctests in all modules "--cov=spyglass", "--cov-report=term-missing", "--no-cov-on-fail", @@ -143,9 +143,9 @@ testpaths = ["tests"] log_level = "INFO" env = [ "QT_QPA_PLATFORM = offscreen", # QT fails headless without this - "DISPLAY = :0", # QT fails headless without this - "TF_ENABLE_ONEDNN_OPTS = 0", # TF disable approx calcs - "TF_CPP_MIN_LOG_LEVEL = 2", # Disable TF warnings + "DISPLAY = :0", # QT fails headless without this + "TF_ENABLE_ONEDNN_OPTS = 0", # TF disable approx calcs + "TF_CPP_MIN_LOG_LEVEL = 2", # Disable TF warnings ] [tool.coverage.run] @@ -175,4 +175,4 @@ omit = [ # which submodules have no tests line-length = 80 [tool.ruff.lint] -ignore = ["F401" , "E402", "E501"] +ignore = ["F401", "E402", "E501"] From 12aa74d24e1577dac047dbdd2b738d240062f6d7 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:07:32 -0700 Subject: [PATCH 04/13] Use quotes for version to avoid parsing errors --- .github/workflows/test-package-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 4d8ca7ceb..34478e54a 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -50,7 +50,7 @@ jobs: needs: [build] strategy: matrix: - python-version: [3.9, 3.10, 3.11, 3.12] + python-version: ['3.9', '3.10', '3.11', '3.12'] package: ['wheel', 'sdist', 'archive'] steps: - name: Download sdist and wheel artifacts From 4328151c0babd5d66a6853582f1932245d274464 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:14:04 -0700 Subject: [PATCH 05/13] Ensure build dependencies are installed distutils was removed for python 3.12 --- .github/workflows/test-package-build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 34478e54a..793d7693b 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -70,8 +70,10 @@ jobs: python-version: ${{ matrix.python-version }} - name: Display Python version run: python -c "import sys; print(sys.version)" - - name: Update pip - run: pip install --upgrade pip + - name: Install build dependencies + run: | + pip install --upgrade pip + pip install --upgrade setuptools wheel - name: Install wheel if: matrix.package == 'wheel' run: pip install dist/*.whl From 791f90288eb2568b82681866c21c7b551bb9a51a Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:16:44 -0700 Subject: [PATCH 06/13] Add more build dependencies --- .github/workflows/test-package-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 793d7693b..ef457c3e2 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -74,6 +74,7 @@ jobs: run: | pip install --upgrade pip pip install --upgrade setuptools wheel + pip install --upgrade setuptools_scm pkg_resources - name: Install wheel if: matrix.package == 'wheel' run: pip install dist/*.whl From 7486f243f260e03e78f049ee25b338c19e5ca420 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:18:45 -0700 Subject: [PATCH 07/13] Try different resources --- .github/workflows/test-package-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index ef457c3e2..793d7693b 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -74,7 +74,6 @@ jobs: run: | pip install --upgrade pip pip install --upgrade setuptools wheel - pip install --upgrade setuptools_scm pkg_resources - name: Install wheel if: matrix.package == 'wheel' run: pip install dist/*.whl From 5b2736651928e01e38816a4a7f479415ea41fc74 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:20:46 -0700 Subject: [PATCH 08/13] Temp test on <3.12 --- .github/workflows/test-package-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 793d7693b..750258ac0 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -50,7 +50,7 @@ jobs: needs: [build] strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11'] package: ['wheel', 'sdist', 'archive'] steps: - name: Download sdist and wheel artifacts From 407f013a8764e4f056c7ebe8ff0be0be710c9dd8 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:24:43 -0700 Subject: [PATCH 09/13] Remove importlib_metadata pin Fixed in twine https://github.com/pypa/twine/issues/1125 --- .github/workflows/test-package-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 750258ac0..ca1f1b7df 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -29,7 +29,6 @@ jobs: python-version: 3.9 - run: | pip install --upgrade build twine - pip install importlib_metadata==7.2.1 # twine #977 - name: Build sdist and wheel run: python -m build - run: twine check dist/* From f4c68baacd63e049ac7d9ab24c7dca1b2f130ea4 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:30:33 -0700 Subject: [PATCH 10/13] Revert "Temp test on <3.12" This reverts commit 5b2736651928e01e38816a4a7f479415ea41fc74. --- .github/workflows/test-package-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index ca1f1b7df..96e843a96 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -49,7 +49,7 @@ jobs: needs: [build] strategy: matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12'] package: ['wheel', 'sdist', 'archive'] steps: - name: Download sdist and wheel artifacts From 0aee897e855f7414bb43ddc2a94a37d1b0a6b095 Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:47:14 -0700 Subject: [PATCH 11/13] Change install order of build dependencies --- .github/workflows/test-package-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-package-build.yml b/.github/workflows/test-package-build.yml index 96e843a96..e07017a31 100644 --- a/.github/workflows/test-package-build.yml +++ b/.github/workflows/test-package-build.yml @@ -71,8 +71,8 @@ jobs: run: python -c "import sys; print(sys.version)" - name: Install build dependencies run: | - pip install --upgrade pip pip install --upgrade setuptools wheel + pip install --upgrade pip - name: Install wheel if: matrix.package == 'wheel' run: pip install dist/*.whl From b2fce731a4934d7a4a66a90819f2b3ca7239a95f Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 09:51:46 -0700 Subject: [PATCH 12/13] Remove numpy pin --- environment.yml | 2 +- environment_dlc.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/environment.yml b/environment.yml index 5ed798fc8..a5229b8a8 100644 --- a/environment.yml +++ b/environment.yml @@ -23,7 +23,7 @@ dependencies: # - libgcc # dlc-only - matplotlib - non_local_detector - - numpy<1.24 + - numpy - pip - position_tools - pybind11 # req by mountainsort4 -> isosplit5 diff --git a/environment_dlc.yml b/environment_dlc.yml index 0e81d4adb..156bed793 100644 --- a/environment_dlc.yml +++ b/environment_dlc.yml @@ -23,7 +23,7 @@ dependencies: - libgcc # dlc-only - matplotlib - non_local_detector - - numpy<1.24 + - numpy - pip>=20.2.* - position_tools - pybind11 # req by mountainsort4 -> isosplit5 diff --git a/pyproject.toml b/pyproject.toml index e9218f4a0..0bd9164cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ dependencies = [ "matplotlib", "ndx_franklab_novela>=0.1.0", "non_local_detector", - "numpy<1.24", + "numpy", "opencv-python", "panel>=1.4.0", # panel #6325 resolved "position_tools>=0.1.0", From 39a2a123c9333beb2b4025d0d4360379204356ac Mon Sep 17 00:00:00 2001 From: Eric Denovellis Date: Wed, 23 Oct 2024 10:01:13 -0700 Subject: [PATCH 13/13] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c3fbe4de..84d6d2c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,9 @@ dj.FreeTable(dj.conn(), "common_session.session_group").drop() - Remove stored hashes from pytests #1152 - Remove mambaforge from tests #1153 - Remove debug statement #1164 +- Allow python < 3.13 #1169 +- Remove numpy version restriction #1169 +- Add testing for python versions 3.9, 3.10, 3.11, 3.12 #1169 ### Pipelines