-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #402 from ocefpaf/setuptools
Setuptools
- Loading branch information
Showing
2 changed files
with
19 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
matplotlib>=1.0.0 | ||
numpy>=1.2.1 | ||
pyproj>=1.9.3 | ||
pyshp>=1.2.0 | ||
six |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
from __future__ import (absolute_import, division, print_function) | ||
|
||
import sys, glob, os, subprocess | ||
import glob | ||
import io | ||
import os | ||
import sys | ||
from setuptools.dist import Distribution | ||
|
||
if sys.version_info < (2, 6): | ||
raise SystemExit("""matplotlib and the basemap toolkit require Python 2.6 or later.""") | ||
|
||
from distutils.dist import Distribution | ||
from distutils.util import convert_path | ||
from distutils import ccompiler, sysconfig | ||
|
||
# Do not require numpy for just querying the package | ||
# Taken from the netcdf-python setup file (which took it from h5py setup file). | ||
inc_dirs = [] | ||
if any('--' + opt in sys.argv for opt in Distribution.display_option_names + | ||
['help-commands', 'help']) or sys.argv[1] == 'egg_info': | ||
from distutils.core import setup, Extension | ||
from setuptools import setup, Extension | ||
else: | ||
import numpy | ||
# Use numpy versions if they are available. | ||
|
@@ -23,6 +23,14 @@ | |
inc_dirs.append(numpy.get_include()) | ||
|
||
|
||
def get_install_requirements(path): | ||
path = os.path.join(os.path.dirname(__file__), path) | ||
with io.open(path, encoding='utf-8') as fp: | ||
content = fp.read() | ||
return [req for req in content.split("\n") | ||
if req != '' and not req.startswith('#')] | ||
|
||
|
||
def checkversion(GEOS_dir): | ||
"""check geos C-API header file (geos_c.h)""" | ||
try: | ||
|
@@ -106,13 +114,7 @@ def checkversion(GEOS_dir): | |
datafiles = [os.path.join('data',os.path.basename(f)) for f in datafiles] | ||
package_data = {'mpl_toolkits.basemap':datafiles} | ||
|
||
requirements = [ | ||
"numpy>=1.2.1", | ||
"matplotlib>=1.0.0", | ||
"pyproj >= 1.9.3", | ||
"pyshp >= 1.2.0", | ||
"six", | ||
] | ||
install_requires = get_install_requirements("requirements.txt") | ||
|
||
__version__ = "1.1.0" | ||
setup( | ||
|
@@ -130,7 +132,7 @@ def checkversion(GEOS_dir): | |
author_email = "[email protected]", | ||
maintainer = "Ben Root", | ||
maintainer_email = "[email protected]", | ||
install_requires = requirements, | ||
install_requires = install_requires, | ||
platforms = ["any"], | ||
license = "OSI Approved", | ||
keywords = ["python","plotting","plots","graphs","charts","GIS","mapping","map projections","maps"], | ||
|
@@ -145,6 +147,6 @@ def checkversion(GEOS_dir): | |
packages = packages, | ||
namespace_packages = namespace_packages, | ||
package_dir = package_dirs, | ||
ext_modules = extensions, | ||
ext_modules = extensions, | ||
package_data = package_data | ||
) |