Reads the TPU requirements file and returns a list of dependencies.
()
| 21 | |
| 22 | |
| 23 | def get_tpu_dependencies(): |
| 24 | """Reads the TPU requirements file and returns a list of dependencies.""" |
| 25 | if not os.path.exists(TPU_REQUIREMENTS_PATH): |
| 26 | print(f"Warning: TPU requirements file not found at {TPU_REQUIREMENTS_PATH}. Skipping dependency injection.") |
| 27 | return [] |
| 28 | |
| 29 | with open(TPU_REQUIREMENTS_PATH, "r") as f: # pylint: disable=unspecified-encoding |
| 30 | # Filter out comments and empty lines |
| 31 | deps = [line.strip() for line in f if line.strip() and not line.strip().startswith("#")] |
| 32 | return deps |
| 33 | |
| 34 | |
| 35 | class CustomBuildHook(BuildHookInterface): |