From 16e91a00de32a657c074b88a4ec54abf9f371850 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 26 Mar 2024 21:24:17 -0300 Subject: [PATCH] Update mypy configuration to include namespace packages --- Makefile | 2 +- src/backend/base/langflow/py.typed | 0 src/backend/base/pyproject.toml | 8 +++++++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 src/backend/base/langflow/py.typed diff --git a/Makefile b/Makefile index 96b58f62c..256436af4 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ format: lint: make install_backend - poetry run mypy src/backend + poetry run mypy --namespace-packages -p "langflow" poetry run ruff . --fix install_frontend: diff --git a/src/backend/base/langflow/py.typed b/src/backend/base/langflow/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/src/backend/base/pyproject.toml b/src/backend/base/pyproject.toml index b783807a6..d32780505 100644 --- a/src/backend/base/pyproject.toml +++ b/src/backend/base/pyproject.toml @@ -17,10 +17,11 @@ repository = "https://github.com/logspace-ai/langflow" license = "MIT" readme = "README.md" keywords = ["nlp", "langchain", "openai", "gpt", "gui"] -packages = [{ include = "langflow" }] +packages = [{ include = "langflow" }, { include = "py.typed" }] include = ["pyproject.toml", "README.md", "langflow/**/*"] documentation = "https://docs.langflow.org" + [tool.poetry.scripts] langflow-base = "langflow.__main__:main" @@ -106,6 +107,11 @@ filterwarnings = ["ignore::DeprecationWarning"] log_cli = true markers = ["async_test"] +[tool.mypy] +namespace_packages = true +mypy_path = "langflow" +ignore_missing_imports = true + [tool.ruff] exclude = ["src/backend/langflow/alembic/*"]