pystand 2.40__tar.gz → 2.42__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.40
3
+ Version: 2.42
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
@@ -381,7 +381,7 @@ usage: pystand man [-h] [version]
381
381
  Show installed man page for latest or given version.
382
382
 
383
383
  positional arguments:
384
- version installed version to show man page for
384
+ version installed version to show man page for, default is latest
385
385
 
386
386
  options:
387
387
  -h, --help show this help message and exit
@@ -363,7 +363,7 @@ usage: pystand man [-h] [version]
363
363
  Show installed man page for latest or given version.
364
364
 
365
365
  positional arguments:
366
- version installed version to show man page for
366
+ version installed version to show man page for, default is latest
367
367
 
368
368
  options:
369
369
  -h, --help show this help message and exit
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pystand
3
- Version: 2.40
3
+ Version: 2.42
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
@@ -381,7 +381,7 @@ usage: pystand man [-h] [version]
381
381
  Show installed man page for latest or given version.
382
382
 
383
383
  positional arguments:
384
- version installed version to show man page for
384
+ version installed version to show man page for, default is latest
385
385
 
386
386
  options:
387
387
  -h, --help show this help message and exit
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "2.42",
3
+ "distance": 0,
4
+ "node": "g39cda37bbf27edb844e7fa8889f762d2988434a3",
5
+ "dirty": false,
6
+ "branch": "main",
7
+ "node_date": "2026-10-21"
8
+ }
@@ -6,25 +6,28 @@ https://github.com/astral-sh/python-build-standalone.
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import itertools
9
+ import sys
10
+
11
+ if sys.version_info >= (3, 15):
12
+ # PyGithub library does not work with lazy loading
13
+ def import_filter(importer: str, _: str, __: tuple[str, ...] | None) -> bool:
14
+ return not importer.startswith('github')
15
+
16
+ sys.set_lazy_imports_filter(import_filter)
17
+
10
18
  import os
11
19
  import platform
12
20
  import re
13
- import shlex
14
21
  import shutil
15
22
  import ssl
16
23
  import subprocess
17
- import sys
18
24
  import time
19
- from collections import defaultdict
20
25
  from collections.abc import Iterable, Iterator
21
- from datetime import date, datetime
22
26
  from pathlib import Path
23
27
  from typing import Any
24
28
  from urllib.request import urlopen
25
29
 
26
30
  import filelock
27
- import platformdirs
28
31
  from argparse_from_file import ArgumentParser, Namespace
29
32
  from packaging.version import InvalidVersion
30
33
  from packaging.version import parse as parse_version
@@ -83,6 +86,8 @@ class ColorTable:
83
86
  "Base class for color tables"
84
87
 
85
88
  def __init__(self, initval: str, no_color: bool) -> None:
89
+ import itertools
90
+
86
91
  self.table = None if no_color else {self.parse_key(initval): COLORS[0]}
87
92
  self.next = itertools.cycle(COLORS[1:-1])
88
93
 
@@ -378,6 +383,8 @@ def get_version_names(args: Namespace) -> list[str]:
378
383
 
379
384
  def check_release_tag(release: str) -> str | None:
380
385
  "Check the specified release tag is valid"
386
+ from datetime import date
387
+
381
388
  if not release.isdigit() or len(release) != len(SAMPL_RELEASE):
382
389
  return 'Release must be a YYYYMMDD string.'
383
390
 
@@ -515,6 +522,8 @@ def get_release_files(args, tag) -> dict[str, Any]:
515
522
 
516
523
  def update_version_symlinks(args: Namespace) -> None:
517
524
  "Create/update symlinks pointing to latest version"
525
+ from collections import defaultdict
526
+
518
527
  base = args._versions
519
528
  if not base.exists():
520
529
  return
@@ -603,6 +612,8 @@ def purge_unused_releases(args: Namespace) -> None:
603
612
 
604
613
  def show_list(args: Namespace, re_match: re.Pattern | None) -> None:
605
614
  "Show a list of available releases"
615
+ from datetime import datetime
616
+
606
617
  try:
607
618
  latest = parse_version(args._release)
608
619
  except InvalidVersion:
@@ -723,7 +734,7 @@ def compile_bytecode(srcdir: Path, tgtdir: Path) -> str | None:
723
734
  def ensure_manpage_link(vdir: Path) -> None:
724
735
  "Ensure a symlink to the man page for this version exists"
725
736
  manpath = vdir / MANPATH
726
- if manpath.is_file():
737
+ if manpath.is_symlink() or manpath.exists():
727
738
  return
728
739
 
729
740
  for path in manpath.parent.iterdir():
@@ -762,9 +773,9 @@ def install_version(
762
773
  if error:
763
774
  shutil.rmtree(tmpdir)
764
775
  else:
776
+ ensure_manpage_link(tmpdir)
765
777
  remove_version(args, version)
766
778
  tmpdir.replace(vdir)
767
- ensure_manpage_link(vdir)
768
779
 
769
780
  return error
770
781
 
@@ -818,6 +829,8 @@ def create_cert(option: str) -> ssl.SSLContext | None:
818
829
 
819
830
  def run_uv(args: Namespace, cmd: list[str], cmdopts: list[str]) -> str | None:
820
831
  "Run a uv command with the specified or latest installed python version"
832
+ import shlex
833
+
821
834
  if not (vers := (args.python or get_major_version(args))):
822
835
  return 'No installed python version found.'
823
836
 
@@ -842,6 +855,8 @@ commands = []
842
855
 
843
856
  def main() -> str | None:
844
857
  "Main code"
858
+ import platformdirs
859
+
845
860
  distro_default = DISTRIBUTIONS.get((platform.system(), platform.machine()))
846
861
  distro_help = distro_default or '?unknown?'
847
862
 
@@ -1580,7 +1595,9 @@ class man:
1580
1595
  @staticmethod
1581
1596
  def init(parser: ArgumentParser) -> None:
1582
1597
  parser.add_argument(
1583
- 'version', nargs='?', help='installed version to show man page for'
1598
+ 'version',
1599
+ nargs='?',
1600
+ help='installed version to show man page for, default is latest',
1584
1601
  )
1585
1602
 
1586
1603
  @staticmethod
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "2.40",
3
- "distance": 0,
4
- "node": "g9abbd4e9ec899e5c4c00d23d30bba5a63cae906e",
5
- "dirty": false,
6
- "branch": "main",
7
- "node_date": "2026-09-25"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes