-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·43 lines (32 loc) · 1.29 KB
/
setup.py
File metadata and controls
executable file
·43 lines (32 loc) · 1.29 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
import re
from pathlib import Path
from setuptools import setup
FILE = Path(__file__).resolve()
PARENT = FILE.parent
README = (PARENT / 'README.md').read_text(encoding='utf-8')
def get_version():
file = PARENT / 'mlearning/__init__.py'
return re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', file.read_text(encoding='utf-8'), re.M)[1]
def parse_requirements(file_path: Path):
requirements = []
for line in Path(file_path).read_text().splitlines():
line = line.strip()
if line and not line.startswith('#'):
requirements.append(line.split("#")[0].strip())
return requirements
version=get_version()
packages=['mlearning'] + [str(x) for x in Path('mlearning').rglob('*/') if x.is_dir() and '__' not in str(x)]
install_requires=parse_requirements(PARENT / 'requirements.txt')
setup(
version=get_version(),
python_requires='>=3.9',
description=('Template for Python Project'),
long_description=README,
long_description_content_type='text/makrdown',
packages=['mlearning'] + [str(x) for x in Path('athena').rglob('*/') if x.is_dir() and '__' not in str(x)],
package_data={
'': ['*.yaml'],
},
include_package_data=True,
install_requires=parse_requirements(PARENT / 'requirements.txt'),
)