-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
31 lines (21 loc) · 694 Bytes
/
setup.py
File metadata and controls
31 lines (21 loc) · 694 Bytes
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
from pathlib import Path
from setuptools import setup
REQUIREMENTS_FILE = Path(__file__).parent / "requirements.txt"
REQUIREMENTS_DEV_FILE = Path(__file__).parent / "requirements-dev.txt"
def read_file(filepath: Path) -> list[str]:
""" Read given `filepath` and return contents as list of strings.
Args:
filepath (obj: Path): Path to file.
Returns:
list[str]: File contents as list of strings.
"""
contents: list[str] = []
with filepath.open("r") as f:
contents = f.readlines()
return contents
setup(
install_requires=read_file(REQUIREMENTS_FILE),
extras_require={
"test": read_file(REQUIREMENTS_DEV_FILE),
},
)