diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..b3e6c0b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,20 @@ +[wheel] +universal = 1 + +[flake8] +max-line-length = 120 +max-complexity = 17 +exclude = + .git, + .tox, + __pycache__, + build/, + dist/, + docs/source/conf.py + versioneer.py +per-file-ignores = + src/pynwb/tests/test_example_usage.py:T001 + + +[metadata] +description-file = README.md diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e58d9b2 --- /dev/null +++ b/setup.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- + +import os + +from setuptools import setup, find_packages +from shutil import copy2 + +# load README.md/README.rst file +try: + if os.path.exists('README.md'): + with open('README.md', 'r') as fp: + readme = fp.read() + readme_type = 'text/markdown; charset=UTF-8' + elif os.path.exists('README.rst'): + with open('README.rst', 'r') as fp: + readme = fp.read() + readme_type = 'text/x-rst; charset=UTF-8' + else: + readme = "" +except Exception: + readme = "" + +setup_args = { + 'name': 'ndx-hed', + 'version': '0.1.0', + 'description': 'NWB extension for storing HED annotations in VectorData format.', + 'long_description': readme, + 'long_description_content_type': readme_type, + 'author': 'Ryan Ly, Kay Robbins', + 'author_email': 'rly@lbl.gov, Kay.Robbins@utsa.edu', + 'url': 'https://github.com/hed-standard/ndx-hed', + 'license': 'BSD 3-Clause', + 'install_requires': [ + 'pynwb>=1.1.2' + ], + 'packages': find_packages('src/pynwb'), + 'package_dir': {'': 'src/pynwb'}, + 'package_data': {'ndx_hed': [ + 'spec/ndx-hed.namespace.yaml', + 'spec/ndx-hed.extensions.yaml', + ]}, + 'classifiers': [ + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + ], + 'zip_safe': False +} + + +def _copy_spec_files(project_dir): + ns_path = os.path.join(project_dir, 'spec', 'ndx-hed.namespace.yaml') + ext_path = os.path.join(project_dir, 'spec', 'ndx-hed.extensions.yaml') + + dst_dir = os.path.join(project_dir, 'src', 'pynwb', 'ndx_hed', 'spec') + if not os.path.exists(dst_dir): + os.mkdir(dst_dir) + + copy2(ns_path, dst_dir) + copy2(ext_path, dst_dir) + + +if __name__ == '__main__': + _copy_spec_files(os.path.dirname(__file__)) + setup(**setup_args) diff --git a/src/pynwb/tests/test_hed_tags.py b/src/pynwb/tests/test_hed_tags.py index 1c38c30..1dd7505 100644 --- a/src/pynwb/tests/test_hed_tags.py +++ b/src/pynwb/tests/test_hed_tags.py @@ -9,7 +9,7 @@ from pynwb import NWBHDF5IO, get_manager, NWBFile from pynwb.testing.mock.file import mock_NWBFile from pynwb.testing import TestCase, remove_test_file, NWBH5IOFlexMixin -from src.pynwb.ndx_hed import HedVersion, HedTags +from ndx_hed import HedVersion, HedTags class TestHedTagsConstructor(TestCase): diff --git a/src/pynwb/tests/test_hed_version.py b/src/pynwb/tests/test_hed_version.py index 2f750ef..35e3391 100644 --- a/src/pynwb/tests/test_hed_version.py +++ b/src/pynwb/tests/test_hed_version.py @@ -5,7 +5,7 @@ from pynwb import NWBHDF5IO, get_manager, NWBFile from pynwb.testing.mock.file import mock_NWBFile from pynwb.testing import TestCase, remove_test_file, NWBH5IOFlexMixin -from src.pynwb.ndx_hed import HedVersion +from ndx_hed import HedVersion from hed.schema import HedSchema, HedSchemaGroup, load_schema_version from hed.errors import HedFileError diff --git a/src/pynwb/tests/test_hed_version_attr.py b/src/pynwb/tests/test_hed_version_attr.py index 7fa7c54..d8c045c 100644 --- a/src/pynwb/tests/test_hed_version_attr.py +++ b/src/pynwb/tests/test_hed_version_attr.py @@ -6,7 +6,7 @@ from pynwb import NWBHDF5IO, get_manager, NWBFile from pynwb.testing.mock.file import mock_NWBFile from pynwb.testing import TestCase, remove_test_file, NWBH5IOFlexMixin -from src.pynwb.ndx_hed import HedVersionAttr +from ndx_hed import HedVersionAttr from hed.schema import HedSchema, HedSchemaGroup