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
|
""" A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from __future__ import absolute_import, division, print_function # unicode_literals
import os
import sys
# To use a consistent encoding
from codecs import open
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# ---------------------------------------------------------------------------
# Some helper stuff
# ---------------------------------------------------------------------------
here = os.path.abspath(os.path.dirname(__file__))
def is_windows():
""" Check if the current OS is Windows """
return (sys.platform == 'win32') or (os.name is "nt")
def txt_read(*paths):
""" Build a file path from *paths* and return the textual contents """
with open(os.path.join(here, *paths), encoding='utf-8') as f:
return f.read()
# ---------------------------------------------------------------------------
# Populate dictionary with settings
# ---------------------------------------------------------------------------
# Create a dict with the basic information that is passed to setup after keys are added.
setup_args = dict()
setup_args['name'] = 'hydroffice.bag'
setup_args['version'] = '0.2.15'
setup_args['url'] = 'https://bitbucket.org/gmasetti/hyo_bag/'
setup_args['license'] = 'LGPLv3 license'
setup_args['author'] = 'Giuseppe Masetti (CCOM,UNH); Brian R. Calder (CCOM,UNH)'
setup_args['author_email'] = 'gmasetti@ccom.unh.edu, brc@ccom.unh.edu'
#
# descriptive stuff
#
description = 'A package to manage Bathymetric Attributed Grid (BAG) data files.'
setup_args['description'] = description
setup_args['long_description'] = (txt_read('README.rst') + '\n\n\"\"\"\"\"\"\"\n\n' +
txt_read('HISTORY.rst') + '\n\n\"\"\"\"\"\"\"\n\n' +
txt_read('AUTHORS.rst') + '\n\n\"\"\"\"\"\"\"\n\n' +
txt_read(os.path.join('docs', 'how_to_contribute.rst')) +
'\n\n\"\"\"\"\"\"\"\n\n' + txt_read(os.path.join('docs', 'banner.rst')))
setup_args['classifiers'] = \
[ # https://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Scientific/Engineering :: GIS',
'Topic :: Office/Business :: Office Suites',
]
setup_args['keywords'] = "hydrography ocean mapping survey bag openns"
#
# code stuff
#
# requirements
setup_args['setup_requires'] =\
[
"setuptools",
"wheel",
]
setup_args['install_requires'] =\
[
"lxml",
"numpy",
"gdal", # <2.0 or >=2.1 for freezing
]
if not is_windows():
setup_args['install_requires'].append("h5py") # since there are issues in building it from pypi on Win
# hydroffice namespace, packages and other files
setup_args['namespace_packages'] = ['hydroffice']
setup_args['packages'] = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests", "*.test*",
])
setup_args['package_data'] =\
{
'': ['media/*.png', 'media/*.ico', 'media/*.icns', 'media/*.txt',],
'hydroffice.bag': [
'iso19139/bag/*',
'iso19139/gco/*',
'iso19139/gmd/*',
'iso19139/gmi/*',
'iso19139/gml/*.xsd',
'iso19139/gml/*.txt',
'iso19139/gml/3.1.1/smil/*',
'iso19139/gsr/*',
'iso19139/gss/*',
'iso19139/gts/*',
'iso19139/xlink/*',
'iso19757-3/*',
'samples/*',
],
}
setup_args['test_suite'] = "tests"
setup_args['entry_points'] =\
{
'console_scripts': ['bag_bbox = hydroffice.bag.tools.bag_bbox:main',
'bag_elevation = hydroffice.bag.tools.bag_elevation:main',
'bag_metadata = hydroffice.bag.tools.bag_metadata:main',
'bag_tracklist = hydroffice.bag.tools.bag_tracklist:main',
'bag_uncertainty = hydroffice.bag.tools.bag_uncertainty:main',
'bag_validate = hydroffice.bag.tools.bag_validate:main'],
}
# ---------------------------------------------------------------------------
# Do the actual setup now
# ---------------------------------------------------------------------------
setup(**setup_args)
|