code: def test_repository_package(tmp_path, monkeypatch):
      """LocalRepository.package() creates package from local dir."""
      cache_path = Path(tmp_path)
      source_path = cache_path / "nested"
      source_path.mkdir(parents=True, exist_ok=True)
      (source_path / "test.txt").write_text("test")
  
      repository = LocalSourceCodeDir(path=source_path)
      repository.cache_location = cache_path
      repository.package()
  
      # test that package is created
      for file in cache_path.glob("**/*"):
          if file.is_file() and file.name.endswith(".tar.gz"):
              assert file.name == f"{repository.version}.tar.gz"
  
file_path: pytorch-lightning/tests/tests_app/source_code/test_local.py
imports: import os
  import sys
  import tarfile
  import uuid
  from pathlib import Path
  from unittest import mock
  import pytest
  from lightning.app.source_code import LocalSourceCodeDir
label_desc: Use image node_id 4 for calling a global function with example usage: test_repository_package(tmp_path, monkeypatch) without return types