Skip to content

Commit 4266756

Browse files
CodyCBakerPhDCodyCBakerPhDstephprince
authored
Swap to pyproject.toml setup (#507)
* swap to pyproject.toml * changelog * remove * center README logo and badges; fix logo link in README so will show up in PyPI * remove 3.8 from testing * add changelog mention * fix import * fix import * fix import; remove ros3 install; use hatchling instead of setuptools * Update pyproject.toml Co-authored-by: Steph Prince <[email protected]> * Update pyproject.toml Co-authored-by: Steph Prince <[email protected]> * Update pyproject.toml --------- Co-authored-by: CodyCBakerPhD <[email protected]> Co-authored-by: Steph Prince <[email protected]>
1 parent e3cc7e2 commit 4266756

File tree

13 files changed

+137
-81
lines changed

13 files changed

+137
-81
lines changed

.github/workflows/testing.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
pip install pytest
3232
pip install pytest-cov
3333
34-
- name: Install ROS3
35-
run: conda install -c conda-forge h5py
3634
- name: Install package
3735
run: pip install ".[dandi]"
3836
- name: Download testing data and set config path

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Removed the `robust_ros3_read` utility helper. [#506](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/506)
1111
* Simplified the `nwbinspector.testing` configuration framework. [#509](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/509)
1212
* Cleaned old references to non-recent PyNWB and HDMF versions. Current policy is that latest NWB Inspector releases should only support compatibility with latest PyNWB and HDMF. [#510](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/510)
13+
* Swapped setup approach to the modern `pyproject.toml` standard. [#507](https://github.com/NeurodataWithoutBorders/nwbinspector/pull/507)
14+
1315

1416

1517

README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
1-
<img src="docs/logo/logo.png" width="300">
1+
<p align="center">
2+
<img src="https://raw.githubusercontent.com/neurodatawithoutborders/nwbinspector/dev/docs/logo/logo.png" width="250" alt="NWB Inspector logo"/>
3+
4+
<p align="center">
5+
<a href="https://pypi.org/project/dandi_s3_log_parser/"><img alt="Supported Python versions" src="https://img.shields.io/pypi/pyversions/nwbinspector.svg"></a>
6+
<a href="https://codecov.io/github/CatalystNeuro/dandi_s3_log_parser?branch=main"><img alt="codecov" src="https://codecov.io/github/NeurodataWithoutBorders/nwbinspector/coverage.svg?branch=main"></a>
7+
</p>
8+
<p align="center">
9+
<a href="https://pypi.org/project/nwbinpsector/"><img alt="PyPI latest release version" src="https://badge.fury.io/py/nwbinspector.svg?id=py&kill_cache=1"></a>
10+
<a href="https://github.com/NeurodataWithoutBorders/nwbinspector/blob/dev/license.txt"><img alt="License: BSD-3" src="https://img.shields.io/pypi/l/nwbinspector.svg"></a>
11+
</p>
12+
<p align="center">
13+
<a href="https://github.com/psf/black"><img alt="Python code style: Black" src="https://img.shields.io/badge/python_code_style-black-000000.svg"></a>
14+
<a href="https://github.com/astral-sh/ruff"><img alt="Python code style: Ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
15+
</p>
16+
<p align="center">
17+
<a href="https://nwbinspector.readthedocs.io/"><img alt="Documentation build status" src="https://readthedocs.org/projects/nwbinspector/badge/?version=dev"></a>
18+
<a href="https://github.com/NeurodataWithoutBorders/nwbinspector/actions/workflows/dailies.yml/badge.svg"><img alt="Daily tests" src="https://github.com/NeurodataWithoutBorders/nwbinspector/actions/workflows/dailies.yml/badge.svg"></a>
19+
</p>
20+
</p>
21+
22+
Inspect NWB files for compliance with [NWB Best Practices](https://nwbinspector.readthedocs.io/en/dev/best_practices/best_practices_index.html).
23+
24+
This inspector is meant as a companion to the PyNWB validator, which checks for strict schema compliance. This tool attempts to apply some common sense to find components of the file that are technically compliant, but possibly incorrect, suboptimal in their representation, or deviate from best practices.
25+
26+
This tool is meant simply as a data review aid. It does not catch all possible violations of best practices and any warnings it does produce should be checked by a knowledgeable reviewer.
227

3-
[![PyPI version](https://badge.fury.io/py/nwbinspector.svg)](https://badge.fury.io/py/nwbinspector)
4-
[![ReadTheDocs](https://readthedocs.org/projects/nwbinspector/badge/?version=dev)](https://nwbinspector.readthedocs.io/)
5-
![Tests](https://github.com/NeurodataWithoutBorders/nwbinspector/actions/workflows/dailies.yml/badge.svg)
6-
[![codecov](https://codecov.io/gh/NeurodataWithoutBorders/nwbinspector/branch/dev/graphs/badge.svg?branch=dev)](https://codecov.io/github/NeurodataWithoutBorders/nwbinspector?branch=dev)
7-
[![License](https://img.shields.io/pypi/l/nwbinspector.svg)](https://github.com/NeurodataWithoutBorders/nwbinspector/blob/dev/license.txt)
828

9-
Inspect NWB files for compliance with [NWB Best Practices](https://nwbinspector.readthedocs.io/en/dev/best_practices/best_practices_index.html). This inspector is meant as a companion to the PyNWB validator, which checks for strict schema compliance. In contrast, this tool attempts to apply some common sense to find components of the file that are technically compliant, but possibly incorrect, suboptimal in their representation, or deviate from best practices. This tool is meant simply as a data review aid. It does not catch all best practice violations, and any warnings it does produce should be checked by a knowledgeable reviewer.
1029

1130
## Installation
31+
1232
```bash
1333
pip install nwbinspector
1434
```
1535

36+
37+
1638
## Usage
1739

1840
```bash
@@ -22,3 +44,5 @@ nwbinspector path/to/my/data.nwb
2244
# supply a path to a directory containing NWB files
2345
nwbinspector path/to/my/data/folder/
2446
```
47+
48+
Read about more detailed usage in the main [documentation](https://nwbinspector.readthedocs.io/en/dev/user_guide/user_guide_index.html).

docs/.readthedocs.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the version of Python and other tools you might need
8+
build:
9+
os: ubuntu-20.04
10+
tools:
11+
python: "3.9"
12+
13+
# Build documentation in the docs/ directory with Sphinx
14+
sphinx:
15+
configuration: docs/conf.py
16+
fail_on_warning: true
17+
18+
# Python requirements required to build your docs
19+
python:
20+
install:
21+
- requirements: requirements-rtd.txt
22+
- method: pip
23+
path: .

docs/requirements-rtd.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
numpy
2+
jsonschema==3.2.0
3+
Jinja2>=3.1.3
4+
sphinx==5.1.1
5+
sphinx_rtd_theme==0.5.1
6+
readthedocs-sphinx-search==0.3.2
7+
sphinx-copybutton==0.5.0

pyproject.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "nwbinspector"
7+
version = "0.6.0"
8+
description = "Tool to inspect NWB files for best practices compliance."
9+
readme = "README.md"
10+
authors = [
11+
{name = "Cody Baker"},
12+
{name = "Steph Prince"},
13+
{name = "Szonja Weigl"},
14+
{name = "Heberto Mayorquin"},
15+
{name = "Paul Adkisson"},
16+
{name = "Luiz Tauffer"},
17+
{name = "Ben Dichter", email = "[email protected]"}
18+
]
19+
urls = { "Homepage" = "https://github.com/NeurodataWithoutBorders/nwbinspector" }
20+
license = {file = "license.txt"}
21+
keywords = ["nwb"]
22+
classifiers = [
23+
"Intended Audience :: Science/Research",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
"Operating System :: POSIX :: Linux",
29+
"Operating System :: Microsoft :: Windows",
30+
"Operating System :: MacOS",
31+
"License :: OSI Approved :: BSD License",
32+
]
33+
requires-python = ">=3.9"
34+
dependencies = [
35+
"pynwb>=2.8", # NWB Inspector should always be used with most recent minor versions of PyNWB
36+
"hdmf-zarr",
37+
"fsspec",
38+
"s3fs",
39+
"requests",
40+
"aiohttp",
41+
"PyYAML",
42+
"jsonschema",
43+
"packaging",
44+
"natsort",
45+
"click",
46+
"tqdm",
47+
"isodate",
48+
"numpy>=1.22.0,<2.0.0" # TODO: add compatibility for 2.0
49+
]
50+
51+
[project.optional-dependencies]
52+
dandi = [
53+
"dandi",
54+
"remfile",
55+
]
56+
57+
[tool.setuptools.packages.find]
58+
where = ["src"]
59+
60+
[project.scripts]
61+
nwbinspector = "nwbinspector._nwbinspector_cli:_nwbinspector_cli"
62+
63+
64+
165
[tool.black]
266
line-length = 120
367
target-version = ['py37']

requirements.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 13 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/nwbinspector/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from ._version import __version__
1+
import importlib.metadata
2+
23
from ._registration import available_checks, register_check
34
from ._types import Importance, Severity, InspectorMessage
45
from ._configuration import load_config, validate_config, configure_checks
@@ -22,6 +23,9 @@
2223

2324
default_check_registry = {check.__name__: check for check in available_checks}
2425

26+
# Still keeping the legacy magic version attribute requested by some users
27+
__version__ = importlib.metadata.version(distribution_name="nwbinspector")
28+
2529
__all__ = [
2630
"available_checks",
2731
"default_check_registry",

0 commit comments

Comments
 (0)