bitfab 0.64.0 → 0.64.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a8fffac2ff19b663ee3ecfec6cb7427842a7bef923fe94f213671d400d087e7
4
- data.tar.gz: ed5a88483cbffd047dc821e53aa679bd1caec14a05c8dada40c253cf8247abbb
3
+ metadata.gz: d14c7be3e30cfca546b9393ea4f102e1d8e1cf9cd28b03ed0b2da8455a491603
4
+ data.tar.gz: e6919321b8f708129eb578b01e17be64987dc58a0006bfe7ce7c30aa07308158
5
5
  SHA512:
6
- metadata.gz: b1be4ae239619dabbf0cedb101a467f13938c703a90b1a6f6782c90681c8661d32f9f68c38697dd97f3ca17ec18f0f8ee0fe63941a56f03d70faf8f9a41602b4
7
- data.tar.gz: bf3c0b70cc7afbea6a07b8749f16992674dcc88f7ec28965d7b3fe9b27aefd8ab6be2395f2a51dcfcbcbc081d133c59ba486fb677fb6a2c04cce404171327982
6
+ metadata.gz: 65609caadde1a938837fbad709fca7da3c3387195c62d6063e4f5c7c917bf29d35c09f93083676cac733a2fe39322b634d0ed67bbe86cc87316836aeab3237e1
7
+ data.tar.gz: c3ff154d5f8c81252ec36279e1cd7d54136ce8bd2c88f99fd798767c390ba40db0c854ac57ac5f409bf2b8020dab90e9ed52fab5d93c0ec440e40cf16c5b45be
@@ -413,7 +413,7 @@ def configure_secrets(argv):
413
413
  *(["--env", environment] if environment else []),
414
414
  ],
415
415
  input=values.get(name, values.get(targets[name])),
416
- env=None if token is None else {**os.environ, "GH_TOKEN": token},
416
+ env={**os.environ, "GH_TOKEN": token},
417
417
  )
418
418
  result["set"] = [targets[name] for name in found]
419
419
  if missing or empty:
@@ -425,8 +425,9 @@ def configure_secrets(argv):
425
425
  def github_access():
426
426
  if shutil.which("gh") is not None:
427
427
  with contextlib.suppress(RuntimeError, OSError, subprocess.SubprocessError):
428
- command(["gh", "auth", "status", "--hostname", "github.com"])
429
- return {"source": "the GitHub CLI", "token": None}
428
+ token = command(["gh", "auth", "token", "--hostname", "github.com"])
429
+ if token:
430
+ return {"source": "the GitHub CLI", "token": token}
430
431
  for name in ("GH_TOKEN", "GITHUB_TOKEN"):
431
432
  if os.environ.get(name):
432
433
  return {"source": name, "token": os.environ[name]}
@@ -467,26 +468,6 @@ def api(repo, suffix, *, method="GET", payload=None, raw=False):
467
468
  path = f"repos/{repo}" + (f"/{suffix}" if suffix else "")
468
469
  access = github_access()
469
470
  data = None if payload is None else json.dumps(payload)
470
- if access["token"] is None:
471
- result = command(
472
- [
473
- "gh",
474
- "api",
475
- "--hostname",
476
- "github.com",
477
- "-H",
478
- f"X-GitHub-Api-Version: {API_VERSION}",
479
- *([] if raw else ["--jq", "tojson"]),
480
- path,
481
- "--method",
482
- method,
483
- *(["--input", "-"] if data is not None else []),
484
- ],
485
- input=data,
486
- )
487
- if raw:
488
- return result
489
- return json.loads(result) if result else None
490
471
  request = urllib.request.Request(
491
472
  f"https://api.github.com/{path}",
492
473
  method=method,
@@ -512,7 +493,7 @@ def api(repo, suffix, *, method="GET", payload=None, raw=False):
512
493
  raise CommandError(
513
494
  "Python cannot verify GitHub's certificate because it has no certificate store. "
514
495
  "On a python.org install, run Install Certificates.command from its Applications folder, "
515
- "set SSL_CERT_FILE to a certificate bundle, or log in with the GitHub CLI (gh auth login), which cloud replay uses instead"
496
+ "or set SSL_CERT_FILE to a certificate bundle"
516
497
  ) from None
517
498
  raise CommandError(f"Could not reach api.github.com: {reason}") from None
518
499
  if raw:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.64.0"
4
+ VERSION = "0.64.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.64.0
4
+ version: 0.64.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team