-
Notifications
You must be signed in to change notification settings - Fork 64
/
setup.py
executable file
·99 lines (93 loc) · 3.49 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
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
97
98
99
#!/usr/bin/env python
#
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU General Public License version 3 (see the file LICENSE).
import os
import subprocess
import sys
import json
from setuptools import setup, find_packages
curdir = os.path.dirname(__file__)
version_cache = os.path.join(curdir, 'charmtools', 'VERSION')
try:
version_raw = subprocess.check_output(['vergit', '--format=json']).strip()
if sys.version_info >= (3, 0):
version_raw = version_raw.decode('UTF-8')
version = json.loads(version_raw)['version']
except Exception:
version = 'unknown'
if version == 'unknown':
# during install; use cached VERSION
try:
with open(version_cache, 'r') as fh:
version_raw = fh.read()
version = json.loads(version_raw)['version']
except Exception:
version = None
else:
# during build; update cached VERSION
with open(version_cache, 'w') as fh:
fh.write(version_raw)
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as fh:
readme = fh.read()
setup(
name='charm-tools',
version=version,
packages=find_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
install_requires=[
'cheetah3>=3.0.0,<4.0',
'pyyaml>=5.0,!=5.4.0,!=5.4.1,!=6.0,<7.0',
'requests>=2.0.0,<3.0.0',
'blessings<2.0',
'ruamel.yaml<0.16.0;python_version < "3.7"',
'pathspec<=0.3.4;python_version < "3.7"',
'ruamel.yaml<0.18;python_version >= "3.7"',
'pathspec<0.11;python_version >= "3.7"',
'otherstuf<=1.1.0',
'path<17',
'pip>=1.5.4',
'jujubundlelib<0.6',
'virtualenv>=1.11.4,<21',
'colander<1.9',
'jsonschema<4.18.0',
'keyring<24',
'secretstorage<3.4',
'dict2colander==0.2',
'vergit>=1.0.0,<2.0.0',
'requirements-parser<0.6',
],
include_package_data=True,
maintainer='Cory Johns',
maintainer_email='[email protected]',
description=('Tools for building and maintaining Juju charms'),
long_description=readme,
license='GPL v3',
url='https://github.com/juju/charm-tools',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
],
entry_points={
'console_scripts': [
'charm-build = charmtools.build.builder:main',
'charm-create = charmtools.create:main',
'charm-help = charmtools.cli:usage',
'charm-layers = charmtools.build.builder:inspect',
'charm-proof = charmtools.proof:main',
'charm-pull-source = charmtools.pullsource:main',
'charm-version = charmtools.version:main',
],
'charmtools.templates': [
'bash = charmtools.templates.bash:BashCharmTemplate',
'reactive-python = charmtools.templates.reactive_python:ReactivePythonCharmTemplate', # noqa: E501
'reactive-bash = charmtools.templates.reactive_bash:ReactiveBashCharmTemplate', # noqa: E501
'python-basic = charmtools.templates.python:PythonCharmTemplate',
'python = charmtools.templates.python_services:PythonServicesCharmTemplate', # noqa: E501
'ansible = charmtools.templates.ansible:AnsibleCharmTemplate',
'chef = charmtools.templates.chef:ChefCharmTemplate',
'powershell = charmtools.templates.powershell:PowerShellCharmTemplate', # noqa: E501
]
},
)