-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
47 lines (40 loc) · 1.69 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
from setuptools import setup, find_packages
from os import path, getenv
def get_requirements(requirements_filename: str):
requirements_file = path.join(path.abspath(path.dirname(__file__)), "requirements", requirements_filename)
with open(requirements_file, 'r', encoding='utf-8') as r:
requirements = r.readlines()
requirements = [r.strip() for r in requirements if r.strip() and not r.strip().startswith("#")]
for i in range(0, len(requirements)):
r = requirements[i]
if "@" in r:
parts = [p.lower() if p.strip().startswith("git+http") else p for p in r.split('@')]
r = "@".join(parts)
if getenv("GITHUB_TOKEN"):
if "github.com" in r:
r = r.replace("github.com", f"{getenv('GITHUB_TOKEN')}@github.com")
requirements[i] = r
return requirements
with open("README.md", "r") as f:
long_description = f.read()
with open("./version.py", "r", encoding="utf-8") as v:
for line in v.readlines():
if line.startswith("__version__"):
if '"' in line:
version = line.split('"')[1]
else:
version = line.split("'")[1]
setup(
name='ukrainian-accentor-transformer',
version=version,
description='Adds word stress for texts in Ukrainian',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/Theodotus1243/ukrainian-accentor-transformer',
author='Theodotus1243',
license='MIT',
packages=find_packages(),
install_requires=get_requirements("requirements.txt"),
zip_safe=True,
keywords='ukrainian accent stress nlp transformer linguistics',
)