1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
#!/usr/bin/env python
from __future__ import print_function
from setuptools import setup, find_packages
from distutils.core import Command
import os
import re
import sys
import subprocess
# Generate version.py
with open('glue/version.py') as infile:
exec(infile.read())
# If the version is not stable, we can add a git hash to the __version__
if '.dev' in __version__: # noqa
# Find hash for __githash__ and dev number for __version__ (can't use hash
# as per PEP440)
command_hash = 'git rev-list --max-count=1 --abbrev-commit HEAD'
command_number = 'git rev-list --count HEAD'
try:
commit_hash = subprocess.check_output(
command_hash, shell=True).decode('ascii').strip()
commit_number = subprocess.check_output(
command_number, shell=True).decode('ascii').strip()
except Exception:
pass
else:
# We write the git hash and value so that they gets frozen if installed
with open(os.path.join('glue', '_githash.py'), 'w') as f:
f.write("__githash__ = \"{githash}\"\n".format(
githash=commit_hash))
f.write("__dev_value__ = \"{dev_value}\"\n".format(
dev_value=commit_number))
# We modify __version__ here too for commands such as egg_info
__version__ = re.sub('\.dev[^"]*', '.dev{0}'.format(commit_number),
__version__) # noqa
with open('README.rst') as infile:
LONG_DESCRIPTION = infile.read()
cmdclass = {}
# Define built-in plugins
entry_points = """
[glue.plugins]
export_d3po = glue.plugins.export_d3po:setup
export_plotly = glue.plugins.exporters.plotly.qt:setup
pv_slicer = glue.plugins.tools.pv_slicer:setup
coordinate_helpers = glue.plugins.coordinate_helpers:setup
spectral_cube = glue.plugins.data_factories.spectral_cube:setup
dendro_factory = glue.plugins.dendro_viewer:setup
dendro_viewer = glue.plugins.dendro_viewer.qt:setup
image_viewer = glue.viewers.image.qt:setup
scatter_viewer = glue.viewers.scatter.qt:setup
histogram_viewer = glue.viewers.histogram.qt:setup
profile_viewer = glue.viewers.profile.qt:setup
table_viewer = glue.viewers.table.qt:setup
data_exporters = glue.core.data_exporters:setup
fits_format = glue.io.formats.fits:setup
export_python = glue.plugins.tools:setup
[gui_scripts]
glue = glue.main:main
"""
install_requires = ['numpy>=1.9',
'pandas>=0.14',
'astropy>=2.0',
'matplotlib>=2.0',
'qtpy>=1.2',
'setuptools>=1.0',
'ipython>=4.0',
'ipykernel',
'qtconsole',
'dill>=0.2',
'xlrd>=1.0',
'h5py>=2.4',
'bottleneck>=1.2',
'mpl-scatter-density>=0.4']
# Glue can work with PyQt5 and PySide2. We first check if they are already
# installed before adding PyQt5 to install_requires, since the conda
# installation of PyQt5 is not recognized by install_requires.
try:
import PyQt5 # noqa
except ImportError:
try:
import PySide2 # noqa
except ImportError:
install_requires.append('PyQt5')
extras_require = {
'recommended': ['scipy',
'scikit-image',
'plotly'],
'astronomy': ['PyAVM',
'astrodendro',
'spectral-cube']
}
extras_require['all'] = (extras_require['recommended'] +
extras_require['astronomy'])
extras_require['test'] = ['pytest>=3.5,<3.7',
'pytest-cov',
'pytest-qt',
'pytest-faulthandler',
'objgraph',
'mock']
setup(name='glue-core',
version=__version__,
description='Multidimensional data visualzation across files',
long_description=LONG_DESCRIPTION,
author='Chris Beaumont, Thomas Robitaille',
author_email='glueviz@gmail.com',
url='http://glueviz.org',
install_requires=install_requires,
extras_require=extras_require,
classifiers=[
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Visualization',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(),
entry_points=entry_points,
cmdclass=cmdclass,
package_data={'': ['*.ui', '*.glu','*.txt', '*.csv']})
|