-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
68 lines (55 loc) · 1.93 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
#!/usr/bin/env python
import ast
import codecs
from setuptools import setup
requirements = open('requirements.txt').read().splitlines()
requirements = ['icdiff-inprocess'] + [
r for r in requirements if not r.startswith('-')]
def read_text(path):
with codecs.open(path, "r", "utf-8") as fh:
return fh.read()
def read_version(path):
with open(path) as fh:
for line in fh:
stripped = line.strip()
if stripped == "" or stripped.startswith("#"):
continue
elif line.startswith("from __future__ import"):
continue
else:
if not line.startswith("__version__ = "):
raise Exception("Can't find __version__ line in " + path)
break
else:
raise Exception("Can't find __version__ line in " + path)
_, _, quoted = line.rstrip().partition("= ")
return ast.literal_eval(quoted)
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Testing",
]
setup(
name="icdiff-expects",
url='https://github.com/jlee-made/icdiff-expects',
author='John Lee',
classifiers=classifiers,
dependency_links=[
"git+https://github.com/jlee-made/icdiff.git@13abb1ae6120f31edcf856c7468268f1eeff6cea#egg=icdiff-inprocess"
],
description="Readable coloured inline diffs from expects test assertions",
license="BSD",
long_description=read_text("README.md"),
package_dir={"": "src"},
platforms=["any"],
py_modules=["icdiff_expects"],
install_requires=requirements,
test_suite="test_icdiff_expects",
version=read_version("src/icdiff_expects.py"),
zip_safe=True,
)