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
|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa: E122
"""basemap_data -- Data assets for matplotlib basemap."""
import io
import os
import itertools
from setuptools import setup
from setuptools import find_namespace_packages
def get_content(name, splitlines=False):
"""Return the file contents with project root as root folder."""
here = os.path.abspath(os.path.dirname(__file__))
path = os.path.join(here, name)
with io.open(path, "r", encoding="utf-8") as fd:
content = fd.read()
if splitlines:
content = [row for row in content.splitlines() if row]
return content
# Define some helper lists.
basenames = [
"countries",
"countriesmeta",
"gshhs",
"gshhsmeta",
"rivers",
"riversmeta",
"states",
"statesmeta"
]
resolutions = [
"c",
"l",
"i",
"h",
"f",
]
grids = [
"1.25",
"2.5",
"5",
"10",
]
# Define data assets.
data_dat_files = [
"%s_%s.dat" % (basename, res)
for basename, res in itertools.product(basenames, resolutions[:3])
]
data_bin_files = [
"lsmask_%smin_%s.bin" % (grid, res)
for grid, res in itertools.product(grids, resolutions)
]
data_usc_files = [
"UScounties.%s" % ext
for ext in ("dbf", "prj", "shp", "shx")
]
data_other_files = [
"epsg",
"bmng.jpg",
"etopo1.jpg",
"shadedrelief.jpg",
]
data_files = data_dat_files + data_bin_files + data_usc_files + data_other_files
setup(**{
"name":
"basemap_data",
"version":
"2.0.0",
"description":
"Data assets for matplotlib basemap",
"long_description":
get_content("README.md"),
"long_description_content_type":
"text/markdown",
"author":
"Jeff Whitaker",
"author_email":
"jeffrey.s.whitaker@noaa.gov",
"maintainer":
"The Matplotlib development team",
"maintainer_email":
"matplotlib-users@python.org",
"license":
"LGPL-3.0-or-later",
"license_files": [
"COPYING",
"COPYING.LESSER",
"LICENSE.epsg",
"LICENSE.mit",
],
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: Libraries :: Python Modules",
],
"keywords": [
"GIS",
"maps",
"plots",
],
"package_dir":
{"": "src"},
"packages":
find_namespace_packages(where="src"),
"package_data": {
"mpl_toolkits.basemap_data":
data_files,
},
"python_requires":
", ".join([
">=3.9",
"<4",
]),
"project_urls": {
"Homepage":
"https://github.com/matplotlib/basemap",
"Documentation":
"https://matplotlib.org/basemap",
"Repository":
"https://github.com/matplotlib/basemap.git",
"Issues":
"https://github.com/matplotlib/basemap/issues",
},
})
|