forked from plus3it/watchmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
96 lines (85 loc) · 3.01 KB
/
setup.py
File metadata and controls
96 lines (85 loc) · 3.01 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Watchmaker setup script."""
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)
import io
import os
import re
from setuptools import find_packages, setup
def read(*names, **kwargs):
"""Read a file."""
return io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get('encoding', 'utf8')
).read()
def find_version(*file_paths):
"""Read the version number from a source file."""
# Why read it, and not import?
# see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion
version_file = read(*file_paths, encoding='utf8')
# The version line must have the form
# __version__ = 'ver'
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def parse_md_to_rst(file):
"""Read Markdown file and convert to ReStructured Text."""
try:
from m2r import parse_from_file
return(parse_from_file(file))
except ImportError:
# m2r may not be installed in user environment
return(read(file))
setup(
name='watchmaker',
version=find_version('src', 'watchmaker', '__init__.py'),
license='Apache Software License 2.0',
author='Plus3IT Maintainers of Watchmaker',
description='Applied Configuration Management',
long_description=parse_md_to_rst('README.md'),
url='https://github.com/plus3it/watchmaker',
packages=find_packages(str('src')),
package_dir={'': str('src')},
include_package_data=True,
platforms=[
'Windows',
'Linux'
],
classifiers=[
# complete classifier list:
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Utilities',
],
entry_points={
'console_scripts': [
'watchmaker = watchmaker.cli:main',
'wam = watchmaker.cli:main',
]
},
install_requires=[
"click",
"futures",
"six",
"PyYAML",
]
)