wexample-wex-addon-dev-python 15.8.0__py3-none-any.whl → 15.9.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 +56 -3
- {wexample_wex_addon_dev_python-15.8.0.dist-info → wexample_wex_addon_dev_python-15.9.0.dist-info}/METADATA +3 -3
- {wexample_wex_addon_dev_python-15.8.0.dist-info → wexample_wex_addon_dev_python-15.9.0.dist-info}/RECORD +5 -5
- {wexample_wex_addon_dev_python-15.8.0.dist-info → wexample_wex_addon_dev_python-15.9.0.dist-info}/WHEEL +0 -0
- {wexample_wex_addon_dev_python-15.8.0.dist-info → wexample_wex_addon_dev_python-15.9.0.dist-info}/entry_points.txt +0 -0
|
@@ -494,7 +494,10 @@ class PythonPackageWorkdir(PythonWorkdir):
|
|
|
494
494
|
if self.get_gitlab_registry_url():
|
|
495
495
|
self._publish_to_gitlab_registry(force=force)
|
|
496
496
|
try:
|
|
497
|
-
|
|
497
|
+
# In the background: PyPI only mirrors the GitLab registry,
|
|
498
|
+
# nothing waits for it. The suite's publication collects
|
|
499
|
+
# the uploads at its end (`collect_pypi_upload`).
|
|
500
|
+
self._publish_to_pypi(force=force, background=True)
|
|
498
501
|
except ShellCommandFailedException as exception:
|
|
499
502
|
self.warning(
|
|
500
503
|
f"PyPI refused {package_name} {version}, published on the GitLab "
|
|
@@ -560,7 +563,34 @@ class PythonPackageWorkdir(PythonWorkdir):
|
|
|
560
563
|
cwd=self.get_path(),
|
|
561
564
|
)
|
|
562
565
|
|
|
563
|
-
def
|
|
566
|
+
def collect_pypi_upload(self) -> str | None:
|
|
567
|
+
"""Wait for this package's background PyPI upload, if one is running,
|
|
568
|
+
and say what went wrong when it failed (None when it did not)."""
|
|
569
|
+
import os
|
|
570
|
+
import shutil
|
|
571
|
+
import time
|
|
572
|
+
|
|
573
|
+
upload_dir = self._get_pypi_upload_dir()
|
|
574
|
+
pid_file = upload_dir / "pid"
|
|
575
|
+
if not pid_file.is_file():
|
|
576
|
+
return None
|
|
577
|
+
pid = int(pid_file.read_text().strip() or 0)
|
|
578
|
+
while pid and os.path.exists(f"/proc/{pid}"):
|
|
579
|
+
time.sleep(1)
|
|
580
|
+
rc_file = upload_dir / "rc"
|
|
581
|
+
rc = rc_file.read_text().strip() if rc_file.is_file() else "unknown"
|
|
582
|
+
log_file = upload_dir / "log"
|
|
583
|
+
report = None
|
|
584
|
+
if rc != "0":
|
|
585
|
+
tail = log_file.read_text(errors="replace").splitlines()[-5:] if log_file.is_file() else []
|
|
586
|
+
report = f"{self.get_package_name()}: PyPI upload failed (exit {rc}): " + " / ".join(tail)
|
|
587
|
+
shutil.rmtree(upload_dir, ignore_errors=True)
|
|
588
|
+
return report
|
|
589
|
+
|
|
590
|
+
def _get_pypi_upload_dir(self):
|
|
591
|
+
return self.get_path() / ".wex" / "tmp" / "pypi-upload"
|
|
592
|
+
|
|
593
|
+
def _publish_to_pypi(self, force: bool = False, background: bool = False) -> None:
|
|
564
594
|
from wexample_filestate_python.common.pipy_gateway import PipyGateway
|
|
565
595
|
from wexample_helpers.helper.shell import shell_run
|
|
566
596
|
|
|
@@ -596,7 +626,30 @@ class PythonPackageWorkdir(PythonWorkdir):
|
|
|
596
626
|
if password:
|
|
597
627
|
publish_cmd += ["--password", password]
|
|
598
628
|
|
|
599
|
-
|
|
629
|
+
if not background:
|
|
630
|
+
shell_run(publish_cmd, inherit_stdio=True, cwd=self.get_path())
|
|
631
|
+
return
|
|
632
|
+
|
|
633
|
+
import shlex
|
|
634
|
+
import shutil
|
|
635
|
+
import subprocess
|
|
636
|
+
|
|
637
|
+
# From a copy of the distributions: dist/ is cleaned as soon as this
|
|
638
|
+
# returns. The exit code is written where collect_pypi_upload reads it.
|
|
639
|
+
upload_dir = self._get_pypi_upload_dir()
|
|
640
|
+
shutil.rmtree(upload_dir, ignore_errors=True)
|
|
641
|
+
shutil.copytree(self.get_path() / "dist", upload_dir / "dist")
|
|
642
|
+
command = " ".join(shlex.quote(part) for part in [*publish_cmd, "--dest", str(upload_dir / "dist")])
|
|
643
|
+
with open(upload_dir / "log", "w") as log:
|
|
644
|
+
process = subprocess.Popen(
|
|
645
|
+
["sh", "-c", f'( {command} ); echo $? > "{upload_dir / "rc"}"'],
|
|
646
|
+
cwd=self.get_path(),
|
|
647
|
+
stdout=log,
|
|
648
|
+
stderr=subprocess.STDOUT,
|
|
649
|
+
start_new_session=True,
|
|
650
|
+
)
|
|
651
|
+
(upload_dir / "pid").write_text(str(process.pid))
|
|
652
|
+
self.log(f"PyPI upload of {package_name} {version} running in the background.")
|
|
600
653
|
|
|
601
654
|
def _wait_for_registry(self) -> None:
|
|
602
655
|
from wexample_helpers.helper.polling_callback_manager import (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wexample-wex-addon-dev-python
|
|
3
|
-
Version: 15.
|
|
3
|
+
Version: 15.9.0
|
|
4
4
|
Summary: Extends wex with commands to format, lint, and rename Python symbols, plus workdir types for Python packages and suites
|
|
5
5
|
Author-Email: weeger <contact@wexample.com>
|
|
6
6
|
License: MIT
|
|
@@ -20,7 +20,7 @@ Requires-Dist: pyright
|
|
|
20
20
|
Requires-Dist: wexample-api>=6.8.0
|
|
21
21
|
Requires-Dist: wexample-filestate-python>=9.4.0
|
|
22
22
|
Requires-Dist: wexample-wex-addon-ai>=19.1.0
|
|
23
|
-
Requires-Dist: wexample-wex-addon-app>=35.
|
|
23
|
+
Requires-Dist: wexample-wex-addon-app>=35.3.0
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: pytest; extra == "dev"
|
|
26
26
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
|
|
29
29
|
# wex_addon_dev_python
|
|
30
30
|
|
|
31
|
-
Version: 15.
|
|
31
|
+
Version: 15.9.0
|
|
32
32
|
|
|
33
33
|
Extends wex with commands to format, lint, and rename Python symbols, plus workdir types for Python packages and suites
|
|
34
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
wexample_wex_addon_dev_python-15.
|
|
2
|
-
wexample_wex_addon_dev_python-15.
|
|
3
|
-
wexample_wex_addon_dev_python-15.
|
|
1
|
+
wexample_wex_addon_dev_python-15.9.0.dist-info/METADATA,sha256=cGSBbmPjvnb2441Yeb8QqnVkPSnn0ssQ_n25Gtke2Hw,3508
|
|
2
|
+
wexample_wex_addon_dev_python-15.9.0.dist-info/WHEEL,sha256=IuIk3wbaEnFH1cx75iM2R1CmliRI3dFLXTbRakgvgFQ,90
|
|
3
|
+
wexample_wex_addon_dev_python-15.9.0.dist-info/entry_points.txt,sha256=4WCjdYUa09eJPSM1ahhnId0BTg7ncgmLgeKtfKjuUy4,127
|
|
4
4
|
wexample_wex_addon_dev_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
wexample_wex_addon_dev_python/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
wexample_wex_addon_dev_python/commands/code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -85,7 +85,7 @@ wexample_wex_addon_dev_python/services/python/service.yml,sha256=28gvNQIzZ0T0PBw
|
|
|
85
85
|
wexample_wex_addon_dev_python/workdir/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
86
|
wexample_wex_addon_dev_python/workdir/mixin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
87
87
|
wexample_wex_addon_dev_python/workdir/mixin/with_profiling_python_workdir_mixin.py,sha256=PA_kqwe2kF5t1nKakX5Q-6fant2R18aEnZfkjr6iJ6k,3097
|
|
88
|
-
wexample_wex_addon_dev_python/workdir/python_package_workdir.py,sha256=
|
|
88
|
+
wexample_wex_addon_dev_python/workdir/python_package_workdir.py,sha256=ag3usJ9rwlg5m_pyZwdxMR6IgBttpFRvfAKw9zCKs0U,27405
|
|
89
89
|
wexample_wex_addon_dev_python/workdir/python_packages_suite_workdir.py,sha256=7Jb5mKGNV2RjFtrFhUm6jbkiTfLDmy7sA97UGHITVdw,2902
|
|
90
90
|
wexample_wex_addon_dev_python/workdir/python_workdir.py,sha256=DS3kGcy7pmeL5ZjlttaKKifBemRyipLGQuWeDDVceFw,33227
|
|
91
|
-
wexample_wex_addon_dev_python-15.
|
|
91
|
+
wexample_wex_addon_dev_python-15.9.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|