-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
33 lines (27 loc) · 830 Bytes
/
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
import os
from typing import List
from setuptools import setup
PROJ_DIR = os.path.dirname(__file__)
def load_requirements(
file_name: str = "requirements.txt",
dir_path: str = PROJ_DIR,
comment_char: str = "#",
) -> List[str]:
"""Utility function to load requirements from a requirements.txt ignoring comments."""
with open(os.path.join(dir_path, file_name)) as file:
lines = [ln.strip() for ln in file.readlines()]
reqs = []
for ln in lines:
if comment_char in ln:
ln = ln[: ln.index(comment_char)].strip()
if ln:
reqs.append(ln)
return reqs
setup(
package_dir={"": "src"},
python_requires=">=3.10",
install_requires=load_requirements(),
# extras_require={
# "dev": load_requirements("requirements-dev.txt"),
# },
)