gradio/pyproject.toml
Aarni Koskela ef3862e075
Switch linting to Ruff (#3710)
* Sort requirements.in

* Switch flake8 + isort to ruff

* Apply ruff import order fixes

* Fix ruff complaints in demo/

* Fix ruff complaints in test/

* Use `x is not y`, not `not x is y`

* Remove unused listdir from website generator

* Clean up duplicate dict keys

* Add changelog entry

* Clean up unused imports (except in gradio/__init__.py)

* add space

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-03 15:48:18 -07:00

87 lines
2.4 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", "readme"]
description = "Python library for easily interacting with trained machine learning models"
license = "Apache-2.0"
requires-python = ">=3.7"
authors = [
{ name = "Abubakar Abid", email = "team@gradio.app" },
{ name = "Ali Abid", email = "team@gradio.app" },
{ name = "Ali Abdalla", email = "team@gradio.app" },
{ name = "Dawood Khan", email = "team@gradio.app" },
{ name = "Ahsen Khaliq", email = "team@gradio.app" },
{ name = "Pete Allen", email = "team@gradio.app" },
{ name = "Ömer Faruk Özdemir", email = "team@gradio.app" },
]
keywords = ["machine learning", "reproducibility", "visualization"]
[project.scripts]
gradio = "gradio.reload:run_in_reload_mode"
upload_theme = "gradio.themes.upload_theme:main"
[project.urls]
Homepage = "https://github.com/gradio-app/gradio"
[tool.hatch.version]
path = "gradio/version.txt"
pattern = "(?P<version>.+)"
[tool.hatch.metadata.hooks.requirements_txt]
filename = "requirements.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",
]
[tool.hatch.build.targets.sdist]
include = [
"/gradio",
"/test",
"/README.md",
"/requirements.txt",
]
[tool.ruff]
target-version = "py37"
extend-select = [
"I",
]
ignore = [
"E501", # from scripts/lint_backend.sh
"E722", # from scripts/lint_backend.sh
"E731", # from scripts/lint_backend.sh
"F403", # from scripts/lint_backend.sh
"F541", # from scripts/lint_backend.sh
]
[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
]
"gradio/__init__.py" = [
"F401", # "Imported but unused" (TODO: it would be better to be explicit and use __all__)
]