diff --git a/long_description.rst b/long_description.rst new file mode 100644 index 00000000..dea85d8d --- /dev/null +++ b/long_description.rst @@ -0,0 +1,9 @@ +Group inference and reporting of neuroimaging studies require that individual's +features are spatially aligned into a common frame where their location can be +called standard. +To that end, a multiplicity of brain templates with anatomical annotations +(i.e., atlases) have been published. +However, a centralized resource that allows programmatic access to templates is +lacking. +TemplateFlow is a modular, version-controlled resource that allows researchers +to use templates "off-the-shelf" and share new ones. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..015f0d6b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools >= 30.3.0", "wheel"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 5f58922e..7c04adc9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,7 @@ -pybids>=0.9.0,<0.10.0a0 -pytest +pybids~=0.9.2 requests tqdm +pytest +pytest-xdist +pytest-cov==2.5.1 +coverage \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 5e4872b5..ffa43060 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,67 @@ +[metadata] +url = https://github.com/poldracklab/templateflow +author = The CRN developers +author_email = code@oscaresteban.es +maintainer = Oscar Esteban +maintainer_email = code@oscaresteban.es +description = TemplateFlow's Python Client - TemplateFlow is the Zone of neuroimaging templates.resonance images of the brain. +long_description = file:long_description.rst +long_description_content_type = text/x-rst; charset=UTF-8 +license = Apache-2.0 +classifiers = + Development Status :: 3 - Alpha + Intended Audience :: Science/Research + Topic :: Scientific/Engineering :: Image Recognition + License :: OSI Approved :: Apache Software License + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + +[options] +python_requires = >= 3.5 +install_requires = + pybids ~= 0.9.2 + requests + tqdm +test_requires = + pytest + pytest-xdist + pytest-cov == 2.5.1 + coverage +packages = find: +include_package_data = True + +[options.package_data] +templateflow = + conf/config.json + conf/templateflow-skel.zip + +[options.packages.find] +exclude = + *.tests + +[options.extras_require] +datalad = + datalad + +doc = + sphinx >= 1.5.3 + pydot >= 1.2.3 + pydotplus +docs = + %(doc)s +test = + pytest + pytest-xdist + pytest-cov == 2.5.1 + coverage +tests = + %(test)s +all = + %(datalad)s + %(doc)s + %(test)s + [versioneer] VCS = git style = pep440 diff --git a/setup.py b/setup.py index de35d3c1..bb5b9966 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,18 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """ templateflow setup script """ +import sys +from setuptools import setup +import versioneer from setuptools.command.install import install from setuptools.command.develop import develop +# Give setuptools a hint to complain if it's too old a version +# 30.3.0 allows us to put most metadata in setup.cfg +# Should match pyproject.toml +SETUP_REQUIRES = ['setuptools >= 30.3.0'] +# This enables setuptools to install wheel on-the-fly +SETUP_REQUIRES += ['wheel'] if 'bdist_wheel' in sys.argv else [] + def make_cmdclass(basecmd): """Decorate setuptools commands.""" @@ -29,55 +38,11 @@ class CheckHomeProdCommand(install): if __name__ == '__main__': """ Install entry-point """ - from setuptools import setup, find_packages - from versioneer import get_cmdclass, get_version - - from templateflow.__about__ import ( - __packagename__, - __author__, - __email__, - __maintainer__, - __license__, - __description__, - __longdesc__, - __url__, - DOWNLOAD_URL, - CLASSIFIERS, - REQUIRES, - SETUP_REQUIRES, - LINKS_REQUIRES, - TESTS_REQUIRES, - EXTRA_REQUIRES, - ) - setup( - name=__packagename__, - version=get_version(), - description=__description__, - long_description=__longdesc__, - author=__author__, - author_email=__email__, - maintainer=__maintainer__, - maintainer_email=__email__, - license=__license__, - url=__url__, - download_url=DOWNLOAD_URL, - classifiers=CLASSIFIERS, - packages=find_packages(exclude=['*.tests']), - zip_safe=False, - # Dependencies handling + name='templateflow', + version=versioneer.get_version(), setup_requires=SETUP_REQUIRES, - install_requires=list(set(REQUIRES)), - dependency_links=LINKS_REQUIRES, - tests_require=TESTS_REQUIRES, - extras_require=EXTRA_REQUIRES, - # Data - include_package_data=True, - package_data={__packagename__: [ - 'conf/config.json', - 'conf/templateflow-skel.zip' - ]}, - cmdclass=get_cmdclass(cmdclass={ + cmdclass=versioneer.get_cmdclass(cmdclass={ 'develop': CheckHomeDevCommand, 'install': CheckHomeProdCommand, }), diff --git a/templateflow/__about__.py b/templateflow/__about__.py index e29fa96a..e9ecab86 100644 --- a/templateflow/__about__.py +++ b/templateflow/__about__.py @@ -1,68 +1,13 @@ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: -"""\ -Group inference and reporting of neuroimaging studies require that individual's \ -features are spatially aligned into a common frame where their location can be \ -called standard. \ -To that end, a multiplicity of brain templates with anatomical annotations \ -(i.e., atlases) have been published. \ -However, a centralized resource that allows programmatic access to templates is \ -lacking. \ -TemplateFlow is a modular, version-controlled resource that allows researchers \ -to use templates "off-the-shelf" and share new ones. \ +""" +Templateflow """ from ._version import get_versions __version__ = get_versions()['version'] del get_versions __packagename__ = 'templateflow' -__author__ = 'The CRN developers' __copyright__ = 'Copyright 2019, Center for Reproducible Neuroscience, Stanford University' -__credits__ = ['Oscar Esteban'] -__license__ = '3-clause BSD' -__maintainer__ = 'Oscar Esteban' -__email__ = 'code@oscaresteban.es' -__status__ = 'Prototype' - -__description__ = """\ -TemplateFlow's Python Client - TemplateFlow is the Zone of neuroimaging templates. -""" -__longdesc__ = __doc__ -__url__ = 'https://github.com/poldracklab/{}'.format(__packagename__) - -DOWNLOAD_URL = ( - 'https://pypi.python.org/packages/source/{name[0]}/{name}/{name}-{ver}.tar.gz'.format( - name=__packagename__, ver=__version__)) -CLASSIFIERS = [ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Science/Research', - 'Topic :: Scientific/Engineering :: Image Recognition', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', -] - -REQUIRES = [ - 'pybids>=0.9.0,<0.10.0a0', - 'requests', - 'tqdm', -] - -SETUP_REQUIRES = [] -REQUIRES += SETUP_REQUIRES - -LINKS_REQUIRES = [] -TESTS_REQUIRES = [ - 'pytest', - 'pytest-xdist', -] - -EXTRA_REQUIRES = { - 'doc': [], - 'tests': TESTS_REQUIRES, - 'datalad': ['datalad'], -} - -# Enable a handle to install all extra dependencies at once -EXTRA_REQUIRES['all'] = list(EXTRA_REQUIRES.values()) +__credits__ = ['Oscar Esteban', 'Chris Markiewicz', 'Rastko Ciric', 'Yaroslav O. Halchenko', + 'Chris Gorgolewski', 'Russell Poldrack'] diff --git a/templateflow/__init__.py b/templateflow/__init__.py index 3bd3d152..a04349b0 100644 --- a/templateflow/__init__.py +++ b/templateflow/__init__.py @@ -4,25 +4,11 @@ The Zone of Templates ===================== """ -from .__about__ import ( - __version__, __packagename__, __author__, __copyright__, - __credits__, __license__, __maintainer__, __email__, __status__, - __description__, __longdesc__) +from .__about__ import __version__, __packagename__, __copyright__, __credits__ __all__ = [ '__version__', '__packagename__', - '__author__', '__copyright__', '__credits__', - '__license__', - '__maintainer__', - '__email__', - '__status__', - '__description__', - '__longdesc__', ] - -from ._version import get_versions -__version__ = get_versions()['version'] -del get_versions