This repository was archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
78 lines (67 loc) · 2.25 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
from distutils.command.install_egg_info import install_egg_info
from distutils.command.build import build
from distutils.versionpredicate import VersionPredicate
from setuptools import setup, find_packages
import time
import sys
class check_and_build( build ):
def run(self):
chk = True
for req in require_pyt:
chk &= self.chkpython(req)
for req in require_mod:
chk &= self.chkmodule(req)
if not chk:
sys.exit(1)
build.run( self )
def chkpython(self, req):
chk = VersionPredicate(req)
ver = '.'.join([str(v) for v in sys.version_info[:2]])
if not chk.satisfied_by(ver):
print >> sys.stderr, "Invalid python version, expected %s" % req
return False
return True
def chkmodule(self, req):
chk = VersionPredicate(req)
try:
mod = __import__(chk.name)
except:
print >> sys.stderr, "Missing mandatory %s python module" % chk.name
return False
for v in [ '__version__', 'version' ]:
ver = getattr(mod, v, None)
break
try:
if ver and not chk.satisfied_by(ver):
print >> sys.stderr, "Invalid module version, expected %s" % req
return False
except:
pass
return True
require_pyt = [ 'python (>=2.7, <3.0)' ]
require_mod = []
setup(name='mobyle2.datamanager',
version= time.strftime("%Y-%m-%d"),
description = "common libraries to Mobyle2 project to manage datasets",
classifiers=[
"Programming Language :: Python",
"Framework :: Pylons",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
],
author = "Olivier Sallou",
author_email = "olivier.sallou@irisa.fr",
license = "GPLv3" ,
url = "https://github.com/mobyle2/mobyle2.datamanager",
keywords='mobyle data manager',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
entry_points = """\
[paste.app_factory]
main = mobyle.data.webmanager:main
""",
)