Skip to content

Commit

Permalink
Fix testing of min and optional requirements (#99)
Browse files Browse the repository at this point in the history
* Fix testing of min and optional requirements
* Update CHANGELOG.md
* Update tox.ini
* Ignore pkg_resources deprecation warning in test_gallery (#100)
* Update test_gallery.py
* Update requirements-min.txt
* Update setup.py
* Update requirements.txt
* Use hdmf 3.5.4 only
* Update tox.ini
* Discard changes to .github/workflows/run_all_tests.yml

---------

Co-authored-by: Matthew Avaylon <[email protected]>
  • Loading branch information
rly and mavaylon1 authored Jul 12, 2023
1 parent 13b92e8 commit 30219ba
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
### Test suite enhancements
* Modularized unit tests to simplify running tests for multiple Zarr storage backends.
@oruebel [#62](https://github.com/hdmf-dev/hdmf-zarr/pull/62)
* Updated tests to handle upcoming changes to ``HDMFIO``. @rly [#102](https://github.com/hdmf-dev/hdmf-zarr/pull/102)
* Fixed CI testing of minimum and optional installation requirement. @rly
[#99](https://github.com/hdmf-dev/hdmf-zarr/pull/99)
* Updated tests to handle upcoming changes to ``HDMFIO``. @rly
[#102](https://github.com/hdmf-dev/hdmf-zarr/pull/102)


### Docs
* Added developer documentation on how to integrate new storage backends with ZarrIO. @oruebel
Expand Down
4 changes: 2 additions & 2 deletions requirements-min.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hdmf==3.5.2
hdmf==3.5.4
zarr==2.11.0
numcodecs==0.9.1
pynwb==2.0.0
pynwb==2.3.2
setuptools
importlib_resources;python_version<'3.9' # Remove when python 3.9 becomes the new minimum
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pinned dependencies to reproduce an entire development environment to use HDMF-ZARR
hdmf==3.5.2
hdmf==3.5.4
zarr==2.11.0
pynwb==2.3.0
pynwb==2.3.2
numpy==1.23.5
numcodecs==0.11.0
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@


reqs = [
'hdmf<=3.5.4, >=3.5.2',
'hdmf==3.5.4', # temporary
'zarr>=2.11.0',
'numpy>=1.22, <1.24; python_version>"3.7"',
'numcodecs>=0.9.1',
'pynwb>=2.0.0',
'pynwb>=2.3.2',
'setuptools',
]

Expand Down
16 changes: 16 additions & 0 deletions test_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ def _import_from_file(script):
spec.loader.exec_module(module)


_pkg_resources_warning_re = (
"pkg_resources is deprecated as an API"
)

_pkg_resources_declare_warning_re = (
r"Deprecated call to `pkg_resources\.declare_namespace.*"
)

_numpy_warning_re = (
"numpy.ufunc size changed, may indicate binary incompatibility. Expected 216, got 192"
)
Expand Down Expand Up @@ -111,6 +119,14 @@ def run_gallery_tests():
# against a different version of numpy than the one installed
"ignore", message=_numpy_warning_re, category=RuntimeWarning
)
warnings.filterwarnings(
# this warning is triggered when downstream code such as pynwb uses pkg_resources>=5.13
"ignore", message=_pkg_resources_warning_re, category=DeprecationWarning
)
warnings.filterwarnings(
# this warning is triggered when downstream code such as pynwb uses pkg_resources>=5.13
"ignore", message=_pkg_resources_declare_warning_re, category=DeprecationWarning
)
_import_from_file(script_abs)
except Exception:
print(traceback.format_exc())
Expand Down
16 changes: 12 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ setenv =
PYTHONDONTWRITEBYTECODE = 1
VIRTUALENV_python -m pip = 22.3.1
install_command =
python -m pip install -U {opts} {packages}
python -m pip install {opts} {packages}

deps =
-rrequirements-dev.txt
Expand All @@ -37,7 +37,8 @@ basepython = python3.11
install_command =
python -m pip install {opts} {packages}
deps =
-rrequirements-dev.txt
{[testenv]deps}
# -rrequirements-opt.txt
commands = {[testenv]commands}

# Test with python 3.11; pinned dev and optional reqs; upgraded run reqs
Expand All @@ -47,6 +48,7 @@ install_command =
python -m pip install -U {opts} {packages}
deps =
-rrequirements-dev.txt
# -rrequirements-opt.txt
commands = {[testenv]commands}

# Test with python 3.11; pinned dev and optional reqs; upgraded, pre-release run reqs
Expand All @@ -56,6 +58,7 @@ install_command =
python -m pip install -U --pre {opts} {packages}
deps =
-rrequirements-dev.txt
# -rrequirements-opt.txt
commands = {[testenv]commands}

# Test with python 3.7; pinned dev reqs; minimum run reqs
Expand Down Expand Up @@ -95,7 +98,8 @@ commands = {[testenv:build]commands}
[testenv:build-py311-optional]
basepython = python3.11
deps =
-rrequirements-dev.txt
{[testenv]deps}
# -rrequirements-opt.txt
commands = {[testenv:build]commands}

[testenv:build-py311-upgraded]
Expand All @@ -104,6 +108,7 @@ install_command =
python -m pip install -U {opts} {packages}
deps =
-rrequirements-dev.txt
# -rrequirements-opt.txt
commands = {[testenv:build]commands}

[testenv:build-py311-prerelease]
Expand All @@ -112,6 +117,7 @@ install_command =
python -m pip install -U --pre {opts} {packages}
deps =
-rrequirements-dev.txt
# -rrequirements-opt.txt
commands = {[testenv:build]commands}

[testenv:build-py37-minimum]
Expand All @@ -129,7 +135,7 @@ commands = python -c "import hdmf_zarr"
# Envs that will execute gallery tests
[testenv:gallery]
install_command =
python -m pip install -U {opts} {packages}
python -m pip install {opts} {packages}

deps =
-rrequirements-dev.txt
Expand Down Expand Up @@ -167,6 +173,7 @@ install_command =
deps =
-rrequirements-dev.txt
-rrequirements-doc.txt
# -rrequirements-opt.txt
commands = {[testenv:gallery]commands}

# Test with python 3.11; pinned dev, doc, and optional reqs; pre-release run reqs
Expand All @@ -177,6 +184,7 @@ install_command =
deps =
-rrequirements-dev.txt
-rrequirements-doc.txt
# -rrequirements-opt.txt
commands = {[testenv:gallery]commands}

# Test with python 3.7; pinned dev and doc reqs; minimum run reqs
Expand Down

0 comments on commit 30219ba

Please sign in to comment.