Skip to content

Commit

Permalink
MAINT: Switch to a setup.cfg-style of installation
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Jul 12, 2019
1 parent d3eba12 commit 33035a0
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 124 deletions.
9 changes: 9 additions & 0 deletions long_description.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools >= 30.3.0", "wheel"]
7 changes: 5 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
64 changes: 64 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down
61 changes: 13 additions & 48 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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."""
Expand All @@ -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,
}),
Expand Down
63 changes: 4 additions & 59 deletions templateflow/__about__.py
Original file line number Diff line number Diff line change
@@ -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']
16 changes: 1 addition & 15 deletions templateflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 33035a0

Please sign in to comment.