code: def test_prepare_lightning_wheels_and_requirement(tmpdir):
      """This test ensures the lightning source gets packaged inside the lightning repo."""
      package_name = "lightning"
      if not get_dist_path_if_editable_install(package_name):
          pytest.skip("Requires --editable install")
  
      git_dir_name = (
          get_dir_name() if check_github_repository() else None
      )
      if git_dir_name != package_name:
          pytest.skip("Needs to be run from within the repo")
  
      cleanup_handle = _prepare_lightning_wheels_and_requirements(
          tmpdir, package_name=package_name
      )
      assert len(os.listdir(tmpdir)) == 1
      assert len(glob.glob(str(tmpdir / "lightning-*.tar.gz"))) == 1
  
      cleanup_handle()
      assert os.listdir(tmpdir) == []
  
file_path: pytorch-lightning/tests/tests_app/utilities/packaging/test_lightning_utils.py
imports: import glob
  import os
  from unittest import mock
  import pytest
  from lightning.app.testing.helpers import _RunIf
  from lightning.app.utilities.git import check_github_repository, get_dir_name
  from lightning.app.utilities.packaging import lightning_utils
  from lightning.app.utilities.packaging.lightning_utils import _prepare_lightning_wheels_and_requirements, _verify_lightning_version, get_dist_path_if_editable_install
  from lightning_utilities.core.imports import module_available
label_desc: Use image node_id 1 for calling a global function with example usage: test_prepare_lightning_wheels_and_requirement(tmpdir) without return types