code: def pip_compile(*packages: str):
      
      result = None
      packages = "\n".join(packages)
  
      with tempfile.TemporaryDirectory() as tmp_dirname, cwd(tmp_dirname):
          with open("requirements.in", "w") as requirements_file:
              requirements_file.write(packages)
  
          runner = CliRunner()
  
          try:
              result = runner.invoke(cli, ["requirements.in"], catch_exceptions=False)
          except Exception as exc:
              raise ThothPipCompileError(str(exc)) from exc
  
          if result.exit_code != 0:
              error_msg = (
                  f"pip-compile returned non-zero ({result.exit_code:d}) " f"output: {result.output_bytes.decode():s}"
              )
              raise ThothPipCompileError(error_msg)
  
      return result.output_bytes.decode()
docs: Run pip-compile to pin down packages, also resolve their transitive dependencies.