protoncloud-sdk 5.2.0__tar.gz → 5.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/PKG-INFO +1 -1
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/pyproject.toml +1 -1
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_git.py +7 -24
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/.gitignore +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/LICENSE +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/README.md +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/__init__.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_automation.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_client_parama.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_env.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_environment.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_files_and_resources.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_logs.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/proton_parameter.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/src/proton/run_status.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/tests/test_dados_da_execucao.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/tests/test_proton_env.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/tests/test_proton_environment.py +0 -0
- {protoncloud_sdk-5.2.0 → protoncloud_sdk-5.2.1}/tests/test_run_status.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "protoncloud-sdk"
|
|
7
|
-
version = "5.2.
|
|
7
|
+
version = "5.2.1"
|
|
8
8
|
description = "Proton Cloud SDK para Python: execução de automações, ambientes, logs, parâmetros e recursos."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Consulta dos repositórios Git cadastrados no Proton.
|
|
3
|
+
|
|
4
|
+
O clone de repositório saiu da SDK na 5.2.1: baixar o código é papel do runner, e o
|
|
5
|
+
clone levava o token do GitHub na linha de comando.
|
|
6
|
+
"""
|
|
7
|
+
|
|
1
8
|
import os
|
|
2
|
-
import subprocess
|
|
3
|
-
import threading
|
|
4
9
|
|
|
5
10
|
import requests
|
|
6
11
|
from proton.proton_client_parama import ProtonClientParam
|
|
7
12
|
from proton.proton_env import get_api_url, get_auth_header
|
|
8
|
-
from proton.proton_logs import set_log
|
|
9
13
|
|
|
10
14
|
|
|
11
15
|
def get_remote_repository(system_type):
|
|
@@ -62,27 +66,6 @@ def get_remote_header_hash(remote_authorization, repository, branch):
|
|
|
62
66
|
else:
|
|
63
67
|
return ""
|
|
64
68
|
|
|
65
|
-
def clone_repository(owner_repo, branch, commit_hash, authorization):
|
|
66
|
-
"""Clona um repositório Git."""
|
|
67
|
-
repo_folder = os.path.join(ProtonClientParam._repository_folder(), owner_repo, branch, commit_hash)
|
|
68
|
-
os.makedirs(repo_folder, exist_ok=True)
|
|
69
|
-
|
|
70
|
-
def run_git_clone(repo_folder, branch, authorization, owner_repo):
|
|
71
|
-
try:
|
|
72
|
-
url = f"https://{authorization}@github.com/{owner_repo}.git"
|
|
73
|
-
subprocess.run(
|
|
74
|
-
["git", "clone", "--branch", branch, url],
|
|
75
|
-
cwd=repo_folder,
|
|
76
|
-
check=True, # Levanta exceção se o git retornar código de erro
|
|
77
|
-
capture_output=True, # Captura o output
|
|
78
|
-
text=True
|
|
79
|
-
)
|
|
80
|
-
except subprocess.CalledProcessError as e:
|
|
81
|
-
set_log(f"Erro ao clonar: {e.output}")
|
|
82
|
-
|
|
83
|
-
thread = threading.Thread(target=run_git_clone, args=(repo_folder, branch, authorization, owner_repo))
|
|
84
|
-
thread.start()
|
|
85
|
-
|
|
86
69
|
def get_local_repository_path(owner_repo, repository, branch, commit_hash):
|
|
87
70
|
"""Retorna o caminho para um repositório local."""
|
|
88
71
|
repo_folder = os.path.join(ProtonClientParam._repository_folder(), owner_repo, branch, commit_hash, repository)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|