forked from nyankosama/crawl-me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·54 lines (39 loc) · 1.53 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
PROJECT_METADATA = "project.json"
def createProjConfFile(confDict):
confPath = here + os.sep + "crawl_me" + os.sep + "__projconf__.py"
confFile = open(confPath, "w")
confFile.write("#this file is generated by setup.py, please don't change it.\n")
confFile.write("\n")
confFile.write("projConf = ")
confFile.write(json.dumps(confDict))
confFile.close()
import json, os, codecs
here = os.path.abspath(os.path.dirname(__file__))
proj_conf = json.loads(open(os.path.join(here, PROJECT_METADATA)).read())
createProjConfFile(proj_conf)
long_description = proj_conf["description"]
if os.path.exists("README.txt") and os.path.exists("CHANGELOG.txt"):
README = codecs.open(os.path.join(here, 'README.txt'), "r", "utf8").read()
CHANGELOG = codecs.open(os.path.join(here, 'CHANGELOG.txt'), "r", "utf8").read()
long_description = README + "\n\n" + CHANGELOG
from setuptools import setup, find_packages
setup(
name = proj_conf["name"],
version = proj_conf["version"],
packages = find_packages(),
install_requires = ['pyquery>=1.2.5'],
author = proj_conf["author"],
author_email = proj_conf["author_email"],
url = proj_conf["url"],
license = proj_conf["license"],
description = proj_conf["description"],
classifiers = proj_conf["classifiers"],
keywords = proj_conf["keywords"],
test_suite = 'tests',
long_description = long_description,
platforms = 'any',
include_package_data = True,
entry_points = {
'console_scripts': proj_conf["console_scripts"]
}
)