gradio
/
pyproject.toml
170 строк · 5.1 Кб
1[build-system]2requires = [3"hatchling",4"hatch-requirements-txt",5"hatch-fancy-pypi-readme>=22.5.0",6]
7build-backend = "hatchling.build"8
9[project]10name = "gradio"11dynamic = ["version", "dependencies", "optional-dependencies", "readme"]12description = "Python library for easily interacting with trained machine learning models"13license = "Apache-2.0"14requires-python = ">=3.8"15authors = [16{ name = "Abubakar Abid", email = "gradio-team@huggingface.co" },17{ name = "Ali Abid", email = "gradio-team@huggingface.co" },18{ name = "Ali Abdalla", email = "gradio-team@huggingface.co" },19{ name = "Dawood Khan", email = "gradio-team@huggingface.co" },20{ name = "Ahsen Khaliq", email = "gradio-team@huggingface.co" },21{ name = "Pete Allen", email = "gradio-team@huggingface.co" },22{ name = "Ömer Faruk Özdemir", email = "gradio-team@huggingface.co" },23{ name = "Freddy A Boulton", email = "gradio-team@huggingface.co" },24{ name = "Hannah Blair", email = "gradio-team@huggingface.co" },25]
26keywords = ["machine learning", "reproducibility", "visualization"]27
28classifiers = [29'Development Status :: 5 - Production/Stable',30'License :: OSI Approved :: Apache Software License',31'Operating System :: OS Independent',32'Programming Language :: Python :: 3',33'Programming Language :: Python :: 3 :: Only',34'Programming Language :: Python :: 3.8',35'Programming Language :: Python :: 3.9',36'Programming Language :: Python :: 3.10',37'Programming Language :: Python :: 3.11',38'Topic :: Scientific/Engineering',39'Topic :: Scientific/Engineering :: Artificial Intelligence',40'Topic :: Scientific/Engineering :: Visualization',41]
42
43[project.scripts]44gradio = "gradio.cli:cli"45upload_theme = "gradio.themes.upload_theme:main"46
47[project.urls]48Homepage = "https://github.com/gradio-app/gradio"49
50[tool.hatch.version]51path = "gradio/package.json"52pattern = ".*\"version\":\\s*\"(?P<version>[^\"]+)\""53
54[tool.hatch.metadata.hooks.requirements_txt]55filename = "requirements.txt"56
57[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]58oauth = ["requirements-oauth.txt"]59
60[tool.hatch.metadata.hooks.fancy-pypi-readme]61content-type = "text/markdown"62fragments = [{ path = "README.md" }]63
64[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]65pattern = "(website/homepage|readme_files)/"66replacement = 'https://raw.githubusercontent.com/gradio-app/gradio/main/\g<1>/'67
68[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]69pattern = 'demo/([\S]*.gif)'70replacement = 'https://raw.githubusercontent.com/gradio-app/gradio/main/demo/\g<1>'71
72[tool.hatch.build]73artifacts = [74"/gradio/templates",75"/gradio/_frontend_code",76"*.pyi",77"/gradio/node",78"py.typed",79]
80
81[tool.hatch.build.targets.wheel.hooks.custom]82path = ".config/copy_frontend.py"83
84[tool.hatch.build.targets.sdist]85include = [86"/gradio",87"/test",88"/README.md",89"/requirements.txt",90"/requirements-oauth.txt",91"/.config/copy_frontend.py",92"/js",93"/client/js",94]
95
96[tool.pyright]97include = ["gradio/**/*.py"]98exclude = [99"gradio/themes/",100"gradio/_frontend_code/",101"gradio/components/*_plot.py",102"gradio/ipython_ext.py",103"gradio/node/*.py",104"gradio/_frontend_code/*.py",105]
106
107[tool.ruff]108exclude = ["gradio/node/*.py", ".venv/*", "gradio/_frontend_code/*.py"]109
110[tool.ruff.lint]111extend-select = [112"ARG",113"B",114"C",115"E",116"F",117"I",118"N",119"PL",120"S101",121"SIM",122"UP",123"W",124]
125ignore = [126"B008", # function call in argument defaults127"B017", # pytest.raises considered evil128"B023", # function definition in loop (TODO: un-ignore this)129"B028", # explicit stacklevel for warnings130"C901", # function is too complex (TODO: un-ignore this)131"E501", # from scripts/lint_backend.sh132"PLR091", # complexity rules133"PLR2004", # magic numbers134"PLW2901", # `for` loop variable overwritten by assignment target135"SIM105", # contextlib.suppress (has a performance cost)136"SIM117", # multiple nested with blocks (doesn't look good with gr.Row etc)137"UP006", # use `list` instead of `List` for type annotations (fails for 3.8)138"UP007", # use X | Y for type annotations (TODO: can be enabled once Pydantic plays nice with them)139]
140
141[tool.ruff.lint.per-file-ignores]142"demo/*" = [143"ARG",144"E402", # Demos may have imports not at the top145"E741", # Demos may have ambiguous variable names146"F405", # Demos may use star imports147"I", # Don't care about import order148]
149"gradio/__init__.py" = [150"F401", # "Imported but unused" (TODO: it would be better to be explicit and use __all__)151]
152"gradio/routes.py" = [153"UP006", # Pydantic on Python 3.7 requires old-style type annotations (TODO: drop when Python 3.7 is dropped)154]
155"gradio/cli/commands/files/NoTemplateComponent.py" = ["ALL"]156"client/python/gradio_client/serializing.py" = [157"ARG", # contains backward compatibility code, so args need to be named as such158]
159"client/python/test/*" = [160"ARG",161"S101", # tests may use assertions162]
163"test/*" = [164"ARG",165"S101", # tests may use assertions166]
167
168[tool.pytest.ini_options]169GRADIO_ANALYTICS_ENABLED = "False"170filterwarnings = ["ignore::UserWarning:gradio.*:", "ignore::DeprecationWarning:gradio.*:"]171