Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make basemap work with mpl 1.4 egg directory as generated by setuptools #116

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 1 commit into from
Jul 9, 2013
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
5 changes: 5 additions & 0 deletions lib/mpl_toolkits/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
pass # must not have setuptools

10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ def checkversion(GEOS_dir):
deps.remove(os.path.join('src','_geoslib.c'))

packages = ['mpl_toolkits','mpl_toolkits.basemap']
namespace_packages = ['mpl_toolkits']
package_dirs = {'':'lib'}
extensions = [Extension("mpl_toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)]
# can't install _geoslib in mpl_toolkits.basemap namespace,
# or Basemap objects won't be pickleable.
if sys.platform == 'win32':
if sys.platform == 'win32':
# don't use runtime_library_dirs on windows (workaround
# for a distutils bug - http://bugs.python.org/issue2437).
#extensions.append(Extension("mpl_toolkits.basemap._geoslib",['src/_geoslib.c'],
Expand All @@ -91,7 +92,7 @@ def checkversion(GEOS_dir):
if sys.argv[1] not in ['sdist','clean']:
cc = ccompiler.new_compiler()
sysconfig.get_config_vars()
sysconfig.customize_compiler(cc)
sysconfig.customize_compiler(cc)
cc.set_include_dirs(['src'])
objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
execname = 'nad2bin'
Expand Down Expand Up @@ -125,14 +126,15 @@ def checkversion(GEOS_dir):
license = "OSI Approved",
keywords = ["python","plotting","plots","graphs","charts","GIS","mapping","map projections","maps"],
classifiers = ["Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved",
"Intended Audience :: Science/Research",
"License :: OSI Approved",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent"],
packages = packages,
namespace_packages = namespace_packages,
package_dir = package_dirs,
ext_modules = extensions,
cmdclass = {'build_py': build_py},
Expand Down