-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathsetup.py
More file actions
75 lines (62 loc) · 2.42 KB
/
setup.py
File metadata and controls
75 lines (62 loc) · 2.42 KB
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
import os
import sys
from setuptools import setup, find_packages
if sys.version_info.major == 2:
msg = "PyContracts3 is a Python 3 package. You are using Python 2."
raise Exception(msg)
description = (
"PyContracts is a Python package that allows to declare "
"constraints on function parameters and return values. "
"Contracts can be specified using Python3 annotations, "
"in a decorator, or inside a docstring :type: and :rtype: tags. "
"PyContracts supports a basic type system, variables binding, "
"arithmetic constraints, and has several specialized "
"contracts (notably for Numpy arrays), as well as an extension API."
)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
long_description = read("README.rst")
def get_version(filename):
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith("__version__"):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError("No version found in %r." % filename)
if version is None:
raise ValueError(filename)
return version
version = get_version(filename="src/contracts/__init__.py")
install_requires = ["pyparsing", "decorator", "six", "future"]
setup(
name="PyContracts3",
author="Andrea Censi",
url="http://andreacensi.github.com/contracts/",
# description=description,
# long_description=long_description,
keywords="type checking, value checking, contracts",
# license="LGPL",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Documentation",
"Topic :: Software Development :: Testing",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
version=version,
download_url="http://github.com/AndreaCensi/contracts/tarball/%s" % version,
package_dir={"": "src"},
packages=find_packages("src"),
install_requires=install_requires,
tests_require=["nose"],
entry_points={},
)