-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·65 lines (53 loc) · 1.57 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
#!/usr/bin/env python3
"""
nuqql-matrixd setup file
"""
import os
import re
import codecs
from setuptools import setup
# setup parameters
DESCRIPTION = "Matrix client network daemon using the Matrix Python SDK"
with open("README.md", 'r', encoding='UTF-8') as f:
LONG_DESCRIPTION = f.read()
CLASSIFIERS = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
]
# setup helpers
def read(*parts):
"""
Read encoded file
"""
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, *parts), 'r') as enc_file:
return enc_file.read()
def find_version(*file_paths):
"""
Find version in encoded file
"""
version_file = read(*file_paths)
version_pattern = r"^VERSION = ['\"]([^'\"]*)['\"]"
version_match = re.search(version_pattern, version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
# run setup
setup(
name="nuqql-matrixd",
version=find_version("nuqql_matrixd", "server.py"),
description=DESCRIPTION,
license="MIT",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
author="hwipl",
author_email="nuqql-matrixd@hwipl.net",
url="https://github.com/hwipl/nuqql-matrixd",
packages=["nuqql_matrixd"],
entry_points={
"console_scripts": ["nuqql-matrixd = nuqql_matrixd.main:main"]
},
classifiers=CLASSIFIERS,
python_requires='>=3.7',
install_requires=["nuqql-based~=0.3.0", "matrix_client~=0.4.0"],
)