-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
88 lines (70 loc) · 2.26 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
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python
#
# This file is in the public domain.
import sys
try:
# distutils extension (non-stdlib)
from setuptools import setup, Command
except:
from distutils.core import setup
Command = None
import pydelicious
requires = ['feedparser']
if sys.version[0] == 2 and sys.version[1] <= 4:
requires += [ 'elementtree >= 1.2' ]
elif sys.version[0] == 2 and sys.version[1] >= 5:
# integrated into the standard library as xml.etree.*
pass
distopts = dict(
name = 'pydelicious',
version = pydelicious.__version__,
license = pydelicious.__license__,
description = pydelicious.__description__,
long_description = pydelicious.__long_description__,
author = pydelicious.__author__,
author_email = pydelicious.__author_email__,
url = pydelicious.__url__,
requires = requires,
)
if Command:
class Test(Command):
"""Distutils Command to run API tests"""
description = 'Run pydelicious API tests.'
user_options = []
def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
from tests import main
main.test_api()
# TODO: need to see this work...
#dependency_links = [
# "http://feedparser.org/feedparser.py#egg=feedparser-latest"
#]
distopts.update(dict(
cmdclass = {
'test': Test,
},
packages = ['pydelicious','pydelicious.tools'],
package_dir = {
'pydelicious': 'pydelicious',
'pydelicious.tools': 'tools' },
# setuptools dist.opts extensions:
install_requires = requires,
entry_points = {
'console_scripts': [
'dlcs = pydelicious.tools.dlcs:_main',
'dlcs_feeds = pydelicious.tools.dlcs_feeds:_main'
]
}
))
else:
print >>sys.stderr,'no setuptools detected, proceeding without installing `dlcs`'
distopts.update(dict(
packages = ['pydelicious'],
package_dir = { 'pydelicious': 'pydelicious' },
#provides = 'pydelicious (%s)' % (pydelicious.__version__)
# FIXME: what class for distutils?
cmdclass = {},
scripts = ['tools/dlcs.py'], # FIXME: but how to get it on PATH?
))
setup(**distopts)