Commit
·
668f157
1
Parent(s):
114639b
Upload setup.py with huggingface_hub
Browse files
setup.py
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from setuptools import find_packages, setup
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def get_version() -> str:
|
| 5 |
+
rel_path = "src/huggingface_hub/__init__.py"
|
| 6 |
+
with open(rel_path, "r") as fp:
|
| 7 |
+
for line in fp.read().splitlines():
|
| 8 |
+
if line.startswith("__version__"):
|
| 9 |
+
delim = '"' if '"' in line else "'"
|
| 10 |
+
return line.split(delim)[1]
|
| 11 |
+
raise RuntimeError("Unable to find version string.")
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
install_requires = [
|
| 15 |
+
"filelock",
|
| 16 |
+
"fsspec>=2023.5.0",
|
| 17 |
+
"requests",
|
| 18 |
+
"tqdm>=4.42.1",
|
| 19 |
+
"pyyaml>=5.1",
|
| 20 |
+
"typing-extensions>=3.7.4.3", # to be able to import TypeAlias
|
| 21 |
+
"packaging>=20.9",
|
| 22 |
+
]
|
| 23 |
+
|
| 24 |
+
extras = {}
|
| 25 |
+
|
| 26 |
+
extras["cli"] = [
|
| 27 |
+
"InquirerPy==0.3.4",
|
| 28 |
+
# Note: installs `prompt-toolkit` in the background
|
| 29 |
+
]
|
| 30 |
+
|
| 31 |
+
extras["inference"] = [
|
| 32 |
+
"aiohttp", # for AsyncInferenceClient
|
| 33 |
+
"pydantic>1.1,<3.0", # match text-generation-inference v1.1.0
|
| 34 |
+
]
|
| 35 |
+
|
| 36 |
+
extras["torch"] = [
|
| 37 |
+
"torch",
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
extras["fastai"] = [
|
| 41 |
+
"toml",
|
| 42 |
+
"fastai>=2.4",
|
| 43 |
+
"fastcore>=1.3.27",
|
| 44 |
+
]
|
| 45 |
+
|
| 46 |
+
extras["tensorflow"] = ["tensorflow", "pydot", "graphviz"]
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
extras["testing"] = (
|
| 50 |
+
extras["cli"]
|
| 51 |
+
+ extras["inference"]
|
| 52 |
+
+ [
|
| 53 |
+
"jedi",
|
| 54 |
+
"Jinja2",
|
| 55 |
+
"pytest",
|
| 56 |
+
"pytest-cov",
|
| 57 |
+
"pytest-env",
|
| 58 |
+
"pytest-xdist",
|
| 59 |
+
"pytest-vcr", # to mock Inference
|
| 60 |
+
"pytest-asyncio", # for AsyncInferenceClient
|
| 61 |
+
"urllib3<2.0", # VCR.py broken with urllib3 2.0 (see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html)
|
| 62 |
+
"soundfile",
|
| 63 |
+
"Pillow",
|
| 64 |
+
"gradio", # to test webhooks
|
| 65 |
+
"numpy", # for embeddings
|
| 66 |
+
]
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
# Typing extra dependencies list is duplicated in `.pre-commit-config.yaml`
|
| 70 |
+
# Please make sure to update the list there when adding a new typing dependency.
|
| 71 |
+
extras["typing"] = [
|
| 72 |
+
"typing-extensions>=4.8.0",
|
| 73 |
+
"types-PyYAML",
|
| 74 |
+
"types-requests",
|
| 75 |
+
"types-simplejson",
|
| 76 |
+
"types-toml",
|
| 77 |
+
"types-tqdm",
|
| 78 |
+
"types-urllib3",
|
| 79 |
+
"pydantic>1.1,<3.0", # for text-generation-interface dataclasses
|
| 80 |
+
]
|
| 81 |
+
|
| 82 |
+
extras["quality"] = [
|
| 83 |
+
"ruff>=0.1.3",
|
| 84 |
+
"mypy==1.5.1",
|
| 85 |
+
]
|
| 86 |
+
|
| 87 |
+
extras["all"] = extras["testing"] + extras["quality"] + extras["typing"]
|
| 88 |
+
|
| 89 |
+
extras["dev"] = extras["all"]
|
| 90 |
+
|
| 91 |
+
extras["docs"] = extras["all"] + [
|
| 92 |
+
"hf-doc-builder",
|
| 93 |
+
"watchdog",
|
| 94 |
+
]
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
setup(
|
| 98 |
+
name="huggingface_hub",
|
| 99 |
+
version=get_version(),
|
| 100 |
+
author="Hugging Face, Inc.",
|
| 101 |
+
author_email="julien@huggingface.co",
|
| 102 |
+
description="Client library to download and publish models, datasets and other repos on the huggingface.co hub",
|
| 103 |
+
long_description=open("README.md", "r", encoding="utf-8").read(),
|
| 104 |
+
long_description_content_type="text/markdown",
|
| 105 |
+
keywords="model-hub machine-learning models natural-language-processing deep-learning pytorch pretrained-models",
|
| 106 |
+
license="Apache",
|
| 107 |
+
url="https://github.com/huggingface/huggingface_hub",
|
| 108 |
+
package_dir={"": "src"},
|
| 109 |
+
packages=find_packages("src"),
|
| 110 |
+
extras_require=extras,
|
| 111 |
+
entry_points={
|
| 112 |
+
"console_scripts": ["huggingface-cli=huggingface_hub.commands.huggingface_cli:main"],
|
| 113 |
+
"fsspec.specs": "hf=huggingface_hub.HfFileSystem",
|
| 114 |
+
},
|
| 115 |
+
python_requires=">=3.8.0",
|
| 116 |
+
install_requires=install_requires,
|
| 117 |
+
classifiers=[
|
| 118 |
+
"Intended Audience :: Developers",
|
| 119 |
+
"Intended Audience :: Education",
|
| 120 |
+
"Intended Audience :: Science/Research",
|
| 121 |
+
"License :: OSI Approved :: Apache Software License",
|
| 122 |
+
"Operating System :: OS Independent",
|
| 123 |
+
"Programming Language :: Python :: 3",
|
| 124 |
+
"Programming Language :: Python :: 3 :: Only",
|
| 125 |
+
"Programming Language :: Python :: 3.8",
|
| 126 |
+
"Programming Language :: Python :: 3.9",
|
| 127 |
+
"Programming Language :: Python :: 3.10",
|
| 128 |
+
"Programming Language :: Python :: 3.11",
|
| 129 |
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
| 130 |
+
],
|
| 131 |
+
include_package_data=True,
|
| 132 |
+
)
|