|
| 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 | + "requests", |
| 17 | + "tqdm", |
| 18 | +] |
| 19 | + |
| 20 | +extras = {} |
| 21 | + |
| 22 | +extras["testing"] = [ |
| 23 | + "pytest", |
| 24 | +] |
| 25 | + |
| 26 | +extras["quality"] = [ |
| 27 | + "black>=20.8b1", |
| 28 | + "isort>=5.5.4", |
| 29 | + "flake8>=3.8.3", |
| 30 | +] |
| 31 | + |
| 32 | +extras["all"] = extras["testing"] + extras["quality"] |
| 33 | + |
| 34 | +extras["dev"] = extras["all"] |
| 35 | + |
| 36 | + |
| 37 | +setup( |
| 38 | + name="huggingface_hub", |
| 39 | + version=get_version(), |
| 40 | + author="Hugging Face, Inc.", |
| 41 | + |
| 42 | + description="Client library to download and publish models on the huggingface.co hub", |
| 43 | + long_description=open("README.md", "r", encoding="utf-8").read(), |
| 44 | + long_description_content_type="text/markdown", |
| 45 | + keywords="model-hub machine-learning models natural-language-processing deep-learning pytorch pretrained-models", |
| 46 | + license="Apache", |
| 47 | + url="https://github.com/huggingface/huggingface_hub", |
| 48 | + package_dir={"": "src"}, |
| 49 | + packages=find_packages("src"), |
| 50 | + extras_require=extras, |
| 51 | + entry_points={ |
| 52 | + "console_scripts": [ |
| 53 | + "huggingface-cli=huggingface_hub.commands.huggingface_cli:main" |
| 54 | + ] |
| 55 | + }, |
| 56 | + python_requires=">=3.6.0", |
| 57 | + install_requires=install_requires, |
| 58 | + classifiers=[ |
| 59 | + "Intended Audience :: Developers", |
| 60 | + "Intended Audience :: Education", |
| 61 | + "Intended Audience :: Science/Research", |
| 62 | + "License :: OSI Approved :: Apache Software License", |
| 63 | + "Operating System :: OS Independent", |
| 64 | + "Programming Language :: Python :: 3", |
| 65 | + "Topic :: Scientific/Engineering :: Artificial Intelligence", |
| 66 | + ], |
| 67 | +) |
0 commit comments