Merge pull request 'feature: add publish pypi package workflow' (#9) from feature/add-publish-pypi-package-workflow into main

Reviewed-on: #9
This commit is contained in:
jt
2026-07-09 21:05:03 +00:00
2 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -115,10 +115,10 @@ def get_remote_api(token: str) -> RemoteAPI:
raise GitFlowError("El repositorio no tiene configurado un remoto.") raise GitFlowError("El repositorio no tiene configurado un remoto.")
remote_type = flowconfig.get("flow.remote-type", "").lower() remote_type = flowconfig.get("flow.remote-type", "").lower()
[host, repository] = RemoteAPI.parse(flowconfig["flow.remote"]) [schema, host, repository] = RemoteAPI.parse(flowconfig["flow.remote"])
if remote_type == "gitea": if remote_type == "gitea":
return GiteaRemoteAPI("https://" + host, repository, token) return GiteaRemoteAPI(("https://" if schema == "ssh://" else schema) + host, repository, token)
elif remote_type == "bitbucket": elif remote_type == "bitbucket":
return BitbucketRemoteAPI(repository, token) return BitbucketRemoteAPI(repository, token)
elif remote_type == "github": elif remote_type == "github":
+6 -4
View File
@@ -16,18 +16,20 @@ class RemoteAPI(ABC):
if url.startswith("git@"): if url.startswith("git@"):
at_pos = url.index("@") at_pos = url.index("@")
colon_pos = url.index(":") colon_pos = url.index(":")
schema = "ssh://"
host = url[at_pos+1:colon_pos] host = url[at_pos+1:colon_pos]
repository = url[colon_pos+1:] repository = url[colon_pos+1:]
elif url.startswith("http://") or url.startswith("https://"): elif url.startswith("http://") or url.startswith("https://"):
host_start = url.index("://") + 3 start_pos = url.index("://") + 3
uri_start = url.index("/", host_start) uri_start = url.index("/", start_pos)
host = url[host_start:uri_start] schema = url[:start_pos]
host = url[start_pos:uri_start]
repository = url[uri_start+1:] repository = url[uri_start+1:]
else: else:
raise GitFlowError(f"La URL del remoto {remote} es inválida: {url}") raise GitFlowError(f"La URL del remoto {remote} es inválida: {url}")
repository = repository.removesuffix(".git") repository = repository.removesuffix(".git")
return [host, repository] return [schema, host, repository]
@abstractmethod @abstractmethod
def create_pull_request( def create_pull_request(