-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
106 lines (90 loc) · 3.02 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
100
101
102
103
104
105
106
## =========================================================
## Copyright 2019 Dietrich Bollmann
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------
"""setup.py:
Setup file for the newskylabs.temple.python package and tools.
"""
import setuptools
import codecs
import os
## =========================================================
## Setup utilities
## ---------------------------------------------------------
def read_file(*parts):
"""
Read a file and return its content
"""
package_dir = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(package_dir, *parts), 'r') as fh:
return fh.read()
def find_packages(namespace):
"""
Return a list of all Python packages defined in the 'namespace'
directory
"""
return [
'{}.{}'.format(namespace, package)
for package in setuptools.PackageFinder.find(where=namespace)
]
## =========================================================
## Setup
## ---------------------------------------------------------
namespace = 'newskylabs'
subnamespace = 'temple'
# Load the package metadata
exec(read_file(namespace, subnamespace, '__about__.py'))
# Read the long description
long_description = read_file('README.md')
# Find the list of packages
packages = find_packages(namespace)
# DEBUG
print('DEBUG packages:', packages)
# Setup package
setuptools.setup(
name=__package_name__,
version=__version__,
description=__description__,
long_description=long_description,
long_description_content_type='text/markdown',
author=__author__,
author_email=__email__,
license=__license__,
url=__url__,
packages=packages,
entry_points={
'console_scripts': [
'temple = newskylabs.temple.__main__:cli',
]
},
package_data={
'newskylabs.temple': ['scripts/default_settings.yaml'],
},
include_package_data=True,
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
],
platforms=['Posix', 'Unix', 'Linux', 'MacOS X', 'Windows'],
install_requires=[
'click',
'pyyaml',
'jinja2',
'newskylabs-utilities @ git+https://github.com/newskylabs/newskylabs-utilities#egg=newskylabs-utilities-0.0.1.dev1',
],
)
## =========================================================
## =========================================================
## fin.