Skip to content

Commit e57638e

Browse files
authored
Allow python <3.13 and remove numpy pin (#1169)
* Increase upper bound of python to include 3.12 * Add tests for different python versions * Minor formatting * Use quotes for version to avoid parsing errors * Ensure build dependencies are installed distutils was removed for python 3.12 * Add more build dependencies * Try different resources * Temp test on <3.12 * Remove importlib_metadata pin Fixed in twine pypa/twine#1125 * Revert "Temp test on <3.12" This reverts commit 5b27366. * Change install order of build dependencies * Remove numpy pin * Update CHANGELOG.md
1 parent 6be6b71 commit e57638e

File tree

5 files changed

+31
-26
lines changed

5 files changed

+31
-26
lines changed

.github/workflows/test-package-build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
python-version: 3.9
3030
- run: |
3131
pip install --upgrade build twine
32-
pip install importlib_metadata==7.2.1 # twine #977
3332
- name: Build sdist and wheel
3433
run: python -m build
3534
- run: twine check dist/*
@@ -50,6 +49,7 @@ jobs:
5049
needs: [build]
5150
strategy:
5251
matrix:
52+
python-version: ['3.9', '3.10', '3.11', '3.12']
5353
package: ['wheel', 'sdist', 'archive']
5454
steps:
5555
- name: Download sdist and wheel artifacts
@@ -66,11 +66,13 @@ jobs:
6666
path: archive/
6767
- uses: actions/setup-python@v5
6868
with:
69-
python-version: 3.9
69+
python-version: ${{ matrix.python-version }}
7070
- name: Display Python version
7171
run: python -c "import sys; print(sys.version)"
72-
- name: Update pip
73-
run: pip install --upgrade pip
72+
- name: Install build dependencies
73+
run: |
74+
pip install --upgrade setuptools wheel
75+
pip install --upgrade pip
7476
- name: Install wheel
7577
if: matrix.package == 'wheel'
7678
run: pip install dist/*.whl

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ dj.FreeTable(dj.conn(), "common_session.session_group").drop()
3434
- Remove stored hashes from pytests #1152
3535
- Remove mambaforge from tests #1153
3636
- Remove debug statement #1164
37+
- Allow python < 3.13 #1169
38+
- Remove numpy version restriction #1169
39+
- Add testing for python versions 3.9, 3.10, 3.11, 3.12 #1169
3740

3841
### Pipelines
3942

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ dependencies:
2323
# - libgcc # dlc-only
2424
- matplotlib
2525
- non_local_detector
26-
- numpy<1.24
26+
- numpy
2727
- pip
2828
- position_tools
2929
- pybind11 # req by mountainsort4 -> isosplit5
3030
- pydotplus
3131
- pyfftw<=0.12.0 # ghostipy req. install from conda-forge for Mac ARM
32-
- python>=3.9,<3.10
32+
- python>=3.9,<3.13
3333
- pytorch<1.12.0
3434
- ripple_detection
3535
- seaborn

environment_dlc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ dependencies:
2323
- libgcc # dlc-only
2424
- matplotlib
2525
- non_local_detector
26-
- numpy<1.24
26+
- numpy
2727
- pip>=20.2.*
2828
- position_tools
2929
- pybind11 # req by mountainsort4 -> isosplit5
3030
- pydotplus>=2.0.*
3131
- pyfftw<=0.12.0 # ghostipy req. install from conda-forge for Mac ARM
32-
- python>=3.9,<3.10
32+
- python>=3.9,<3.13
3333
- pytorch<1.12.0
3434
- ripple_detection
3535
- seaborn

pyproject.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66
name = "spyglass-neuro"
77
description = "Neuroscience data analysis framework for reproducible research"
88
readme = "README.md"
9-
requires-python = ">=3.9,<3.10"
9+
requires-python = ">=3.9,<3.13"
1010
license = { file = "LICENSE" }
1111
authors = [
1212
{ name = "Loren Frank", email = "[email protected]" },
@@ -46,11 +46,11 @@ dependencies = [
4646
"matplotlib",
4747
"ndx_franklab_novela>=0.1.0",
4848
"non_local_detector",
49-
"numpy<1.24",
49+
"numpy",
5050
"opencv-python",
51-
"panel>=1.4.0", # panel #6325 resolved
51+
"panel>=1.4.0", # panel #6325 resolved
5252
"position_tools>=0.1.0",
53-
"pubnub<6.4.0", # TODO: remove this when sortingview is updated
53+
"pubnub<6.4.0", # TODO: remove this when sortingview is updated
5454
"pydotplus",
5555
"pynwb>=2.2.0,<3",
5656
"ripple_detection",
@@ -62,21 +62,21 @@ dependencies = [
6262

6363
[project.optional-dependencies]
6464
dlc = [
65-
"ffmpeg",
66-
"deeplabcut[tf]", # removing dlc pin removes need to pin tf/numba
65+
"ffmpeg",
66+
"deeplabcut[tf]", # removing dlc pin removes need to pin tf/numba
6767
]
6868
test = [
69-
"click", # for CLI subpackage only
70-
"docker", # for tests in a container
69+
"click", # for CLI subpackage only
70+
"docker", # for tests in a container
7171
"ghostipy",
72-
"kachery", # database access
72+
"kachery", # database access
7373
"kachery-client",
7474
"kachery-cloud>=0.4.0",
7575
"opencv-python-headless", # for headless testing of Qt
76-
"pre-commit", # linting
77-
"pytest", # unit testing
78-
"pytest-cov", # code coverage
79-
"pytest-xvfb", # for headless testing of Qt
76+
"pre-commit", # linting
77+
"pytest", # unit testing
78+
"pytest-cov", # code coverage
79+
"pytest-xvfb", # for headless testing of Qt
8080
]
8181
docs = [
8282
"hatch", # Get version from env
@@ -134,7 +134,7 @@ addopts = [
134134
# "--no-dlc", # don't run DLC tests
135135
"--show-capture=no",
136136
"--pdbcls=IPython.terminal.debugger:TerminalPdb", # use ipython debugger
137-
"--doctest-modules", # run doctests in all modules
137+
"--doctest-modules", # run doctests in all modules
138138
"--cov=spyglass",
139139
"--cov-report=term-missing",
140140
"--no-cov-on-fail",
@@ -143,9 +143,9 @@ testpaths = ["tests"]
143143
log_level = "INFO"
144144
env = [
145145
"QT_QPA_PLATFORM = offscreen", # QT fails headless without this
146-
"DISPLAY = :0", # QT fails headless without this
147-
"TF_ENABLE_ONEDNN_OPTS = 0", # TF disable approx calcs
148-
"TF_CPP_MIN_LOG_LEVEL = 2", # Disable TF warnings
146+
"DISPLAY = :0", # QT fails headless without this
147+
"TF_ENABLE_ONEDNN_OPTS = 0", # TF disable approx calcs
148+
"TF_CPP_MIN_LOG_LEVEL = 2", # Disable TF warnings
149149
]
150150

151151
[tool.coverage.run]
@@ -175,4 +175,4 @@ omit = [ # which submodules have no tests
175175
line-length = 80
176176

177177
[tool.ruff.lint]
178-
ignore = ["F401" , "E402", "E501"]
178+
ignore = ["F401", "E402", "E501"]

0 commit comments

Comments
 (0)