in noxfile.py [0:0]
def lint(session):
# Check that importing the client still works without optional dependencies
session.install(".", env=INSTALL_ENV)
session.run("python", "-c", "from elasticsearch import Elasticsearch")
session.run("python", "-c", "from elasticsearch._otel import OpenTelemetry")
session.install(
"flake8",
"black~=25.0",
"mypy",
"isort~=6.0",
"types-requests",
"types-python-dateutil",
"unasync>=0.6.0",
)
session.run("isort", "--check", "--profile=black", *SOURCE_FILES)
session.run("black", "--check", *SOURCE_FILES)
session.run("python", "utils/run-unasync.py", "--check")
session.run("python", "utils/run-unasync-dsl.py", "--check")
session.run("flake8", *SOURCE_FILES)
session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES)
session.install(".[async,requests,orjson,pyarrow,vectorstore_mmr]", env=INSTALL_ENV)
# Run mypy on the package, the type examples and the DSL examples
session.run(
"mypy",
"--strict",
"--implicit-reexport",
"--explicit-package-bases",
"--show-error-codes",
"--enable-error-code=ignore-without-code",
"elasticsearch/",
"test_elasticsearch/test_types/",
"examples/dsl/",
)
# Make sure we don't require aiohttp to be installed for users to
# receive type hint information from mypy.
session.run("python", "-m", "pip", "uninstall", "--yes", "aiohttp")
session.run(
"mypy",
"--strict",
"--implicit-reexport",
"--explicit-package-bases",
"--show-error-codes",
"elasticsearch/",
"test_elasticsearch/test_types/sync_types.py",
)