Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build config #5710

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[build-system]
requires = ["hatchling", "hatch-requirements-txt", "hatch-fancy-pypi-readme>=22.5.0"]
requires = [
"hatchling",
"hatch-requirements-txt",
"hatch-fancy-pypi-readme>=22.5.0",
]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -54,9 +58,7 @@ oauth = ["requirements-oauth.txt"]

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

[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = "(website/homepage|readme_files)/"
Expand All @@ -71,7 +73,7 @@ artifacts = [
"/gradio/templates",
"/gradio/_frontend_code",
"*.pyi",
"/gradio/node"
"/gradio/node",
]

[tool.hatch.build.targets.wheel.hooks.custom]
Expand All @@ -85,42 +87,41 @@ include = [
"/requirements.txt",
"/requirements-oauth.txt",
"/.config/copy_frontend.py",
"/js"
"/js",
"/client/js",
]

[tool.pyright]
include = ["gradio/**/*.py"]
exclude = ["gradio/themes/", "gradio/_frontend_code/", "gradio/components/*_plot.py", "gradio/ipython_ext.py"]
exclude = [
"gradio/themes/",
"gradio/_frontend_code/",
"gradio/components/*_plot.py",
"gradio/ipython_ext.py",
]

[tool.ruff]
target-version = "py37"
extend-select = [
"B",
"C",
"I",
"N",
"SIM",
"UP",
]
extend-select = ["B", "C", "I", "N", "SIM", "UP"]
ignore = [
"C901", # function is too complex (TODO: un-ignore this)
"B023", # function definition in loop (TODO: un-ignore this)
"B008", # function call in argument defaults
"B017", # pytest.raises considered evil
"B028", # explicit stacklevel for warnings
"E501", # from scripts/lint_backend.sh
"C901", # function is too complex (TODO: un-ignore this)
"B023", # function definition in loop (TODO: un-ignore this)
"B008", # function call in argument defaults
"B017", # pytest.raises considered evil
"B028", # explicit stacklevel for warnings
"E501", # from scripts/lint_backend.sh
"SIM105", # contextlib.suppress (has a performance cost)
"SIM117", # multiple nested with blocks (doesn't look good with gr.Row etc)
"UP007", # use X | Y for type annotations (TODO: can be enabled once Pydantic plays nice with them)
"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)
"UP006", # use `list` instead of `List` for type annotations (fails for 3.8)
]

[tool.ruff.per-file-ignores]
"demo/*" = [
"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
"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__)
Expand All @@ -131,4 +132,4 @@ ignore = [
"gradio/cli/commands/files/NoTemplateComponent.py" = ["ALL"]

[tool.pytest.ini_options]
GRADIO_ANALYTICS_ENABLED = "False"
GRADIO_ANALYTICS_ENABLED = "False"
Loading