keep-github-workflows-active 2.1.4__py3-none-any.whl → 2.2.0__py3-none-any.whl

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.
@@ -24,7 +24,7 @@ name = "keep_github_workflows_active"
24
24
  #: Human-readable summary shown in CLI help output.
25
25
  title = "Template for python apps with registered cli commands"
26
26
  #: Current release version pulled from ``pyproject.toml`` by automation.
27
- version = "2.1.4"
27
+ version = "2.2.0"
28
28
  #: Repository homepage presented to users.
29
29
  homepage = "https://github.com/bitranox/keep_github_workflows_active"
30
30
  #: Author attribution surfaced in CLI output.
@@ -336,13 +336,13 @@ def _lookup_config_value(key: str) -> str:
336
336
  >>> _ = os.environ.pop("KEEP_GITHUB_WORKFLOWS_ACTIVE_DOTENV_PATH", None)
337
337
  """
338
338
 
339
- env_value = os.environ.get(key)
339
+ env_value = os.environ.get(key, "").strip()
340
340
  if env_value:
341
341
  return env_value
342
342
 
343
343
  for env_file in _candidate_env_files():
344
344
  config = _read_env_file(env_file)
345
- file_value = config.get_value(key)
345
+ file_value = (config.get_value(key) or "").strip()
346
346
  if file_value:
347
347
  return file_value
348
348
 
@@ -493,24 +493,39 @@ def get_repositories(owner: str, github_token: str) -> list[str]:
493
493
 
494
494
  """
495
495
  repositories: list[str] = []
496
- url: str | None = f"https://api.github.com/users/{owner}/repos?per_page=100"
497
496
  headers = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
498
497
 
498
+ # Try the org endpoint first (returns private repos too), fall back to user endpoint.
499
+ org_url = f"https://api.github.com/orgs/{owner}/repos?per_page=100"
500
+ user_url = f"https://api.github.com/users/{owner}/repos?per_page=100"
501
+ probe = requests.get(org_url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
502
+ if probe.status_code == 404:
503
+ url: str | None = user_url
504
+ probe = None # Discard the 404 so the loop fetches fresh from user endpoint.
505
+ else:
506
+ url: str | None = org_url
507
+
499
508
  while url:
500
509
  try:
501
- response = requests.get(url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
502
- response.raise_for_status()
510
+ # Reuse the probe response for the first org page to avoid a duplicate request.
511
+ if probe is not None:
512
+ response = probe
513
+ probe = None
514
+ response.raise_for_status()
515
+ else:
516
+ response = requests.get(url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
517
+ response.raise_for_status()
503
518
  parsed = GitHubRepositoriesResponse.model_validate(response.json())
504
519
  repositories.extend(repo.name for repo in parsed.repositories)
505
520
  url = _get_next_page_url(response)
506
521
 
507
522
  except requests.exceptions.HTTPError as exc:
508
523
  error = GitHubErrorResponse.from_response(exc.response)
509
- result = f"ERROR reading repositories for user {owner}: {error.message}"
524
+ result = f"ERROR reading repositories for {owner}: {error.message}"
510
525
  logger.error(sanitization.sanitize_message(result))
511
526
  raise RuntimeError(result) from exc
512
527
 
513
- result = f"Found {len(repositories)} repositories for user {owner}"
528
+ result = f"Found {len(repositories)} repositories for {owner}"
514
529
  logger.info(sanitization.sanitize_message(result))
515
530
  return repositories
516
531
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keep_github_workflows_active
3
- Version: 2.1.4
3
+ Version: 2.2.0
4
4
  Summary: Template for python apps with registered cli commands
5
5
  Project-URL: Homepage, https://github.com/bitranox/keep_github_workflows_active
6
6
  Project-URL: Repository, https://github.com/bitranox/keep_github_workflows_active.git
@@ -14,24 +14,25 @@ Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.14
17
18
  Classifier: Typing :: Typed
18
19
  Requires-Python: >=3.10
19
20
  Requires-Dist: lib-cli-exit-tools>=2.3.0
20
21
  Requires-Dist: pydantic>=2.12.5
21
- Requires-Dist: requests>=2.32.5
22
+ Requires-Dist: requests>=2.33.0
22
23
  Requires-Dist: rich-click>=1.9.7
23
24
  Provides-Extra: dev
24
- Requires-Dist: bandit>=1.9.3; extra == 'dev'
25
- Requires-Dist: build>=1.4.0; extra == 'dev'
26
- Requires-Dist: codecov-cli>=11.2.6; extra == 'dev'
27
- Requires-Dist: import-linter>=2.10; extra == 'dev'
25
+ Requires-Dist: bandit>=1.9.4; extra == 'dev'
26
+ Requires-Dist: build>=1.4.2; extra == 'dev'
27
+ Requires-Dist: codecov-cli>=11.2.8; extra == 'dev'
28
+ Requires-Dist: import-linter>=2.11; extra == 'dev'
28
29
  Requires-Dist: pip-audit>=2.10.0; extra == 'dev'
29
30
  Requires-Dist: pyright[nodejs]>=1.1.408; extra == 'dev'
30
- Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
31
+ Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
31
32
  Requires-Dist: pytest>=9.0.2; extra == 'dev'
32
33
  Requires-Dist: rtoml>=0.13.0; extra == 'dev'
33
- Requires-Dist: ruff>=0.15.1; extra == 'dev'
34
- Requires-Dist: textual>=7.5.0; extra == 'dev'
34
+ Requires-Dist: ruff>=0.15.8; extra == 'dev'
35
+ Requires-Dist: textual>=8.2.1; extra == 'dev'
35
36
  Requires-Dist: twine>=6.2.0; extra == 'dev'
36
37
  Description-Content-Type: text/markdown
37
38
 
@@ -1,14 +1,14 @@
1
1
  keep_github_workflows_active/__init__.py,sha256=tAEJPhRW07E84IzHijcwAf-iu8fhAf3TsvBUQqGz-fY,399
2
- keep_github_workflows_active/__init__conf__.py,sha256=NXPUAqDqB4PRxZz0i002dLO1sWWMciYAmkvZ3bNEE0Y,2562
2
+ keep_github_workflows_active/__init__conf__.py,sha256=G7SYCN4W1UipBNo0qKatKprhkXFgqUoDyke5EQMJTsg,2562
3
3
  keep_github_workflows_active/__main__.py,sha256=79coRxvGs07uGBSdbw_HpcIv_rqogXvoEkv3lNEEIjE,3552
4
4
  keep_github_workflows_active/behaviors.py,sha256=PYDhp_ubXhLud2IVFLIJKylStu36W4Qm7E_daT2dOAM,3741
5
5
  keep_github_workflows_active/cli.py,sha256=KLLeRvnKuaE45GgX8GS-Aa5l7GGaKE7QjX7KtTV2ZUc,19007
6
6
  keep_github_workflows_active/doctest.env,sha256=WmDSq0QN1PFXpP4jq7JW_Kz-k5PT5uS8KzLrAEmJNC8,25
7
- keep_github_workflows_active/keep_github_workflow_active.py,sha256=4eETTyn-8sHCTtC_4qD3yjNbPwTMD31WpDMLroQ3V94,24685
7
+ keep_github_workflows_active/keep_github_workflow_active.py,sha256=QEFTqioh3c1HJTMF35ocixb9DJg8-_XgItNpzKer5ag,25399
8
8
  keep_github_workflows_active/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  keep_github_workflows_active/sanitization.py,sha256=zyPybyYLBWd__nITF8nyrubA3NJWXjyGkznw-4kJtyA,9801
10
- keep_github_workflows_active-2.1.4.dist-info/METADATA,sha256=cDZ8kJpw6spEwj5FxbVk3drRwx7aAu-5htv2KHfbQGA,9532
11
- keep_github_workflows_active-2.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
12
- keep_github_workflows_active-2.1.4.dist-info/entry_points.txt,sha256=6B8ytwKR2VIAj6IXUYhF957dlfulwTPPLR39RBXwCM0,156
13
- keep_github_workflows_active-2.1.4.dist-info/licenses/LICENSE,sha256=6s9SL2InRrwynPjJYiER7ONHBshbGj_yC5EBzfo7l9I,1072
14
- keep_github_workflows_active-2.1.4.dist-info/RECORD,,
10
+ keep_github_workflows_active-2.2.0.dist-info/METADATA,sha256=lOlsyADibe9WriUHvhmPrBISOZwl_7j8hg-1YfDwWmE,9583
11
+ keep_github_workflows_active-2.2.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
12
+ keep_github_workflows_active-2.2.0.dist-info/entry_points.txt,sha256=6B8ytwKR2VIAj6IXUYhF957dlfulwTPPLR39RBXwCM0,156
13
+ keep_github_workflows_active-2.2.0.dist-info/licenses/LICENSE,sha256=6s9SL2InRrwynPjJYiER7ONHBshbGj_yC5EBzfo7l9I,1072
14
+ keep_github_workflows_active-2.2.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.28.0
2
+ Generator: hatchling 1.29.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any