-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
56 lines (48 loc) · 1.49 KB
/
setup.py
File metadata and controls
56 lines (48 loc) · 1.49 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
import os
from setuptools import setup, find_packages
def read_environment_yaml():
"""Read dependencies from environment.yaml"""
env_file = 'environment.yaml'
if not os.path.exists(env_file):
return []
try:
import yaml
with open(env_file, 'r') as f:
env_data = yaml.safe_load(f)
except ImportError:
return []
pip_deps = []
dependencies = env_data.get('dependencies', [])
for dep in dependencies:
if isinstance(dep, dict) and 'pip' in dep:
pip_deps.extend(dep['pip'])
return []
def get_base_requirements():
return [
'torch',
'numpy',
]
try:
env_requirements = read_environment_yaml()
install_requires = get_base_requirements() + env_requirements
except Exception:
install_requires = get_base_requirements()
setup(
name='fw-tsw',
version='0.1.0',
package_dir={'': 'src'},
packages=find_packages(where='src'),
install_requires=install_requires,
author='Thanh Tran',
author_email='thanhqt2002@gmail.com',
description='Revisiting Tree-Sliced Wasserstein Distance Through the Lens of the Fermat-Weber Problem',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url='https://github.com/thanhquangtran/FW-TSW',
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
python_requires='>=3.9',
)