forked from eudicots/Cactus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
74 lines (60 loc) · 1.86 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
72
73
74
import os
import sys
import subprocess
import shutil
from setuptools import setup
from distutils.sysconfig import get_python_lib
VERSION = "2.2.1"
if "uninstall" in sys.argv:
def run(command):
try:
return subprocess.check_output(command, shell=True).strip()
except subprocess.CalledProcessError:
pass
cactusBinPath = run('which cactus')
cactusPackagePath = None
for p in os.listdir(get_python_lib()):
if p.lower().startswith('cactus') and p.lower().endswith('.egg'):
cactusPackagePath = os.path.join(get_python_lib(), p)
if cactusBinPath and os.path.exists(cactusBinPath):
print 'Removing cactus script at %s' % cactusBinPath
os.unlink(cactusBinPath)
if cactusPackagePath and os.path.isdir(cactusPackagePath):
print 'Removing cactus package at %s' % cactusPackagePath
shutil.rmtree(cactusPackagePath)
sys.exit()
if "install" in sys.argv or "bdist_egg" in sys.argv:
# Check if we have an old version of cactus installed
p1 = '/usr/local/bin/cactus.py'
p2 = '/usr/local/bin/cactus.pyc'
if os.path.exists(p1) or os.path.exists(p2):
print "Error: you have an old version of Cactus installed, we need to remove it:"
if os.path.exists(p1): print " sudo rm %s" % p1
if os.path.exists(p2): print " sudo rm %s" % p2
sys.exit()
setup(
name='Cactus',
version=VERSION,
description="Static site generation and deployment.",
long_description=open('readme.md').read(),
url='http://github.com/koenbok/Cactus',
download_url='https://github.com/koenbok/Cactus/tarball/v%s#egg=Cactus-%s' % (VERSION, VERSION),
author='Koen Bok',
author_email='[email protected]',
license='BSD',
packages=['cactus'],
entry_points={
'console_scripts': [
'cactus = cactus.cli:main',
],
},
install_requires=[
'Django==1.5.5',
'boto>=2.4.1',
'markdown'
],
zip_safe=False,
tests_require=['nose'],
test_suite='nose.collector',
classifiers=[],
)