forked from mysociety/mapit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
71 lines (61 loc) · 2.13 KB
/
setup.py
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
from setuptools import setup, find_packages
from functools import reduce
import os
import sys
file_dir = os.path.abspath(os.path.dirname(__file__))
static_dir = os.path.join(file_dir, 'mapit', 'static', 'mapit')
sass_dir = os.path.join(static_dir, 'sass')
sass_mtime = reduce(max, (os.stat(os.path.join(root, f)).st_mtime
for root, dirs, files in os.walk(sass_dir)
for f in files))
css_file = os.path.join(static_dir, 'css', 'mapit.css')
try:
css_mtime = os.stat(css_file).st_mtime
except OSError:
css_mtime = 0
packaging = False
for arg in sys.argv:
if arg == 'sdist' or 'bdist' in arg:
packaging = True
break
if css_mtime < sass_mtime and packaging:
raise Exception("Make sure the CSS is up-to-date and compiled before packaging.")
def read_file(filename):
filepath = os.path.join(file_dir, filename)
return open(filepath).read()
setup(
name='django-mapit',
version='1.3.1.post1',
description=(
'A web service for mapping postcodes and points to current or past '
'administrative area information and polygons.'),
long_description=read_file('README.rst'),
author='mySociety',
author_email='[email protected]',
url='https://github.com/mysociety/mapit',
license='LICENSE.txt',
packages=find_packages(exclude=['project']),
scripts=['bin/mapit_make_css'],
include_package_data=True,
install_requires=[
'Django >= 1.4.18',
'South == 1.0.2',
'psycopg2',
'PyYAML',
'Shapely',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Database :: Front-Ends',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Scientific/Engineering :: GIS',
],
zip_safe=False, # So that easy_install doesn't make an egg
)