Skip to content

Setuptools #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements.txt
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
32 changes: 17 additions & 15 deletions setup.py
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.
Expand All @@ -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:
Expand Down Expand Up @@ -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(
Expand All @@ -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"],
Expand All @@ -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
)