-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
31 lines (26 loc) · 879 Bytes
/
setup.py
File metadata and controls
31 lines (26 loc) · 879 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
31
from setuptools import setup, find_packages
# Read the requirements from requirements.txt
import yaml
from setuptools import setup, find_packages
def parse_env_yaml(path="environment.yaml"):
with open(path, "r", encoding="utf-8") as f:
env = yaml.safe_load(f)
deps = []
for dep in env.get("dependencies", []):
if isinstance(dep, str):
continue
if isinstance(dep, dict) and "pip" in dep:
deps.extend(dep["pip"])
return deps
# 从 environment.yml 里提取 pip 依赖
requirements = parse_env_yaml("environment.yaml")
setup(
name='knowcol',
version='0.1',
packages=find_packages(),
install_requires=requirements,
author='Hongkuan Zhou',
author_email='hongkuan.zhou@bosch.com',
description='A short description of your project',
url='https://github.com/yourusername/yourproject',
)