Skip to content

Commit

Permalink
Allow python <3.13 and remove numpy pin (#1169)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
edeno authored Oct 23, 2024
1 parent 6be6b71 commit e57638e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 26 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand All @@ -50,6 +49,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
Expand All @@ -66,11 +66,13 @@ 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
run: pip install --upgrade pip
- name: Install build dependencies
run: |
pip install --upgrade setuptools wheel
pip install --upgrade pip
- name: Install wheel
if: matrix.package == 'wheel'
run: pip install dist/*.whl
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ dependencies:
# - libgcc # dlc-only
- matplotlib
- non_local_detector
- numpy<1.24
- numpy
- pip
- position_tools
- 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
Expand Down
4 changes: 2 additions & 2 deletions environment_dlc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ dependencies:
- libgcc # dlc-only
- matplotlib
- non_local_detector
- numpy<1.24
- numpy
- pip>=20.2.*
- position_tools
- 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
Expand Down
36 changes: 18 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
Expand Down Expand Up @@ -46,11 +46,11 @@ dependencies = [
"matplotlib",
"ndx_franklab_novela>=0.1.0",
"non_local_detector",
"numpy<1.24",
"numpy",
"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",
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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]
Expand Down Expand Up @@ -175,4 +175,4 @@ omit = [ # which submodules have no tests
line-length = 80

[tool.ruff.lint]
ignore = ["F401" , "E402", "E501"]
ignore = ["F401", "E402", "E501"]

0 comments on commit e57638e

Please sign in to comment.