-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
67 lines (57 loc) · 1.79 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
#!/usr/bin/python
# -*- encoding=utf-8 -*-
import os
import re
import sys
from setuptools import setup
if not hasattr(sys, 'version_info') or sys.version_info < (2, 7, 0, 'final'):
raise SystemExit("pycnik requires Python 2.7 or later.")
if sys.argv[-1] == 'publish':
os.system('python setup.py register sdist upload')
sys.exit()
def rst(filename):
'''
Load rst file and sanitize it for PyPI.
Remove unsupported tags:
- code-block directive
'''
content = open(filename).read()
return re.sub(r'\.\.\s? code-block::\s*(\w|\+)+', '::', content)
long_description = '\n'.join((
rst('README.rst'),
rst('CHANGELOG.rst'),
''
))
def install_requires():
"""
don't try to override mapnik installation with the pypi version
"""
req = ['lxml', 'pyproj']
return req
develop_requirements = install_requires() + ['nose>=1.0']
setup(
name='pycnik',
version=__import__('pycnik').__version__,
description="Tool for generating Mapnik's stylesheets from python code",
long_description=long_description,
url="https://github.com/Mappy/pycnik.git",
author='Ludovic Delauné',
author_email="[email protected]",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Utilities'
],
packages=['pycnik'],
install_requires=install_requires(),
extras_require={
'develop': develop_requirements,
},
entry_points=dict(console_scripts=['pycnik=pycnik:main', ]),
test_suite='nose.collector'
)