2022-09-15 05:39:46 +08:00
|
|
|
[build-system]
|
2023-10-31 12:46:02 +08:00
|
|
|
requires = [
|
|
|
|
"hatchling",
|
|
|
|
"hatch-requirements-txt",
|
|
|
|
"hatch-fancy-pypi-readme>=22.5.0",
|
|
|
|
]
|
2022-09-15 05:39:46 +08:00
|
|
|
build-backend = "hatchling.build"
|
|
|
|
|
|
|
|
[project]
|
|
|
|
name = "gradio"
|
2023-08-11 03:12:40 +08:00
|
|
|
dynamic = ["version", "dependencies", "optional-dependencies", "readme"]
|
2022-09-15 05:39:46 +08:00
|
|
|
description = "Python library for easily interacting with trained machine learning models"
|
|
|
|
license = "Apache-2.0"
|
2023-06-14 09:52:33 +08:00
|
|
|
requires-python = ">=3.8"
|
2022-09-15 05:39:46 +08:00
|
|
|
authors = [
|
2023-12-21 03:07:48 +08:00
|
|
|
{ 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" },
|
2022-09-15 05:39:46 +08:00
|
|
|
]
|
|
|
|
keywords = ["machine learning", "reproducibility", "visualization"]
|
|
|
|
|
2023-06-01 14:18:23 +08:00
|
|
|
classifiers = [
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
'License :: OSI Approved :: Apache Software License',
|
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3 :: Only',
|
|
|
|
'Programming Language :: Python :: 3.8',
|
|
|
|
'Programming Language :: Python :: 3.9',
|
|
|
|
'Programming Language :: Python :: 3.10',
|
|
|
|
'Programming Language :: Python :: 3.11',
|
|
|
|
'Topic :: Scientific/Engineering',
|
|
|
|
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
|
|
|
'Topic :: Scientific/Engineering :: Visualization',
|
|
|
|
]
|
|
|
|
|
2022-09-15 05:39:46 +08:00
|
|
|
[project.scripts]
|
2023-05-31 09:13:46 +08:00
|
|
|
gradio = "gradio.cli:cli"
|
2023-03-19 11:15:02 +08:00
|
|
|
upload_theme = "gradio.themes.upload_theme:main"
|
2022-09-15 05:39:46 +08:00
|
|
|
|
|
|
|
[project.urls]
|
|
|
|
Homepage = "https://github.com/gradio-app/gradio"
|
|
|
|
|
|
|
|
[tool.hatch.version]
|
2023-09-16 07:23:52 +08:00
|
|
|
path = "gradio/package.json"
|
|
|
|
pattern = ".*\"version\":\\s*\"(?P<version>[^\"]+)\""
|
2022-09-15 05:39:46 +08:00
|
|
|
|
|
|
|
[tool.hatch.metadata.hooks.requirements_txt]
|
|
|
|
filename = "requirements.txt"
|
|
|
|
|
2023-08-11 03:12:40 +08:00
|
|
|
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
|
|
|
|
oauth = ["requirements-oauth.txt"]
|
|
|
|
|
2022-09-15 05:39:46 +08:00
|
|
|
[tool.hatch.metadata.hooks.fancy-pypi-readme]
|
|
|
|
content-type = "text/markdown"
|
2023-10-31 12:46:02 +08:00
|
|
|
fragments = [{ path = "README.md" }]
|
2022-09-15 05:39:46 +08:00
|
|
|
|
|
|
|
[[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",
|
2023-10-31 12:46:02 +08:00
|
|
|
"/gradio/_frontend_code",
|
|
|
|
"*.pyi",
|
|
|
|
"/gradio/node",
|
2024-02-01 08:46:55 +08:00
|
|
|
"py.typed",
|
2022-09-15 05:39:46 +08:00
|
|
|
]
|
|
|
|
|
2023-10-31 12:46:02 +08:00
|
|
|
[tool.hatch.build.targets.wheel.hooks.custom]
|
|
|
|
path = ".config/copy_frontend.py"
|
2023-03-19 11:15:02 +08:00
|
|
|
|
2022-09-15 05:39:46 +08:00
|
|
|
[tool.hatch.build.targets.sdist]
|
|
|
|
include = [
|
|
|
|
"/gradio",
|
|
|
|
"/test",
|
|
|
|
"/README.md",
|
|
|
|
"/requirements.txt",
|
2023-08-11 05:35:53 +08:00
|
|
|
"/requirements-oauth.txt",
|
2023-10-31 12:46:02 +08:00
|
|
|
"/.config/copy_frontend.py",
|
|
|
|
"/js",
|
|
|
|
"/client/js",
|
2022-09-15 05:39:46 +08:00
|
|
|
]
|
2023-04-04 06:48:18 +08:00
|
|
|
|
2023-07-19 01:31:53 +08:00
|
|
|
[tool.pyright]
|
|
|
|
include = ["gradio/**/*.py"]
|
2023-10-31 12:46:02 +08:00
|
|
|
exclude = [
|
|
|
|
"gradio/themes/",
|
|
|
|
"gradio/_frontend_code/",
|
|
|
|
"gradio/components/*_plot.py",
|
|
|
|
"gradio/ipython_ext.py",
|
2024-01-31 05:30:27 +08:00
|
|
|
"gradio/node/*.py",
|
2024-02-01 08:46:55 +08:00
|
|
|
"gradio/_frontend_code/*.py",
|
2023-10-31 12:46:02 +08:00
|
|
|
]
|
2023-07-19 01:31:53 +08:00
|
|
|
|
2023-04-04 06:48:18 +08:00
|
|
|
[tool.ruff]
|
2024-02-21 10:36:10 +08:00
|
|
|
exclude = ["gradio/node/*.py", ".venv/*", "gradio/_frontend_code/*.py"]
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
2024-02-02 03:32:40 +08:00
|
|
|
extend-select = [
|
|
|
|
"ARG",
|
|
|
|
"B",
|
|
|
|
"C",
|
|
|
|
"E",
|
|
|
|
"F",
|
|
|
|
"I",
|
|
|
|
"N",
|
|
|
|
"PL",
|
2024-02-21 10:36:10 +08:00
|
|
|
"S101",
|
2024-02-02 03:32:40 +08:00
|
|
|
"SIM",
|
|
|
|
"UP",
|
|
|
|
"W",
|
|
|
|
]
|
2023-04-04 06:48:18 +08:00
|
|
|
ignore = [
|
2024-02-02 03:32:40 +08:00
|
|
|
"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
|
|
|
|
"C901", # function is too complex (TODO: un-ignore this)
|
|
|
|
"E501", # from scripts/lint_backend.sh
|
|
|
|
"PLR091", # complexity rules
|
|
|
|
"PLR2004", # magic numbers
|
|
|
|
"PLW2901", # `for` loop variable overwritten by assignment target
|
|
|
|
"SIM105", # 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)
|
2023-04-04 06:48:18 +08:00
|
|
|
]
|
|
|
|
|
2024-02-21 10:36:10 +08:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
2023-04-04 06:48:18 +08:00
|
|
|
"demo/*" = [
|
2024-02-02 03:32:40 +08:00
|
|
|
"ARG",
|
2023-04-04 06:48:18 +08:00
|
|
|
"E402", # Demos may have imports not at the top
|
|
|
|
"E741", # Demos may have ambiguous variable names
|
|
|
|
"F405", # Demos may use star imports
|
2023-10-31 12:46:02 +08:00
|
|
|
"I", # Don't care about import order
|
2023-04-04 06:48:18 +08:00
|
|
|
]
|
|
|
|
"gradio/__init__.py" = [
|
|
|
|
"F401", # "Imported but unused" (TODO: it would be better to be explicit and use __all__)
|
|
|
|
]
|
2023-05-05 10:54:23 +08:00
|
|
|
"gradio/routes.py" = [
|
|
|
|
"UP006", # Pydantic on Python 3.7 requires old-style type annotations (TODO: drop when Python 3.7 is dropped)
|
|
|
|
]
|
2023-10-31 12:46:02 +08:00
|
|
|
"gradio/cli/commands/files/NoTemplateComponent.py" = ["ALL"]
|
2024-02-02 03:32:40 +08:00
|
|
|
"client/python/gradio_client/serializing.py" = [
|
|
|
|
"ARG", # contains backward compatibility code, so args need to be named as such
|
|
|
|
]
|
|
|
|
"client/python/test/*" = [
|
|
|
|
"ARG",
|
2024-02-21 10:36:10 +08:00
|
|
|
"S101", # tests may use assertions
|
2024-02-02 03:32:40 +08:00
|
|
|
]
|
|
|
|
"test/*" = [
|
|
|
|
"ARG",
|
2024-02-21 10:36:10 +08:00
|
|
|
"S101", # tests may use assertions
|
2024-02-02 03:32:40 +08:00
|
|
|
]
|
2023-07-12 23:19:39 +08:00
|
|
|
|
|
|
|
[tool.pytest.ini_options]
|
2023-10-31 12:46:02 +08:00
|
|
|
GRADIO_ANALYTICS_ENABLED = "False"
|
2024-02-08 00:13:48 +08:00
|
|
|
filterwarnings = ["ignore::UserWarning:gradio.*:", "ignore::DeprecationWarning:gradio.*:"]
|