code: def test_pip_with_env_vars(start_cluster, tmp_path):
      with chdir(tmp_path):
          TEST_ENV_NAME = "TEST_ENV_VARS"
          TEST_ENV_VALUE = "TEST"
          package_name = "test_package"
          package_dir = os.path.join(tmp_path, package_name)
          try_to_create_directory(package_dir)
  
          setup_filename = os.path.join(package_dir, "setup.py")
          setup_code = """import os
  from setuptools import setup, find_packages
  from setuptools.command.install import install
  
  class InstallTestPackage(install):
      # this function will be called when pip install this package
      def run(self):
          assert os.environ.get('{TEST_ENV_NAME}') == '{TEST_ENV_VALUE}'
  
  setup(
      name='test_package',
      version='0.0.1',
      packages=find_packages(),
      cmdclass=dict(install=InstallTestPackage),
      license="MIT",
      zip_safe=False,
  )
  """.format(
              TEST_ENV_NAME=TEST_ENV_NAME, TEST_ENV_VALUE=TEST_ENV_VALUE
          )
          with open(setup_filename, "wt") as f:
              f.writelines(setup_code)
  
          python_filename = os.path.join(package_dir, "test.py")
          python_code = "import os; print(os.environ)"
          with open(python_filename, "wt") as f:
              f.writelines(python_code)
  
          gz_filename = os.path.join(tmp_path, package_name + ".tar.gz")
          subprocess.check_call(
              ["tar", "-zcvf", gz_filename, package_name]
          )
  
          with pytest.raises(ray.exceptions.RuntimeEnvSetupError):
  
              @ray.remote(
                  runtime_env={
                      "env_vars": {TEST_ENV_NAME: "failed"},
                      "pip": [gz_filename],
                  }
              )
              def f1():
                  return True
  
              ray.get(f1.remote())
  
          @ray.remote(
              runtime_env={
                  "env_vars": {TEST_ENV_NAME: TEST_ENV_VALUE},
                  "pip": [gz_filename],
              }
          )
          def f2():
              return True
  
          assert ray.get(f2.remote())
  
imports: import os
  import platform
  from pathlib import Path
  import pytest
  import subprocess
  import sys
  import tempfile
  import time
  from typing import List
  from unittest import mock
  import yaml
  import ray
  from ray.runtime_env import RuntimeEnv
  from ray._private.runtime_env.conda import inject_dependencies, _inject_ray_to_conda_site, _resolve_install_from_source_ray_dependencies, _current_py_version
  from ray._private.runtime_env.conda_utils import get_conda_env_list
  from ray._private.test_utils import run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition, chdir
  from ray._private.utils import get_conda_env_dir, get_conda_bin_executable, try_to_create_directory
label_desc: Use image node_id 25 for calling a global function with example usage: test_pip_with_env_vars(start_cluster, tmp_path) and returns: True, True