diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..931b51be --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include CHANGELOG.* CONTRIBUTORS.* LICENSE tox.ini +graft nidm +graft docs +graft test +global-exclude *.py[cod] diff --git a/README.rst b/README.rst index 1214d91d..0d80bda3 100644 --- a/README.rst +++ b/README.rst @@ -16,11 +16,6 @@ Dependencies * `Graphviz `_ (native package): * Fedora: `dnf install graphviz` * OS-X: `brew install graphviz` -* Datalad (optional): `pip install datalad` -* Sklearn: `pip install scikit-learn` -* Statsmodels: `pip install statsmodels` -* Statistics: `pip install statistics` -* Patsy: `pip install patsy` Installation ============ diff --git a/bin/README.md b/bin/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/bin/bidsmri2nidm b/bin/bidsmri2nidm deleted file mode 100755 index c8b60574..00000000 --- a/bin/bidsmri2nidm +++ /dev/null @@ -1,7 +0,0 @@ -#!python - -import sys -from nidm.experiment.tools.bidsmri2nidm import main - -if __name__ == "__main__": - main(sys.argv) diff --git a/bin/csv2nidm b/bin/csv2nidm deleted file mode 100644 index ffa07355..00000000 --- a/bin/csv2nidm +++ /dev/null @@ -1,7 +0,0 @@ -#!python - -import sys -from nidm.experiment.tools.csv2nidm import main - -if __name__ == "__main__": - main(sys.argv) diff --git a/bin/nidm_query b/bin/nidm_query deleted file mode 100644 index 7c1dbb60..00000000 --- a/bin/nidm_query +++ /dev/null @@ -1,7 +0,0 @@ -#!python - -import sys -from nidm.experiment.tools.nidm_query import main - -if __name__ == "__main__": - main(sys.argv) diff --git a/bin/nidm_utils b/bin/nidm_utils deleted file mode 100755 index b172a3a1..00000000 --- a/bin/nidm_utils +++ /dev/null @@ -1,7 +0,0 @@ -#!python - -import sys -from nidm.experiment.tools.nidm_utils import main - -if __name__ == "__main__": - main(sys.argv) diff --git a/nidm/__init__.py b/nidm/__init__.py index 80160f46..b27124af 100644 --- a/nidm/__init__.py +++ b/nidm/__init__.py @@ -1,7 +1,8 @@ from __future__ import absolute_import, division, print_function -from .version import __version__ import __main__ +__version__ = "3.9.7" + try: import etelemetry etelemetry.check_available_version("incf-nidash/pynidm", __version__) diff --git a/nidm/experiment/tools/bidsmri2nidm.py b/nidm/experiment/tools/bidsmri2nidm.py index deb0e29a..8ba5f35c 100755 --- a/nidm/experiment/tools/bidsmri2nidm.py +++ b/nidm/experiment/tools/bidsmri2nidm.py @@ -79,7 +79,7 @@ def getsha512(filename): return sha512_hash.hexdigest() -def main(argv): +def main(): parser = ArgumentParser(description= """This program will represent a BIDS MRI dataset as a NIDM RDF document and provide user with opportunity to annotate the dataset (i.e. create sidecar files) and associate selected variables with broader concepts to make datasets more @@ -896,4 +896,4 @@ def bidsmri2project(directory, args): if __name__ == "__main__": - main(sys.argv[1:]) + main() diff --git a/nidm/experiment/tools/csv2nidm.py b/nidm/experiment/tools/csv2nidm.py index bcc305b5..a4eb76f4 100644 --- a/nidm/experiment/tools/csv2nidm.py +++ b/nidm/experiment/tools/csv2nidm.py @@ -73,7 +73,7 @@ -def main(argv): +def main(): parser = ArgumentParser(description='This program will load in a CSV file and iterate over the header \ variable names performing an elastic search of https://scicrunch.org/ for NIDM-ReproNim \ tagged terms that fuzzy match the variable names. The user will then interactively pick \ @@ -387,4 +387,4 @@ def main(argv): if __name__ == "__main__": - main(sys.argv[1:]) + main() diff --git a/nidm/experiment/tools/nidm_utils.py b/nidm/experiment/tools/nidm_utils.py index f00dfb3a..1f06dde0 100644 --- a/nidm/experiment/tools/nidm_utils.py +++ b/nidm/experiment/tools/nidm_utils.py @@ -41,7 +41,7 @@ from graphviz import Source import tempfile -def main(argv): +def main(): parser = ArgumentParser(description='This program contains various NIDM-Experiment utilities') sub = parser.add_subparsers(dest='command') @@ -120,4 +120,4 @@ def main(argv): if __name__ == "__main__": - main(sys.argv[1:]) + main() diff --git a/nidm/version.py b/nidm/version.py deleted file mode 100644 index 07c8433c..00000000 --- a/nidm/version.py +++ /dev/null @@ -1,63 +0,0 @@ -from __future__ import absolute_import, division, print_function -import os.path - -# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" -_version_major = 3 -_version_minor = 9 -_version_micro = '7' # use '' for first of series, number for 1 and above -_version_extra = '' -# _version_extra = '' # Uncomment this for full releases - -# Construct full version string from these. -_ver = [_version_major, _version_minor] -if _version_micro: - _ver.append(_version_micro) -if _version_extra: - _ver.append(_version_extra) - -__version__ = '.'.join(map(str, _ver)) - -CLASSIFIERS = ["Development Status :: 3 - Alpha", - "Environment :: Console", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: Apache Software License", - "Operating System :: MacOS :: MacOS X", - "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3", - "Topic :: Scientific/Engineering"] - -# Description should be a one-liner: -# TODO -description = "PYNIDM: a Python NIDM library and tools" -# Long description will go up on the pypi page -long_description = """ -NIDM -======== -A Python library to manipulate the [Neuroimaging Data Model](http://nidm.nidash.org). -License -======= -``pynidm`` is licensed under the terms of the Apache License 2.0. See the file -"LICENSE" for information on the history of this software, terms & conditions -for usage, and a DISCLAIMER OF ALL WARRANTIES. -""" - -NAME = "pynidm" -MAINTAINER = "INCF-NIDASH developers" -MAINTAINER_EMAIL = "incf-nidash-nidm@googlegroups.com" -DESCRIPTION = description -LONG_DESCRIPTION = long_description -URL = "https://github.com/incf-nidash/PyNIDM" -DOWNLOAD_URL = "" -LICENSE = "Apache License 2.0" -AUTHOR = "INCF-NIDASH developers" -AUTHOR_EMAIL = "incf-nidash-nidm@googlegroups.com" -MAJOR = _version_major -MINOR = _version_minor -MICRO = _version_micro -VERSION = __version__ -INSTALL_REQUIRES = ["prov", "graphviz", "pydotplus", "pydot", "validators", "requests", "rapidfuzz", "pygithub", - "pandas", "pybids>=0.12.4", "duecredit", "pytest", "graphviz", "click", "rdflib-jsonld", - "pyld==1.0.5", "rdflib", "datalad", "ontquery==0.2.3", "orthauth>=0.0.12","tabulate", "joblib", - "cognitiveatlas", "numpy>=1.16.5", "etelemetry", "click-option-group", "patsy", "simplejson", - "scikit-learn","statsmodels","statistics"] -SCRIPTS = ["bin/nidm_query", "bin/bidsmri2nidm", "bin/csv2nidm","bin/nidm_utils"] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..b3491a3a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools >= 46.4.0"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..8d96864a --- /dev/null +++ b/setup.cfg @@ -0,0 +1,71 @@ +[metadata] +name = pynidm +version = attr:nidm.__version__ +description = PYNIDM: a Python NIDM library and tools +long_description = file:README.rst +long_description_content_type = text/x-rst +author = INCF-NIDASH developers +author_email = incf-nidash-nidm@googlegroups.com +maintainer = INCF-NIDASH developers +maintainer_email = incf-nidash-nidm@googlegroups.com +license = Apache-2.0 +license_files = LICENSE +url = https://github.com/incf-nidash/PyNIDM + +classifiers = + Development Status :: 3 - Alpha + Environment :: Console + Intended Audience :: Science/Research + License :: OSI Approved :: Apache Software License + Operating System :: MacOS :: MacOS X + Operating System :: POSIX :: Linux + Programming Language :: Python :: 3 + Topic :: Scientific/Engineering + +[options] +packages = find_namespace: +include_package_data = True +python_requires = >=3.8 +install_requires = + click + click-option-group + cognitiveatlas + datalad + duecredit + etelemetry + graphviz + joblib + numpy >= 1.16.5 + ontquery ~= 0.2.3 + orthauth >= 0.0.12 + pandas + patsy + prov + pybids >= 0.12.4 + pydot + pydotplus + pygithub + pyld >= 1.0.5, <2.0 + pytest + rapidfuzz + rdflib + rdflib-jsonld + requests + scikit-learn + simplejson + statsmodels + tabulate + validators + +[options.packages.find] +include = + nidm + nidm.* + +[options.entry_points] +console_scripts = + bidsmri2nidm = nidm.experiment.tools.bidsmri2nidm:main + csv2nidm = nidm.experiment.tools.csv2nidm:main + nidm_query = nidm.experiment.tools.nidm_query:query + nidm_utils = nidm.experiment.tools.nidm_utils:main + pynidm = nidm.experiment.tools.click_main:cli diff --git a/setup.py b/setup.py deleted file mode 100644 index db0548ac..00000000 --- a/setup.py +++ /dev/null @@ -1,35 +0,0 @@ -import os -from setuptools import setup, find_packages -PACKAGES = find_packages() - -# Get version and release info, which is all stored in nidm/version.py -ver_file = os.path.join('nidm', 'version.py') -with open(ver_file) as f: - exec(f.read()) - -opts = dict(name=NAME, - maintainer=MAINTAINER, - maintainer_email=MAINTAINER_EMAIL, - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - url=URL, - download_url=DOWNLOAD_URL, - license=LICENSE, - classifiers=CLASSIFIERS, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - version=VERSION, - packages=PACKAGES, - scripts=SCRIPTS, - install_requires=INSTALL_REQUIRES, - #requires=INSTALL_REQUIRES, - entry_points=''' - [console_scripts] - pynidm=nidm.experiment.tools.click_main:cli - ''' -) - - - -if __name__ == '__main__': - setup(**opts)