pystand 2.35__tar.gz → 2.36__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pystand
3
- Version: 2.35
3
+ Version: 2.36
4
4
  Summary: Install Python versions from python-build-standalone project
5
5
  Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
6
6
  License-Expression: GPL-3.0-or-later
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pystand
3
- Version: 2.35
3
+ Version: 2.36
4
4
  Summary: Install Python versions from python-build-standalone project
5
5
  Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
6
6
  License-Expression: GPL-3.0-or-later
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "2.35",
2
+ "tag": "2.36",
3
3
  "distance": 0,
4
- "node": "gf90437d7f2e68e78d07fcefc226c22bbc3c067be",
4
+ "node": "g4d3f67f4313887dc9ada0e74d5186f253c66c1f0",
5
5
  "dirty": false,
6
6
  "branch": "main",
7
7
  "node_date": "2026-09-04"
@@ -10,6 +10,7 @@ import itertools
10
10
  import os
11
11
  import platform
12
12
  import re
13
+ import shlex
13
14
  import shutil
14
15
  import ssl
15
16
  import subprocess
@@ -254,7 +255,7 @@ def fetch(args: Namespace, release: str, url: str, tdir: Path) -> str | None:
254
255
  else:
255
256
  pdir = tmpdir / 'python'
256
257
  idir = pdir / 'install'
257
- if idir.exists():
258
+ if idir.is_dir():
258
259
  # This is a source distribution, copy the source if
259
260
  # requested
260
261
  if args.include_source:
@@ -266,7 +267,10 @@ def fetch(args: Namespace, release: str, url: str, tdir: Path) -> str | None:
266
267
 
267
268
  pdir = idir
268
269
 
269
- pdir.replace(tdir)
270
+ if pdir.is_dir():
271
+ pdir.replace(tdir)
272
+ else:
273
+ error = f'Failed to find unpacked python directory in "{url}".'
270
274
 
271
275
  rm_path(tmpdir)
272
276
  return error
@@ -577,7 +581,7 @@ def purge_unused_releases(args: Namespace) -> None:
577
581
  for path in args._releases.iterdir():
578
582
  if path.name not in keep:
579
583
  if (path.stat().st_mtime + end_secs) < now_secs:
580
- path.unlink()
584
+ rm_path(path)
581
585
  else:
582
586
  keep.add(path.name)
583
587
 
@@ -590,7 +594,10 @@ def purge_unused_releases(args: Namespace) -> None:
590
594
 
591
595
  def show_list(args: Namespace) -> None:
592
596
  "Show a list of available releases"
593
- latest = parse_version(args._release)
597
+ try:
598
+ latest = parse_version(args._release)
599
+ except InvalidVersion:
600
+ latest = None
594
601
  releases = fetch_tags(args)
595
602
  cached = {p.name for p in args._releases.iterdir()}
596
603
  for release in sorted(cached.union(releases)):
@@ -605,6 +612,7 @@ def show_list(args: Namespace) -> None:
605
612
  continue
606
613
 
607
614
  if dt_str := releases.get(release):
615
+ dt_str = dt_str.replace('Z', '+00:00')
608
616
  dts = (
609
617
  datetime.fromisoformat(dt_str)
610
618
  .astimezone()
@@ -620,7 +628,7 @@ def show_list(args: Namespace) -> None:
620
628
  else:
621
629
  app = ''
622
630
 
623
- pre = ' pre-release' if this_version > latest else ''
631
+ pre = ' pre-release' if (latest and this_version > latest) else ''
624
632
  print(f'{release} {dts}{app}{pre}')
625
633
 
626
634
 
@@ -665,7 +673,7 @@ def strip_binaries(vdir: Path, distribution: str) -> bool:
665
673
 
666
674
  for file in base.iterdir():
667
675
  if not file.is_symlink() and file.is_file():
668
- cmd = f'strip -p --strip-unneeded {file}'.split()
676
+ cmd = ('strip', '-p', '--strip-unneeded', file)
669
677
  try:
670
678
  res = subprocess.run(cmd, stderr=subprocess.DEVNULL)
671
679
  except Exception:
@@ -728,7 +736,7 @@ def install(
728
736
  error = f'Failed to write {version} data file: {error}'
729
737
  elif c_error := compile_bytecode(tmpdir, vdir):
730
738
  print(
731
- f'Warning: Could not compile bytecode for {version}: {c_error}',
739
+ f'Warning: Error compiling bytecode for {version}: {c_error}',
732
740
  file=sys.stderr,
733
741
  )
734
742
 
@@ -802,7 +810,10 @@ def run_uv(args: Namespace, cmd: list[str], cmdopts: list[str]) -> str | None:
802
810
  py = py.resolve()
803
811
  py = py.with_name(py.stem)
804
812
 
805
- subprocess.run(cmd + ['-p', py] + cmdopts)
813
+ cmd = cmd + ['-p', str(py)] + cmdopts
814
+ res = subprocess.run(cmd)
815
+ if res.returncode != 0:
816
+ return f'Command "{shlex.join(cmd)}" failed with exit code {res.returncode}.'
806
817
 
807
818
 
808
819
  def main() -> str | None:
@@ -1065,7 +1076,7 @@ class update_:
1065
1076
  parser.add_argument(
1066
1077
  '-r',
1067
1078
  '--release',
1068
- help='update to specified YYYMMDD release (e.g. '
1079
+ help='update to specified YYYYMMDD release (e.g. '
1069
1080
  f'{SAMPL_RELEASE}), default is latest release',
1070
1081
  )
1071
1082
  parser.add_argument(
@@ -1171,7 +1182,7 @@ class remove_:
1171
1182
  '-r',
1172
1183
  '--release',
1173
1184
  help='only remove versions if from specified '
1174
- f'YYYMMDD release (e.g. {SAMPL_RELEASE})',
1185
+ f'YYYYMMDD release (e.g. {SAMPL_RELEASE})',
1175
1186
  )
1176
1187
  parser.add_argument(
1177
1188
  'version', nargs='*', help='version to remove (or to skip for --all --skip)'
@@ -1477,6 +1488,10 @@ class cache_:
1477
1488
  for release in args.release:
1478
1489
  # Allow user to include cache path in release name
1479
1490
  path = (args._downloads / release).expanduser()
1491
+ if not path.is_dir():
1492
+ print(f'No caches found for release {release}.', file=sys.stderr)
1493
+ continue
1494
+
1480
1495
  release = path.name
1481
1496
 
1482
1497
  if err := check_release_tag(release):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes