gradio

Форк
0
/
pyproject.toml 
170 строк · 5.1 Кб
1
[build-system]
2
requires = [
3
  "hatchling",
4
  "hatch-requirements-txt",
5
  "hatch-fancy-pypi-readme>=22.5.0",
6
]
7
build-backend = "hatchling.build"
8

9
[project]
10
name = "gradio"
11
dynamic = ["version", "dependencies", "optional-dependencies", "readme"]
12
description = "Python library for easily interacting with trained machine learning models"
13
license = "Apache-2.0"
14
requires-python = ">=3.8"
15
authors = [
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
]
26
keywords = ["machine learning", "reproducibility", "visualization"]
27

28
classifiers = [
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]
44
gradio = "gradio.cli:cli"
45
upload_theme = "gradio.themes.upload_theme:main"
46

47
[project.urls]
48
Homepage = "https://github.com/gradio-app/gradio"
49

50
[tool.hatch.version]
51
path = "gradio/package.json"
52
pattern = ".*\"version\":\\s*\"(?P<version>[^\"]+)\""
53

54
[tool.hatch.metadata.hooks.requirements_txt]
55
filename = "requirements.txt"
56

57
[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies]
58
oauth = ["requirements-oauth.txt"]
59

60
[tool.hatch.metadata.hooks.fancy-pypi-readme]
61
content-type = "text/markdown"
62
fragments = [{ path = "README.md" }]
63

64
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
65
pattern = "(website/homepage|readme_files)/"
66
replacement = 'https://raw.githubusercontent.com/gradio-app/gradio/main/\g<1>/'
67

68
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
69
pattern = 'demo/([\S]*.gif)'
70
replacement = 'https://raw.githubusercontent.com/gradio-app/gradio/main/demo/\g<1>'
71

72
[tool.hatch.build]
73
artifacts = [
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]
82
path = ".config/copy_frontend.py"
83

84
[tool.hatch.build.targets.sdist]
85
include = [
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]
97
include = ["gradio/**/*.py"]
98
exclude = [
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]
108
exclude = ["gradio/node/*.py", ".venv/*", "gradio/_frontend_code/*.py"]
109

110
[tool.ruff.lint]
111
extend-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
]
125
ignore = [
126
  "B008",    # function call in argument defaults
127
  "B017",    # pytest.raises considered evil
128
  "B023",    # function definition in loop (TODO: un-ignore this)
129
  "B028",    # explicit stacklevel for warnings
130
  "C901",    # function is too complex (TODO: un-ignore this)
131
  "E501",    # from scripts/lint_backend.sh
132
  "PLR091",  # complexity rules
133
  "PLR2004", # magic numbers
134
  "PLW2901", # `for` loop variable overwritten by assignment target
135
  "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 top
145
  "E741", # Demos may have ambiguous variable names
146
  "F405", # Demos may use star imports
147
  "I",    # Don't care about import order
148
]
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 such
158
]
159
"client/python/test/*" = [
160
  "ARG",
161
  "S101", # tests may use assertions
162
]
163
"test/*" = [
164
  "ARG",
165
  "S101", # tests may use assertions
166
]
167

168
[tool.pytest.ini_options]
169
GRADIO_ANALYTICS_ENABLED = "False"
170
filterwarnings = ["ignore::UserWarning:gradio.*:", "ignore::DeprecationWarning:gradio.*:"]
171

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.