From f2e223ffd131d69bea7206dd9f7c9bbf724200ed Mon Sep 17 00:00:00 2001 From: Adam Stus Date: Wed, 4 Dec 2024 18:30:52 +0100 Subject: [PATCH] Fixed precommit errors --- .pre-commit-config.yaml | 4 ++++ tests/nativeapp/test_artifacts.py | 2 +- .../projects/streamlit_templated_v1/streamlit_app.py | 5 +++++ tests_integration/conftest.py | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f2fa52cfec..73d97beea8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,10 @@ repos: hooks: - id: mypy additional_dependencies: [types-pkg-resources==0.1.3, types-all==1.0.0] + exclude: > + (?x) + ^tests/test_data/projects/.*| + ^tests_integration/test_data/projects/.* - repo: https://github.com/codespell-project/codespell rev: v2.2.4 hooks: diff --git a/tests/nativeapp/test_artifacts.py b/tests/nativeapp/test_artifacts.py index b098e987ce..6cec78e676 100644 --- a/tests/nativeapp/test_artifacts.py +++ b/tests/nativeapp/test_artifacts.py @@ -19,6 +19,7 @@ import pytest from click import ClickException from snowflake.cli._plugins.nativeapp.artifacts import ( + VersionInfo, build_bundle, find_events_definitions_in_manifest_file, find_version_info_in_manifest_file, @@ -29,7 +30,6 @@ NotInDeployRootError, SourceNotFoundError, TooManyFilesError, - VersionInfo, ) from snowflake.cli.api.project.definition import load_project from snowflake.cli.api.project.schemas.entities.common import PathMapping diff --git a/tests/test_data/projects/streamlit_templated_v1/streamlit_app.py b/tests/test_data/projects/streamlit_templated_v1/streamlit_app.py index e69de29bb2..1a8695c60d 100644 --- a/tests/test_data/projects/streamlit_templated_v1/streamlit_app.py +++ b/tests/test_data/projects/streamlit_templated_v1/streamlit_app.py @@ -0,0 +1,5 @@ +from common.hello import say_hello + +import streamlit as st + +st.title(f"Example streamlit app. {say_hello()}") diff --git a/tests_integration/conftest.py b/tests_integration/conftest.py index 6be62f1ce5..1ac9bda801 100644 --- a/tests_integration/conftest.py +++ b/tests_integration/conftest.py @@ -266,5 +266,8 @@ def enable_snowpark_glob_support_feature_flag(): with mock.patch( f"snowflake.cli.api.feature_flags.FeatureFlag.ENABLE_SNOWPARK_GLOB_SUPPORT.is_enabled", return_value=True, + ), mock.patch( + f"snowflake.cli.api.feature_flags.FeatureFlag.ENABLE_SNOWPARK_GLOB_SUPPORT.is_disabled", + return_value=False, ): yield