forked from IBM/unitxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
63 lines (56 loc) · 2.14 KB
/
setup.py
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
import os
import warnings
import setuptools
from version import version
with open("README.md") as fh:
long_description = fh.read()
requirements_dir = "requirements"
extras_require = {}
# Collecting all requirements from the .rqr files
for file in os.listdir(requirements_dir):
if file.endswith(".rqr"):
key = file.rsplit(".")[0] # Remove .rqr extension to get the key
with open(os.path.join(requirements_dir, file)) as f:
requirements_list = []
for requirement in f.read().splitlines():
requirement = requirement.strip()
if requirement.startswith("git+"):
warnings.warn(
f"****IMPORTANT****\nThe requirement {requirement} of setup '{key}' can be installed directly with 'pip install {requirement}' or 'pip install -r {file}'",
stacklevel=2,
)
else:
requirements_list.append(requirement)
extras_require[key] = requirements_list
# Adding the 'all' key
all_requirements = []
for req_list in extras_require.values():
all_requirements.extend(req_list)
extras_require["all"] = list(set(all_requirements)) # Removing duplicates
setuptools.setup(
name="unitxt",
version=version,
author="IBM Research",
author_email="elron.bandel@ibm.com",
description="Load any mixture of text to text data in one line of code",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ibm/unitxt",
packages=setuptools.find_packages("src"),
package_dir={"": "src"},
include_package_data=True,
package_data={"unitxt": ["catalog/*.json", "ui/banner.png"]},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
python_requires=">=3.8",
install_requires=extras_require["base"],
extras_require=extras_require,
entry_points={
"console_scripts": [
"unitxt-explore=unitxt.ui:launch",
"unitxt-metrics-service=unitxt.service.metrics.main:start_metrics_http_service",
],
},
)