-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
73 lines (64 loc) · 1.87 KB
/
setup.py
File metadata and controls
73 lines (64 loc) · 1.87 KB
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
import os
import re
from itertools import chain
from setuptools import find_packages, setup
NAME_PACKAGE = "easy_notifyer"
DESCRIPTION = (
"Easy bug reporter for small projects. "
"Zero dependencies - download and run. Asyncio support."
)
EXTRAS = {
"dev": [
"pytest",
"pytest-mock",
"pytest-asyncio",
"pylint",
"flake8",
"isort",
"bump2version",
"black",
]
}
def read(filename: str):
"""Open file"""
return open(os.path.join(os.path.dirname(__file__), filename)).read().strip()
def read_version() -> str:
"""Read version from __init__.py"""
regexp = re.compile(r'^__version__\W*=\W*"([\d.abrc]+)"')
init_py = os.path.join(os.path.dirname(__file__), NAME_PACKAGE, "__init__.py")
with open(init_py) as file:
for line in file:
match = regexp.match(line)
if match is not None:
return match.group(1)
raise RuntimeError(f"Cannot find version in {NAME_PACKAGE}/__init__.py")
setup(
name=NAME_PACKAGE,
version=read_version(),
description=DESCRIPTION,
author="strpc",
url="https://github.com/strpc/easy_notifyer",
long_description=read("README.md"),
long_description_content_type="text/markdown",
download_url="https://pypi.python.org/pypi/easy-notifyer",
packages=find_packages(
exclude=(
"tests",
"tests.*",
"examples.*",
"docs",
)
),
extras_require={
"dev": EXTRAS["dev"],
"all": list(chain.from_iterable(EXTRAS.values())),
},
python_requires=">=3.7, <4",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
license="MIT",
keywords=["easy-notifyer", "telegram", "mailer", "mail-client"],
)