-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
71 lines (59 loc) · 2.41 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
#!/usr/bin/env python
# Copyright (c) Polyconseil SAS
# This software is distributed under the two-clause BSD license.
import os
import re
from setuptools import setup, find_packages
root_dir = os.path.abspath(os.path.dirname(__file__))
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.+-]+)[\"']$")
package_components = package_name.split('.')
init_path = os.path.join(root_dir, *(package_components + ['__init__.py']))
with open(init_path, 'r', encoding='utf-8') as f:
for line in f:
match = version_re.match(line[:-1])
if match:
return match.groups()[0]
return '0.1.0'
def get_long_description(filename):
with open(filename, 'r', encoding='utf-8') as f:
text = f.read()
# Replace :doc: directive by *title*
pattern = re.compile(r'(?P<matched>:doc:`(?P<title>.*)\s+<(?P<target>[^>]+)>`)')
for matched_text, title, target in pattern.findall(text):
text = text.replace(matched_text, '*%s*' % (title or target))
return text
PACKAGE = 'getconf'
setup(
name=PACKAGE,
version=get_version(PACKAGE),
description="getconf, a versatile configuration lib for Python projects",
long_description=get_long_description('README.rst'),
author="Polyconseil",
author_email="opensource+%[email protected]" % PACKAGE,
license="BSD",
keywords=['configuration', 'environment', 'setup', 'getconf', 'config'],
url="https://github.com/Polyconseil/%s/" % PACKAGE,
download_url="https://pypi.python.org/pypi/%s/" % PACKAGE,
packages=find_packages(exclude=['tests']),
platforms=["OS Independent"],
install_requires=[],
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development",
"Topic :: System :: Installation/Setup",
"Topic :: System :: Systems Administration",
],
include_package_data=True,
zip_safe=False,
)