Skip to content

Commit

Permalink
Use pyproject toml instead of setup.py (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin authored Dec 11, 2024
1 parent 1702faf commit bf15323
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 86 deletions.
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ build:

python:
install:
- requirements: requirements-rtd.txt
- method: pip
path: .
extra_requirements:
- docs

sphinx:
configuration: docs/source/conf.py
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Fixes

## Improvements
* Use `pyproject.toml` for project metadata and installation requirements [#382](https://github.com/catalystneuro/roiextractors/pull/382)


# v0.5.10 (November 6th, 2024)

Expand Down
16 changes: 11 additions & 5 deletions docs/source/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ Installation
$ pip install roiextractors
#. You can check for any missing packages by explicitly installing from the `requirements <https://github.com/catalystneuro/roiextractors/blob/master/requirements.txt/>`_ file:
.. code-block:: shell
$ pip install -r requirements.txt
#. **Cloning the github repo**:
.. code-block:: shell
$ git clone https://github.com/SpikeInterface/spikeinterface.git
$ cd spikeinterface
$ python setup.py install (or develop)
$ pip install --editable .
You can also install the optional dependencies by installing the package with the following command:

.. code-block:: shell
$ pip install "roiextractors[full]"
$ pip install "roiextractors[test]"
$ pip install "roiextractors[docs]"
These commands install the full, test, and documentation dependencies, respectively.

What is RoiExtractors
---------------------
Expand Down
81 changes: 81 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,84 @@
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"

[project]
name = "roiextractors"
version = "0.5.11"
description = "Python module for extracting optical physiology ROIs and traces for various file types and formats"
readme = "README.md"
license = { file = "LICENSE.txt" }
authors = [
{ name = "Heberto Mayorquin" },
{ name = "Szonja Weigl" },
{ name = "Cody Baker" },
{ name = "Ben Dichter", email = "[email protected]" },
{ name = "Alessio Buccino" },
{ name = "Paul Adkisson" },
{ name = "Alessandra Trapani" }
]
keywords = ["ROI", "extraction", "optical physiology"]
classifiers = [
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"License :: OSI Approved :: BSD License",
]
requires-python = ">=3.9"

dependencies = [
"h5py>=2.10.0",
"pynwb>=2.0.1",
"tqdm>=4.48.2",
"lazy_ops>=0.2.0",
"dill>=0.3.2",
"scipy>=1.5.2",
"psutil>=5.8.0",
"PyYAML",
"lxml",
"packaging"
]

[project.optional-dependencies]
full = [
"tifffile>=2018.10.18",
"scanimage-tiff-reader>=1.4.1.4",
"neuroconv[video]>=0.4.6",
"opencv-python-headless>=4.8.1.78",
"natsort>=8.3.1",
"isx>=1.0.4"
]
test = [
"pytest",
"pytest-cov",
"parameterized==0.8.1",
"spikeinterface>=0.100.7",
"pytest-xdist"
]
docs = [
"Jinja2",
"Sphinx",
"sphinx_rtd_theme",
"readthedocs-sphinx-search",
"sphinx-toggleprompt",
"sphinx-copybutton",
"pydata_sphinx_theme"
]

[project.urls]
"Homepage" = "https://github.com/catalystneuro/roiextractors"
"Documentation" = "https://roiextractors.readthedocs.io//"
"Changelog" = "https://github.com/catalystneuro/roiextractors/blob/main/CHANGELOG.md"

[tool.setuptools.packages.find]
where = ["src"]



[tool.black]
line-length = 120
Expand Down
6 changes: 0 additions & 6 deletions requirements-full.txt

This file was deleted.

10 changes: 0 additions & 10 deletions requirements-minimal.txt

This file was deleted.

7 changes: 0 additions & 7 deletions requirements-rtd.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements-testing.txt

This file was deleted.

38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

40 changes: 26 additions & 14 deletions tests/setup_paths.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
import os
import json
import tempfile
from pathlib import Path
from tempfile import mkdtemp
from shutil import copy
import json

import pytest
# Output by default to a temporary directory
OUTPUT_PATH = Path(tempfile.mkdtemp())


file_path = Path(__file__).parent / "gin_test_config.json"
# Load the configuration for the data tests

with open(file=file_path) as f:
test_config_dict = json.load(f)

if os.getenv("CI"):
LOCAL_PATH = Path(".") # Must be set to "." for CI
print("Running GIN tests on Github CI!")
else:
# Override LOCAL_PATH in the `gin_test_config.json` file to a point on your system that contains the dataset folder
# Use DANDIHub at hub.dandiarchive.org for open, free use of data found in the /shared/catalystneuro/ directory
test_config_path = Path(__file__).parent / "gin_test_config.json"
config_file_exists = test_config_path.exists()
if not config_file_exists:

root = test_config_path.parent.parent
base_test_config_path = root / "base_gin_test_config.json"

test_config_path.parent.mkdir(parents=True, exist_ok=True)
copy(src=base_test_config_path, dst=test_config_path)

with open(file=test_config_path) as f:
# Load the configuration for the data tests
test_config_dict = json.load(f)

LOCAL_PATH = Path(test_config_dict["LOCAL_PATH"])
print("Running GIN tests locally!")

if test_config_dict["SAVE_OUTPUTS"]:
OUTPUT_PATH = LOCAL_PATH / "neuroconv_test_outputs"
OUTPUT_PATH.mkdir(exist_ok=True, parents=True)


OPHYS_DATA_PATH = LOCAL_PATH / "ophys_testing_data"
if not OPHYS_DATA_PATH.exists():
pytest.fail(f"No folder found in location: {OPHYS_DATA_PATH}!")

if test_config_dict["SAVE_OUTPUTS"]:
OUTPUT_PATH = LOCAL_PATH / "example_nwb_output"
OUTPUT_PATH.mkdir(exist_ok=True)
else:
OUTPUT_PATH = Path(mkdtemp())
TEXT_DATA_PATH = Path(__file__).parent.parent.parent / "tests" / "test_text"

0 comments on commit bf15323

Please sign in to comment.