wexample-wex-addon-dev-python 8.4.0__py3-none-any.whl → 8.5.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.
- wexample_wex_addon_dev_python/workdir/python_package_workdir.py +29 -26
- {wexample_wex_addon_dev_python-8.4.0.dist-info → wexample_wex_addon_dev_python-8.5.0.dist-info}/METADATA +2 -2
- {wexample_wex_addon_dev_python-8.4.0.dist-info → wexample_wex_addon_dev_python-8.5.0.dist-info}/RECORD +5 -5
- {wexample_wex_addon_dev_python-8.4.0.dist-info → wexample_wex_addon_dev_python-8.5.0.dist-info}/WHEEL +0 -0
- {wexample_wex_addon_dev_python-8.4.0.dist-info → wexample_wex_addon_dev_python-8.5.0.dist-info}/entry_points.txt +0 -0
|
@@ -454,21 +454,23 @@ class PythonPackageWorkdir(PythonWorkdir):
|
|
|
454
454
|
shell_run(publish_cmd, inherit_stdio=True, cwd=self.get_path())
|
|
455
455
|
|
|
456
456
|
def _wait_for_registry(self) -> None:
|
|
457
|
-
import
|
|
457
|
+
import base64
|
|
458
458
|
import urllib.error
|
|
459
459
|
import urllib.request
|
|
460
460
|
|
|
461
|
+
from wexample_helpers.helpers.polling_callback_manager import (
|
|
462
|
+
PollingCallbackManager,
|
|
463
|
+
)
|
|
464
|
+
|
|
461
465
|
repository_url = self.search_app_or_suite_runtime_config(
|
|
462
466
|
"pdm.repository.url", default=None
|
|
463
467
|
).get_str_or_none()
|
|
464
|
-
|
|
465
468
|
if not repository_url:
|
|
466
469
|
repository_url = "https://pypi.org"
|
|
467
470
|
|
|
468
471
|
token = self.search_app_or_suite_runtime_config(
|
|
469
472
|
"pdm.repository.token", default=None
|
|
470
473
|
).get_str_or_none()
|
|
471
|
-
|
|
472
474
|
username = (
|
|
473
475
|
self.search_app_or_suite_runtime_config(
|
|
474
476
|
"pdm.repository.username", default="__token__"
|
|
@@ -478,44 +480,45 @@ class PythonPackageWorkdir(PythonWorkdir):
|
|
|
478
480
|
|
|
479
481
|
package = self.get_package_name()
|
|
480
482
|
version = self.get_setup_version()
|
|
483
|
+
url = f"{repository_url.rstrip('/')}/simple/{package}/"
|
|
481
484
|
|
|
482
|
-
|
|
483
|
-
url = f"{base}/simple/{package}/"
|
|
484
|
-
|
|
485
|
-
max_attempts = 40
|
|
486
|
-
delay = 30.0
|
|
487
|
-
|
|
488
|
-
self.log(f"Waiting for {package}=={version} to appear on registry…")
|
|
489
|
-
|
|
490
|
-
for attempt in range(1, max_attempts + 1):
|
|
485
|
+
def check_available() -> bool | None:
|
|
491
486
|
try:
|
|
492
487
|
req = urllib.request.Request(url)
|
|
493
488
|
if token:
|
|
494
|
-
import base64
|
|
495
|
-
|
|
496
489
|
credentials = base64.b64encode(
|
|
497
490
|
f"{username}:{token}".encode()
|
|
498
491
|
).decode()
|
|
499
492
|
req.add_header("Authorization", f"Basic {credentials}")
|
|
500
493
|
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
501
|
-
if resp.status == 200:
|
|
502
|
-
|
|
503
|
-
if version in content:
|
|
504
|
-
self.success(f"{package}=={version} is available.")
|
|
505
|
-
return
|
|
494
|
+
if resp.status == 200 and version in resp.read().decode():
|
|
495
|
+
return True
|
|
506
496
|
except urllib.error.HTTPError as e:
|
|
507
497
|
if e.code != 404:
|
|
508
498
|
raise
|
|
509
499
|
except Exception:
|
|
510
500
|
pass
|
|
501
|
+
return None
|
|
502
|
+
|
|
503
|
+
max_attempts = 40
|
|
504
|
+
delay_seconds = 30
|
|
511
505
|
|
|
506
|
+
self.log(f"Waiting for {package}=={version} to appear on registry…")
|
|
507
|
+
|
|
508
|
+
def on_retry(attempt, max_a, delay, _exc, _msg) -> None:
|
|
512
509
|
self.log(
|
|
513
|
-
f"Not yet available (attempt {attempt}/{
|
|
514
|
-
f"retrying in {int(delay)}s…"
|
|
510
|
+
f"Not yet available (attempt {attempt}/{max_a}), retrying in {delay}s…"
|
|
515
511
|
)
|
|
516
|
-
time.sleep(delay)
|
|
517
512
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
513
|
+
PollingCallbackManager(
|
|
514
|
+
callback=check_available,
|
|
515
|
+
max_attempts=max_attempts,
|
|
516
|
+
delay_seconds_callback=lambda _attempt: delay_seconds,
|
|
517
|
+
on_retry_callback=on_retry,
|
|
518
|
+
timeout_message=(
|
|
519
|
+
f"Timed out waiting for {package}=={version} on registry after "
|
|
520
|
+
f"{max_attempts * delay_seconds // 60} minutes."
|
|
521
|
+
),
|
|
522
|
+
).run()
|
|
523
|
+
|
|
524
|
+
self.success(f"{package}=={version} is available.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wexample-wex-addon-dev-python
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.5.0
|
|
4
4
|
Summary: Python dev addon for wex
|
|
5
5
|
Author-Email: weeger <contact@wexample.com>
|
|
6
6
|
License: MIT
|
|
@@ -24,7 +24,7 @@ Description-Content-Type: text/markdown
|
|
|
24
24
|
|
|
25
25
|
# wex_addon_dev_python
|
|
26
26
|
|
|
27
|
-
Version: 8.
|
|
27
|
+
Version: 8.5.0
|
|
28
28
|
|
|
29
29
|
Python dev addon for wex
|
|
30
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
wexample_wex_addon_dev_python-8.
|
|
2
|
-
wexample_wex_addon_dev_python-8.
|
|
3
|
-
wexample_wex_addon_dev_python-8.
|
|
1
|
+
wexample_wex_addon_dev_python-8.5.0.dist-info/METADATA,sha256=fJpOykjuKxT-PLTnXKx-Ehjx1-8ptJVvGTkDDj3q5XY,17250
|
|
2
|
+
wexample_wex_addon_dev_python-8.5.0.dist-info/WHEEL,sha256=Z36eTX6lG3PITRleSd5hAZHCcz52yg3c0JQVxKBbLW0,90
|
|
3
|
+
wexample_wex_addon_dev_python-8.5.0.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
|
4
4
|
wexample_wex_addon_dev_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
wexample_wex_addon_dev_python/__pycache__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
wexample_wex_addon_dev_python/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -62,7 +62,7 @@ wexample_wex_addon_dev_python/workdir/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
62
62
|
wexample_wex_addon_dev_python/workdir/__pycache__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
63
|
wexample_wex_addon_dev_python/workdir/mixin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
64
|
wexample_wex_addon_dev_python/workdir/mixin/with_profiling_python_workdir_mixin.py,sha256=rWf_AMq4YM_vvKYZiXyhFeAz2xg0KMt_u-1FJACtvjc,3042
|
|
65
|
-
wexample_wex_addon_dev_python/workdir/python_package_workdir.py,sha256=
|
|
65
|
+
wexample_wex_addon_dev_python/workdir/python_package_workdir.py,sha256=WQnVSSOixv_fl124DX0jswGPTJ3xMi4QpGPskVafyUc,19092
|
|
66
66
|
wexample_wex_addon_dev_python/workdir/python_packages_suite_workdir.py,sha256=ICHHewLpsXiheYzGDEahphBryH98ZVezWzSAy6A5w5I,2874
|
|
67
67
|
wexample_wex_addon_dev_python/workdir/python_workdir.py,sha256=hBlqRfJ1eRvUzGFasftnn0SxGw0_Yyoe7AhBDLWntl4,20261
|
|
68
|
-
wexample_wex_addon_dev_python-8.
|
|
68
|
+
wexample_wex_addon_dev_python-8.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|