Skip to content

Commit

Permalink
Merge pull request #7 from VisLab/main
Browse files Browse the repository at this point in the history
Added setup to allow unit tests to run on github
  • Loading branch information
VisLab authored Jan 21, 2024
2 parents 3c5d79f + 3b9cb03 commit 43113e3
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 3 deletions.
20 changes: 20 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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
64 changes: 64 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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': '[email protected], [email protected]',
'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)
2 changes: 1 addition & 1 deletion src/pynwb/tests/test_hed_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/pynwb/tests/test_hed_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/pynwb/tests/test_hed_version_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 43113e3

Please sign in to comment.