-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
84 lines (71 loc) · 2.43 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
from setuptools import find_packages, setup
NAME = "gimeltra"
def get_absolute_path(*args):
"""Transform relative pathnames into absolute pathnames."""
directory = os.path.dirname(os.path.abspath(__file__))
return os.path.join(directory, *args)
with open(get_absolute_path("README.md")) as f:
long_description = f.read()
def get_version(*args):
verstrline = open(get_absolute_path(NAME, "__init__.py"), "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
return mo.group(1)
return "undefined"
def get_requirements(*args):
"""Get requirements from pip requirement files."""
requirements = set()
with open(get_absolute_path(*args)) as handle:
for line in handle:
# Strip comments.
line = re.sub(r"^#.*|\s#.*", "", line)
# Ignore empty lines
if line and not line.isspace():
requirements.add(re.sub(r"\s+", "", line))
return sorted(requirements)
setup(
name=f"{NAME}",
version=get_version(),
description="Simple transliteration tool for mostly Semitic languages",
long_description=long_description,
long_description_content_type="text/markdown",
author="Adam Twardoch",
author_email="[email protected]",
url=f"https://github.com/twardoch/{NAME}/",
project_urls={"Source": f"https://github.com/twardoch/{NAME}/"},
license="GPLv2",
download_url=f"https://github.com/twardoch/{NAME}/",
python_requires=">=3.9",
install_requires=get_requirements("requirements.txt"),
packages=find_packages(),
include_package_data=True,
scripts=[],
keywords=[
"dictionary",
"wiktionary",
"transliteration",
"transliterate",
],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Environment :: Console",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Text Processing",
"Topic :: Text Processing :: Linguistic",
],
entry_points=f"""
[console_scripts]
{NAME}py={NAME}.__main__:main
""",
)