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

Provide option to skip Conda verification step #129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion snowflake/ml/_internal/env_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import collections
import copy
import pathlib
import os
import re
import textwrap
import warnings
Expand Down Expand Up @@ -37,6 +38,8 @@ class CONDA_OS(Enum):
SNOWPARK_ML_PKG_NAME = "snowflake-ml-python"
SNOWFLAKE_CONDA_CHANNEL_URL = "https://repo.anaconda.com/pkgs/snowflake"

# defaults to None. Any value for SKIP_CONDA_CHECK will skip the Conda verification step.
SKIP_CONDA_CHECK = os.getenv("SKIP_CONDA_CHECK")

def _validate_pip_requirement_string(req_str: str) -> requirements.Requirement:
"""Validate the input pip requirement string according to PEP 508.
Expand Down Expand Up @@ -371,7 +374,7 @@ def get_matched_package_versions_in_snowflake_conda_channel(

url = f"{SNOWFLAKE_CONDA_CHANNEL_URL}/{conda_os.value}/repodata.json"

if req.name not in _SNOWFLAKE_CONDA_PACKAGE_CACHE:
if req.name not in _SNOWFLAKE_CONDA_PACKAGE_CACHE and not SKIP_CONDA_CHECK:
try:
http_client = retryable_http.get_http_client()
parsed_python_version = version.Version(python_version)
Expand Down