-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
77 lines (61 loc) · 2.09 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
"""
This file is part of the Drups.io Engine.
(c) 2021 Drups.io <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
Written by Temuri Takalandze <[email protected]>, March 2021
"""
import os
import re
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
def get_requirements(filename):
"""
Get requirements file content by filename.
:param filename: Name of requirements file.
:return: Content of requirements file.
"""
return open("requirements/" + filename).read().splitlines()
def get_package_version():
"""
Read the version of drups module without importing it.
:return: The version
"""
version = re.compile(r"VERSION\s*=\s*\((.*?)\)")
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, "drups/__init__.py")) as file:
for line in file:
match = version.match(line.strip())
if not match:
continue
return ".".join(match.groups()[0].split(", "))
setup(
name="drups",
version=get_package_version(),
author="Temuri Takalandze",
author_email="[email protected]",
description="Engine for Drups.io",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/drupsio/engine",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
packages=find_packages(exclude=["tests", "tests.*"]),
python_requires=">=3.6",
install_requires=get_requirements("default.txt"),
test_suite="tests",
tests_require=get_requirements("test.txt"),
entry_points={
"console_scripts": [
"drups = drups.__main__:main",
]
},
)