forked from boisgera/zeroconf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·59 lines (42 loc) · 1.38 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
#!/usr/bin/env python
# coding: utf-8
import distutils.core
import os.path
import sys
def get_info(module):
"Extract distutils configuration information from a module"
info = {}
name = getattr(module, "__name__", None)
if not name:
name = module.__file__.split(".")[0]
info["name"] = name
author_info = getattr(module, "__author__", None)
if author_info:
# "author <author_email>" syntax expected
info["author"] = author_info.split("<")[0].strip()
info["author_email"] = author_info.split("<")[1].strip()[:-1]
license = getattr(module, "__license__", None)
if license:
info["license"] = license
url = getattr(module, "__url__", None)
if url:
info["url"] = url
version = getattr(module, "__version__", None)
if version:
info["version"] = version
doc = getattr(module, "__doc__", None)
if doc:
# the description is expected to be the first non-blank doc line
lines = doc.splitlines()
for line in lines:
if line:
info["description"] = line
break
module = getattr(module, "__file__")
if module:
info["py_modules"] = [os.path.basename(module).split(".")[0]]
return info
sys.path.insert(0, "."); import zeroconf
info = get_info(zeroconf)
info["requires"] = ["pbs"]
distutils.core.setup(**info)