snodo-provider-github 0.18.0__tar.gz → 0.20.3__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snodo-provider-github
3
- Version: 0.18.0
3
+ Version: 0.20.3
4
4
  Summary: GitHub code-host provider plugin for Snodo
5
5
  Requires-Python: >=3.12
6
- Requires-Dist: snodo-tools==0.19.2
6
+ Requires-Dist: snodo-tools==0.20.3
7
7
  Requires-Dist: PyGithub>=2.0.0
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "snodo-provider-github"
7
- version = "0.18.0"
7
+ version = "0.20.3"
8
8
  description = "GitHub code-host provider plugin for Snodo"
9
9
  requires-python = ">=3.12"
10
- dependencies = ["snodo-tools==0.19.2", "PyGithub>=2.0.0"]
10
+ dependencies = ["snodo-tools==0.20.3", "PyGithub>=2.0.0"]
11
11
 
12
12
  [project.entry-points."snodo.providers"]
13
13
  github = "snodo_provider_github:GitHubProvider"
@@ -41,7 +41,7 @@ class GitHubProvider(CodeHostProvider):
41
41
  if not self._token:
42
42
  raise ProviderError(
43
43
  "GitHub token required. Set GITHUB_TOKEN env var "
44
- "or configure via: snodo config set github <token>"
44
+ "or configure via: snodo config add github <token>"
45
45
  )
46
46
  self._repo_slug = repo_slug
47
47
  try:
@@ -59,10 +59,20 @@ class GitHubProvider(CodeHostProvider):
59
59
  token = os.environ.get("GITHUB_TOKEN")
60
60
  if token:
61
61
  return token
62
+ from snodo.config import ConfigError, ConfigManager
63
+
64
+ manager = ConfigManager()
62
65
  try:
63
- from snodo.config import ConfigManager
64
- return ConfigManager().get_key("github")
65
- except Exception:
66
+ return manager.get_key("github")
67
+ except ConfigError:
68
+ pc = manager.get_providers().get("github")
69
+ if pc and pc.api_key_ref:
70
+ scheme, _, target = pc.api_key_ref.partition(":")
71
+ reference = f"{scheme}:{target.split()[0]}" if scheme == "command" and target.split() else scheme
72
+ raise ProviderError(
73
+ f"GitHub credential reference {reference!r} failed to resolve. "
74
+ "Set GITHUB_TOKEN or run: snodo config add github --ref 'env:GITHUB_TOKEN'"
75
+ ) from None
66
76
  return None
67
77
 
68
78
  def create_change_request(self, branch: str, title: str, body: str,
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snodo-provider-github
3
- Version: 0.18.0
3
+ Version: 0.20.3
4
4
  Summary: GitHub code-host provider plugin for Snodo
5
5
  Requires-Python: >=3.12
6
- Requires-Dist: snodo-tools==0.19.2
6
+ Requires-Dist: snodo-tools==0.20.3
7
7
  Requires-Dist: PyGithub>=2.0.0
@@ -0,0 +1,2 @@
1
+ snodo-tools==0.20.3
2
+ PyGithub>=2.0.0
@@ -1,2 +0,0 @@
1
- snodo-tools==0.19.2
2
- PyGithub>=2.0.0