forked from popylar/popylar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
45 lines (37 loc) · 1.3 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
from setuptools import setup, find_packages
import os
import os.path as op
import uuid
import configparser
ver_file = os.path.join('popylar', 'version.py')
with open(ver_file) as f:
exec(f.read())
popylar_path = op.join(op.expanduser('~'), '.popylar')
# If UID file does not exist, then generate a UID and save to file.
# We don't overwrite an existing one in order to keep UIDs constant
# when the package is upgraded or installed in a venv.
if not os.path.exists(popylar_path):
parser = configparser.ConfigParser()
parser.read_dict(dict(user=dict(uid=uuid.uuid1().hex,
track=True)))
with open(popylar_path, 'w') as fhandle:
parser.write(fhandle)
PACKAGES = find_packages()
opts = dict(name=NAME,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
url=URL,
packages=PACKAGES,
download_url=DOWNLOAD_URL,
license=LICENSE,
classifiers=CLASSIFIERS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
platforms=PLATFORMS,
version=VERSION,
install_requires=REQUIRES,
requires=REQUIRES)
if __name__ == '__main__':
setup(**opts)