generated from kjpou1/ml_project_template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
67 lines (59 loc) · 2.26 KB
/
setup.py
File metadata and controls
67 lines (59 loc) · 2.26 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import warnings
from typing import List
from setuptools import find_packages, setup
HYPHEN_E_DOT = "-e ."
def get_requirements(file_path: str) -> List[str]:
"""
Parses the requirements.txt file and returns a list of requirements,
excluding comments, empty lines, and the editable installation directive (`-e .`).
Note: `-e .` is skipped because editable installations are intended for local development
and may cause portability issues in CI/CD or production environments.
"""
try:
with open(file_path, encoding="utf-8") as file_obj:
# Read and clean lines, skipping comments and empty lines
requirements = [
req.strip()
for req in file_obj
if req.strip()
and not req.strip().startswith("#")
and req.strip() != HYPHEN_E_DOT
]
return requirements
except FileNotFoundError:
warnings.warn(
f"Warning: {file_path} not found. Proceeding without additional dependencies.",
stacklevel=2,
)
return []
except UnicodeDecodeError as e:
warnings.warn(
f"Warning: Encoding issue while reading {file_path}: {str(e)}. Proceeding without additional dependencies.",
stacklevel=2,
)
return []
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="ml_project_template",
version="0.0.1",
author="kjpou1",
author_email="wasssssuuuuupppp@gmail.com",
description="A modular and production-ready template for ML projects.",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
install_requires=get_requirements("requirements.txt"),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
keywords="machine learning template production-ready",
url="https://github.com/kjpou1/ml_project_template",
project_urls={
"Bug Tracker": "https://github.com/kjpou1/ml_project_template/issues",
"Documentation": "https://github.com/kjpou1/ml_project_template",
},
python_requires=">=3.7",
)