Skip to content

Commit 03811c6

Browse files
committed
Basic infrastructure
1 parent 51bd8f5 commit 03811c6

File tree

12 files changed

+2578
-0
lines changed

12 files changed

+2578
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
templateflow/_version.py export-subst

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Version 0.0.1
2+
=============
3+
4+
* First functional release

MANIFEST.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# data
2+
3+
# misc
4+
include requirements.txt
5+
include CHANGES.rst
6+
include LICENSE
7+
include versioneer.py
8+
include templateflow/_version.py

get_version.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python
2+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3+
# vi: set ft=python sts=4 ts=4 sw=4 et:
4+
import sys
5+
import os.path as op
6+
7+
8+
def main():
9+
sys.path.insert(0, op.abspath('.'))
10+
from templateflow.__about__ import __version__
11+
print(__version__)
12+
13+
14+
if __name__ == '__main__':
15+
main()

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[versioneer]
2+
VCS = git
3+
style = pep440
4+
versionfile_source = templateflow/_version.py
5+
versionfile_build = templateflow/_version.py
6+
tag_prefix =
7+
parentdir_prefix =

setup.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
""" templateflow setup script """
4+
5+
6+
def main():
7+
""" Install entry-point """
8+
from os import path as op
9+
from inspect import getfile, currentframe
10+
from setuptools import setup, find_packages
11+
from templateflow.__about__ import (
12+
__packagename__,
13+
__author__,
14+
__email__,
15+
__maintainer__,
16+
__license__,
17+
__description__,
18+
__longdesc__,
19+
__url__,
20+
DOWNLOAD_URL,
21+
CLASSIFIERS,
22+
REQUIRES,
23+
SETUP_REQUIRES,
24+
LINKS_REQUIRES,
25+
TESTS_REQUIRES,
26+
EXTRA_REQUIRES,
27+
)
28+
29+
pkg_data = {'templateflow': []}
30+
31+
root_dir = op.dirname(op.abspath(getfile(currentframe())))
32+
version = None
33+
cmdclass = {}
34+
if op.isfile(op.join(root_dir, __packagename__, 'VERSION')):
35+
with open(op.join(root_dir, __packagename__, 'VERSION')) as vfile:
36+
version = vfile.readline().strip()
37+
pkg_data[__packagename__].insert(0, 'VERSION')
38+
39+
if version is None:
40+
import versioneer
41+
version = versioneer.get_version()
42+
cmdclass = versioneer.get_cmdclass()
43+
44+
setup(
45+
name=__packagename__,
46+
version=version,
47+
description=__description__,
48+
long_description=__longdesc__,
49+
author=__author__,
50+
author_email=__email__,
51+
maintainer=__maintainer__,
52+
maintainer_email=__email__,
53+
license=__license__,
54+
url=__url__,
55+
download_url=DOWNLOAD_URL,
56+
classifiers=CLASSIFIERS,
57+
packages=find_packages(exclude=['*.tests']),
58+
zip_safe=False,
59+
# Dependencies handling
60+
setup_requires=SETUP_REQUIRES,
61+
install_requires=list(set(REQUIRES)),
62+
dependency_links=LINKS_REQUIRES,
63+
tests_require=TESTS_REQUIRES,
64+
extras_require=EXTRA_REQUIRES,
65+
# Data
66+
package_data=pkg_data,
67+
include_package_data=True,
68+
cmdclass=cmdclass,
69+
)
70+
71+
72+
if __name__ == '__main__':
73+
main()

templateflow/__about__.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2+
# vi: set ft=python sts=4 ts=4 sw=4 et:
3+
"""\
4+
Group inference and reporting of neuroimaging studies require that individual's \
5+
features are spatially aligned into a common frame where their location can be \
6+
called standard. \
7+
To that end, a multiplicity of brain templates with anatomical annotations \
8+
(i.e., atlases) have been published. \
9+
However, a centralized resource that allows programmatic access to templates is \
10+
lacking. \
11+
TemplateFlow is a modular, version-controlled resource that allows researchers \
12+
to use templates "off-the-shelf" and share new ones. \
13+
"""
14+
from ._version import get_versions
15+
__version__ = get_versions()['version']
16+
del get_versions
17+
18+
__packagename__ = 'templateflow'
19+
__author__ = 'The CRN developers'
20+
__copyright__ = 'Copyright 2019, Center for Reproducible Neuroscience, Stanford University'
21+
__credits__ = ['Oscar Esteban']
22+
__license__ = '3-clause BSD'
23+
__maintainer__ = 'Oscar Esteban'
24+
__email__ = '[email protected]'
25+
__status__ = 'Prototype'
26+
27+
__description__ = """\
28+
TemplateFlow's Python Client - TemplateFlow is the Zone of neuroimaging templates.
29+
"""
30+
__longdesc__ = __doc__
31+
__url__ = 'https://github.com/poldracklab/{}'.format(__packagename__)
32+
33+
DOWNLOAD_URL = (
34+
'https://pypi.python.org/packages/source/{name[0]}/{name}/{name}-{ver}.tar.gz'.format(
35+
name=__packagename__, ver=__version__))
36+
CLASSIFIERS = [
37+
'Development Status :: 3 - Alpha',
38+
'Intended Audience :: Science/Research',
39+
'Topic :: Scientific/Engineering :: Image Recognition',
40+
'License :: OSI Approved :: Apache Software License',
41+
'Programming Language :: Python :: 3.5',
42+
'Programming Language :: Python :: 3.6',
43+
'Programming Language :: Python :: 3.7',
44+
]
45+
46+
REQUIRES = [
47+
'datalad',
48+
]
49+
50+
SETUP_REQUIRES = []
51+
REQUIRES += SETUP_REQUIRES
52+
53+
LINKS_REQUIRES = []
54+
TESTS_REQUIRES = [
55+
'pytest',
56+
'pytest-xdist',
57+
]
58+
59+
EXTRA_REQUIRES = {
60+
'doc': [],
61+
'tests': TESTS_REQUIRES,
62+
}
63+
64+
# Enable a handle to install all extra dependencies at once
65+
EXTRA_REQUIRES['all'] = list(EXTRA_REQUIRES.values())

templateflow/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2+
# vi: set ft=python sts=4 ts=4 sw=4 et:
3+
"""
4+
The Zone of Templates
5+
=====================
6+
"""
7+
from .__about__ import (
8+
__version__, __packagename__, __author__, __copyright__,
9+
__credits__, __license__, __maintainer__, __email__, __status__,
10+
__description__, __longdesc__)
11+
12+
__all__ = [
13+
'__version__',
14+
'__packagename__',
15+
'__author__',
16+
'__copyright__',
17+
'__credits__',
18+
'__license__',
19+
'__maintainer__',
20+
'__email__',
21+
'__status__',
22+
'__description__',
23+
'__longdesc__',
24+
]

0 commit comments

Comments
 (0)