Files
wehub-resource-sync adf0d17497
publish / version_or_publish (push) Has been cancelled
storybook-build / changes (push) Has been cancelled
storybook-build / :storybook-build (push) Has been cancelled
Sync Gradio Skills to Hugging Face / sync-skills (push) Has been cancelled
functional / changes (push) Has been cancelled
functional / build-frontend (push) Has been cancelled
functional / functional-test-SSR=false (push) Has been cancelled
functional / functional-reload (push) Has been cancelled
js / changes (push) Has been cancelled
js / js-test (push) Has been cancelled
docs-build / changes (push) Has been cancelled
docs-build / docs-build (push) Has been cancelled
docs-build / website-build (push) Has been cancelled
functional / functional-test-SSR=true (push) Has been cancelled
hygiene / hygiene-test (push) Has been cancelled
python / changes (push) Has been cancelled
python / build (push) Has been cancelled
python / test-ubuntu-latest-flaky (push) Has been cancelled
python / test-ubuntu-latest-not-flaky (push) Has been cancelled
python / test-windows-latest-flaky (push) Has been cancelled
python / test-windows-latest-not-flaky (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:17:32 +08:00

189 lines
5.8 KiB
TOML

[build-system]
requires = [
"hatchling",
"hatch-requirements-txt",
"hatch-fancy-pypi-readme>=22.5.0",
]
build-backend = "hatchling.build"
[project]
name = "gradio"
dynamic = ["version", "dependencies", "optional-dependencies", "readme"]
description = "Python library for easily interacting with trained machine learning models"
license = "Apache-2.0"
requires-python = ">=3.10"
authors = [
{ name = "Abubakar Abid", email = "gradio-team@huggingface.co" },
{ name = "Ali Abid", email = "gradio-team@huggingface.co" },
{ name = "Ali Abdalla", email = "gradio-team@huggingface.co" },
{ name = "Dawood Khan", email = "gradio-team@huggingface.co" },
{ name = "Ahsen Khaliq", email = "gradio-team@huggingface.co" },
{ name = "Pete Allen", email = "gradio-team@huggingface.co" },
{ name = "Ömer Faruk Özdemir", email = "gradio-team@huggingface.co" },
{ name = "Freddy A Boulton", email = "gradio-team@huggingface.co" },
{ name = "Hannah Blair", email = "gradio-team@huggingface.co" },
]
keywords = ["machine learning", "reproducibility", "visualization"]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Visualization',
]
[project.scripts]
gradio = "gradio.cli:cli"
upload_theme = "gradio.themes.upload_theme:main"
[project.urls]
Homepage = "https://github.com/gradio-app/gradio"
[tool.hatch.version]
path = "gradio/package.json"
pattern = ".*\"version\":\\s*\"(?P<version>[^\"]+)\""
[tool.hatch.metadata.hooks.requirements_txt]
filename = "requirements.txt"
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
oauth = ["requirements-oauth.txt"]
mcp = ["requirements-mcp.txt"]
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
fragments = [{ path = "README.md" }]
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = "(website/homepage|readme_files)/"
replacement = 'https://raw.githubusercontent.com/gradio-app/gradio/main/\g<1>/'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = 'demo/([\S]*.gif)'
replacement = 'https://raw.githubusercontent.com/gradio-app/gradio/main/demo/\g<1>'
[tool.hatch.build]
artifacts = [
"/gradio/templates",
"/gradio/_frontend_code",
"*.pyi",
"/gradio/node",
"/gradio/py.typed",
]
[tool.hatch.build.targets.sdist]
include = [
"/gradio",
"/test",
"/README.md",
"/requirements.txt",
"/requirements-oauth.txt",
"/.config/copy_frontend.py",
"/js",
"/client/js",
]
[tool.ty]
environment.extra-paths = ["gradio/stubs"]
[tool.ty.src]
include = ["gradio/**/*.py", "demo/**/*.py", "test/**/*.py"]
exclude = [
"gradio/themes/",
"gradio/_frontend_code/",
"gradio/components/*_plot.py",
"gradio/node/*.py",
"gradio/_frontend_code/*.py",
"gradio/cli/commands/cli_env_info.py",
"demo/scratch/**",
"gradio/_vendor/**",
]
[tool.uv]
exclude-newer = "7 days"
exclude-newer-package = {hf-gradio = false, gradio-client = false, starlette = false}
[tool.ruff]
exclude = ["gradio/node/*.py", ".venv/*", "gradio/_frontend_code/*.py", "gradio/_vendor/*"]
[tool.ruff.lint]
extend-select = [
"ARG",
"B",
"C",
"E",
"F",
"I",
"N",
"PL",
"S101",
"SIM",
"UP",
"W",
]
ignore = [
"B008", # function call in argument defaults
"B017", # pytest.raises considered evil
"B023", # function definition in loop (TODO: un-ignore this)
"B028", # explicit stacklevel for warnings
"B905", # zip without explicit `strict` argument
"C901", # function is too complex (TODO: un-ignore this)
"E501", # from scripts/lint_backend.sh
"PLC0415", # import-outside-toplevel
"PLR091", # complexity rules
"PLR2004", # magic numbers
"PLW1641", # Object does not have `__hash__` attribute
"PLW2901", # `for` loop variable overwritten by assignment target
"SIM105", # contextlib.suppress (has a performance cost)
"SIM115", # contextlib.suppress (has a performance cost)
"SIM117", # multiple nested with blocks (doesn't look good with gr.Row etc)
"UP006", # use `list` instead of `List` for type annotations (fails for 3.8)
"UP007", # use X | Y for type annotations (TODO: can be enabled once Pydantic plays nice with them)
"UP038", # uses of isinstance and issubclass that take a tuple of types for comparison.
"UP045", # use `|` instead of `Union` for type annotations (TODO: can be enabled once Pydantic plays nice with them)
]
[tool.ruff.lint.per-file-ignores]
"demo/*" = [
"ARG",
"E402", # Demos may have imports not at the top
"E741", # Demos may have ambiguous variable names
"F405", # Demos may use star imports
"I", # Don't care about import order
]
"gradio/__init__.py" = [
"F401", # "Imported but unused" (TODO: it would be better to be explicit and use __all__)
]
"gradio/routes.py" = [
"UP006", # Pydantic on Python 3.7 requires old-style type annotations (TODO: drop when Python 3.7 is dropped)
]
"gradio/cli/commands/files/NoTemplateComponent.py" = ["ALL"]
"client/python/gradio_client/serializing.py" = [
"ARG", # contains backward compatibility code, so args need to be named as such
]
"client/python/test/*" = [
"ARG",
"S101", # tests may use assertions
]
"test/*" = [
"ARG",
"S101", # tests may use assertions
]
"client/python/test/test_client.py" = [
"PLW0603", # using global to keep track of server progress
]
[tool.pytest.ini_options]
GRADIO_ANALYTICS_ENABLED = "False"
filterwarnings = [
"ignore::UserWarning:gradio.*:",
"ignore::DeprecationWarning:gradio.*:",
]