Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 82 lines (69 sloc) 2.731 kb
d7ac8ed Added colorbrewername and invertgradient options to classification metho...
David Zwarg authored
1 #!/usr/bin/python
c64b131 Restructured tests, added setup, requirements, and license.
David Zwarg authored
2 """
3 Setup script for django-sld.
4
5 License
6 =======
d7ac8ed Added colorbrewername and invertgradient options to classification metho...
David Zwarg authored
7 Copyright 2011-2012 David Zwarg <dzwarg@azavea.com>
c64b131 Restructured tests, added setup, requirements, and license.
David Zwarg authored
8
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
12
13 http://www.apache.org/licenses/LICENSE-2.0
14
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20 """
21
22 import os, sys
23 from setuptools import setup, Command
24
25 def read(fname):
26 return open(os.path.join(os.path.dirname(__file__), fname)).read()
27
28 class RunTests(Command):
29 description = "Run the django test suite."
30 user_options = []
31 extra_env = {}
32 extra_args = []
33
34 def run(self):
35 for env_name, env_value in self.extra_env.items():
36 os.environ[env_name] = str(env_value)
37
38 this_dir = os.getcwd()
dc5fdd7 Restructured tests to run from setup.py.
David Zwarg authored
39 sys.path.append(this_dir)
40 testproj_dir = os.path.join(this_dir, "djsld/tests")
c64b131 Restructured tests, added setup, requirements, and license.
David Zwarg authored
41 os.chdir(testproj_dir)
42 sys.path.append(testproj_dir)
43 from django.core.management import execute_manager
44 os.environ["DJANGO_SETTINGS_MODULE"] = os.environ.get(
45 "DJANGO_SETTINGS_MODULE", "settings")
46 settings_file = os.environ["DJANGO_SETTINGS_MODULE"]
47 settings_mod = __import__(settings_file, {}, {}, [''])
48 prev_argv = list(sys.argv)
49 try:
5ecc992 Added line & polygon tests for geographic models.
David Zwarg authored
50 sys.argv = [__file__, "test", "djsld-test"] + self.extra_args
c64b131 Restructured tests, added setup, requirements, and license.
David Zwarg authored
51 execute_manager(settings_mod, argv=sys.argv)
52 finally:
53 sys.argv = prev_argv
54
55 def initialize_options(self):
56 pass
57
58 def finalize_options(self):
59 pass
60
61 setup(
62 name = "django-sld",
20d0e1a Added shortcut for 1 class (bypass classification).
David Zwarg authored
63 version = "1.0.7",
c64b131 Restructured tests, added setup, requirements, and license.
David Zwarg authored
64 author = "David Zwarg",
65 author_email = "dzwarg@azavea.com",
66 description = ("A simple django library that generates SLD documents from geographic models."),
67 license = "Apache 2.0",
68 keywords = "ogc sld geo geoserver mapserver osgeo geodjango",
fc37326 Updates to repo location, bumped up version number.
David Zwarg authored
69 url = "http://github.com/azavea/django-sld/",
d7ac8ed Added colorbrewername and invertgradient options to classification metho...
David Zwarg authored
70 requires = ["python_sld", "pysal", "scipy", "numpy", "colorbrewer"],
01559a9 Upped version, added more information to README.
David Zwarg authored
71 packages = ["djsld","djsld.tests","djsld.tests.djsld-test"],
2c66500 Added MANIFEST.in and changed setup.py to look back at README.markdown.
David Zwarg authored
72 long_description = read('README.markdown'),
c64b131 Restructured tests, added setup, requirements, and license.
David Zwarg authored
73 cmdclass={'test': RunTests},
74 classifiers=[
d7ac8ed Added colorbrewername and invertgradient options to classification metho...
David Zwarg authored
75 "Development Status :: 5 - Production/Stable",
c64b131 Restructured tests, added setup, requirements, and license.
David Zwarg authored
76 "Intended Audience :: Developers",
77 "License :: OSI Approved :: Apache Software License",
78 "Programming Language :: Python",
79 "Topic :: Scientific/Engineering :: GIS"
80 ]
81 )
Something went wrong with that request. Please try again.