mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-28 02:47:01 +08:00
b6aa358439
- cython added to setup_requirements - setuptools will call easy_install to install it - all other build requirements, excluding numpy, will be resolved by pip - do not parse requirements.txt - requirements should be the real runtime requirements - fail gracefully when missing numpy - scipy will be resolved by pip from install_requires
116 lines
3.6 KiB
Python
116 lines
3.6 KiB
Python
#! /usr/bin/env python
|
|
|
|
descr = """Image Processing SciKit
|
|
|
|
Image processing algorithms for SciPy, including IO, morphology, filtering,
|
|
warping, color manipulation, object detection, etc.
|
|
|
|
Please refer to the online documentation at
|
|
http://scikit-image.org/
|
|
"""
|
|
|
|
DISTNAME = 'scikit-image'
|
|
DESCRIPTION = 'Image processing routines for SciPy'
|
|
LONG_DESCRIPTION = descr
|
|
MAINTAINER = 'Stefan van der Walt'
|
|
MAINTAINER_EMAIL = 'stefan@sun.ac.za'
|
|
URL = 'http://scikit-image.org'
|
|
LICENSE = 'Modified BSD'
|
|
DOWNLOAD_URL = 'http://github.com/scikit-image/scikit-image'
|
|
|
|
import os
|
|
import sys
|
|
|
|
import setuptools
|
|
from distutils.command.build_py import build_py
|
|
|
|
|
|
with open('skimage/__init__.py') as fid:
|
|
for line in fid:
|
|
if line.startswith('__version__'):
|
|
VERSION = line.strip().split()[-1][1:-1]
|
|
break
|
|
|
|
with open('requirements.txt') as fid:
|
|
INSTALL_REQUIRES = [l.strip() for l in fid.readlines() if l]
|
|
|
|
# requirements for those browsing PyPI
|
|
REQUIRES = [r.replace('>=', ' (>= ') + ')' for r in INSTALL_REQUIRES]
|
|
REQUIRES = [r.replace('==', ' (== ') for r in REQUIRES]
|
|
REQUIRES = [r.replace('[array]', '') for r in REQUIRES]
|
|
|
|
|
|
def configuration(parent_package='', top_path=None):
|
|
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
|
|
|
|
from numpy.distutils.misc_util import Configuration
|
|
config = Configuration(None, parent_package, top_path)
|
|
|
|
config.set_options(
|
|
ignore_setup_xxx_py=True,
|
|
assume_default_configuration=True,
|
|
delegate_options_to_subpackages=True,
|
|
quiet=True)
|
|
|
|
config.add_subpackage('skimage')
|
|
config.add_data_dir('skimage/data')
|
|
|
|
return config
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# purposely fail if numpy is not available
|
|
# other dependecies will be resolved by pip (install_requires)
|
|
try:
|
|
from numpy.distutils.core import setup
|
|
except ImportError:
|
|
print('To install scikit-image from source, you will need numpy.\n' +
|
|
'Install numpy with pip:\n' +
|
|
'pip install numpy\n'
|
|
'Or use your operating system package manager. For more\n' +
|
|
'details, see http://scikit-image.org/docs/stable/install.html')
|
|
sys.exit(1)
|
|
|
|
setup(
|
|
name=DISTNAME,
|
|
description=DESCRIPTION,
|
|
long_description=LONG_DESCRIPTION,
|
|
maintainer=MAINTAINER,
|
|
maintainer_email=MAINTAINER_EMAIL,
|
|
url=URL,
|
|
license=LICENSE,
|
|
download_url=DOWNLOAD_URL,
|
|
version=VERSION,
|
|
|
|
classifiers=[
|
|
'Development Status :: 4 - Beta',
|
|
'Environment :: Console',
|
|
'Intended Audience :: Developers',
|
|
'Intended Audience :: Science/Research',
|
|
'License :: OSI Approved :: BSD License',
|
|
'Programming Language :: C',
|
|
'Programming Language :: Python',
|
|
'Programming Language :: Python :: 3',
|
|
'Topic :: Scientific/Engineering',
|
|
'Operating System :: Microsoft :: Windows',
|
|
'Operating System :: POSIX',
|
|
'Operating System :: Unix',
|
|
'Operating System :: MacOS',
|
|
],
|
|
|
|
configuration=configuration,
|
|
install_requires=INSTALL_REQUIRES,
|
|
# install cython when running setup.py (source install)
|
|
setup_requires=['cython>=0.21'],
|
|
requires=REQUIRES,
|
|
packages=setuptools.find_packages(exclude=['doc']),
|
|
include_package_data=True,
|
|
zip_safe=False, # the package can run out of an .egg file
|
|
|
|
entry_points={
|
|
'console_scripts': ['skivi = skimage.scripts.skivi:main'],
|
|
},
|
|
|
|
cmdclass={'build_py': build_py},
|
|
)
|