From 3593f017d70c81a86945f588eb5dbeaa8213571f Mon Sep 17 00:00:00 2001 From: unclecode Date: Fri, 17 May 2024 16:01:04 +0800 Subject: [PATCH] chore: Update setup.py to exclude torch, transformers, and nltk dependencies This commit updates the setup.py file to exclude the torch, transformers, and nltk dependencies from the install_requires section. Instead, it creates separate extras_require sections for different environments, including all requirements, excluding torch for Colab, and excluding torch, transformers, and nltk for the crawl environment. --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e59ca7f9..e26c69cd 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,9 @@ with open("requirements.txt") as f: # Define the requirements for different environments requirements_without_torch = [req for req in requirements if not req.startswith("torch")] +requirements_without_transformers = [req for req in requirements if not req.startswith("transformers")] +requirements_without_nltk = [req for req in requirements if not req.startswith("nltk")] +requirements_without_torch_transformers_nlkt = [req for req in requirements if not req.startswith("torch") and not req.startswith("transformers") and not req.startswith("nltk")] setup( name="Crawl4AI", @@ -18,9 +21,11 @@ setup( author_email="unclecode@kidocode.com", license="MIT", packages=find_packages(), - install_requires=requirements, + install_requires=requirements_without_torch_transformers_nlkt, extras_require={ + "all": requirements, # Include all requirements "colab": requirements_without_torch, # Exclude torch for Colab + "crawl": requirements_without_torch_transformers_nlkt }, entry_points={ 'console_scripts': [