pystand 2.37__tar.gz → 2.39__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.37
3
+ Version: 2.39
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.37
3
+ Version: 2.39
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
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "2.39",
3
+ "distance": 0,
4
+ "node": "g3bfced01900026625a7fe977f022eed41afa2c53",
5
+ "dirty": false,
6
+ "branch": "main",
7
+ "node_date": "2026-09-24"
8
+ }
@@ -37,6 +37,9 @@ LATEST_RELEASE_TAG = f'{GITHUB_SITE}/releases/latest'
37
37
  DOC = 'https://gregoryszorc.com/docs/python-build-standalone/main/'
38
38
  VER = f'{sys.version_info.major}.{sys.version_info.minor}'
39
39
 
40
+ # Seconds to wait for lock on prefix/cache dirs
41
+ LOCK_TIMEOUT = 5
42
+
40
43
  # Sample release tag for documentation/usage examples
41
44
  SAMPL_RELEASE = '20260807'
42
45
 
@@ -117,9 +120,11 @@ class ColorDist(ColorTable):
117
120
 
118
121
 
119
122
  def unexpanduser(path: Path) -> Path:
120
- "Return path name, with $HOME replaced by ~ (opposite of Path.expanduser())"
121
- if path.parts[: len(HOME.parts)] == HOME.parts:
122
- return Path('~', *path.parts[len(HOME.parts) :])
123
+ "Return path name, with $HOME replaced by ~, i.e. opposite of Path.expanduser() for current user"
124
+ startlen = len(hparts := HOME.parts)
125
+ parts = path.parts
126
+ if parts[:startlen] == hparts:
127
+ path = Path('~', *parts[startlen:])
123
128
 
124
129
  return path
125
130
 
@@ -721,9 +726,7 @@ def install_version(
721
726
  version = vdir.name
722
727
 
723
728
  if not (url := files[version].get(distribution)):
724
- return (
725
- f'Arch "{distribution}" not found for release {release} version {version}.'
726
- )
729
+ return f'Distribution "{distribution}" not found for release {release} version {version}.'
727
730
 
728
731
  tmpdir = args._versions / f'.{version}-tmp'
729
732
  rm_path(tmpdir)
@@ -958,11 +961,14 @@ def main() -> str | None:
958
961
  args._latest_release = cache_dir / 'latest_release'
959
962
  args._cert = create_cert(args.cert)
960
963
 
961
- # Only allow one instance of this program to run (to read/write prefix and cache dirs)
962
- locks = [filelock.FileLock(d / '.lock') for d in (prefix_dir, cache_dir)]
964
+ def lock(path: Path) -> filelock.FileLock:
965
+ "Return a file lock for the given directory path"
966
+ return filelock.FileLock(path / '.lock', timeout=LOCK_TIMEOUT)
963
967
 
968
+ # Only allow one instance of this program to run (to avoid potential race
969
+ # condition on writtable dirs)
964
970
  try:
965
- with locks[0].acquire(blocking=False), locks[1].acquire(blocking=False):
971
+ with lock(cache_dir), lock(prefix_dir):
966
972
  args._release = get_release_tag(args)
967
973
  args._fmtrel = ColorRel(args._release, args.no_color).format
968
974
  result = args.func(args)
@@ -1216,7 +1222,7 @@ class remove:
1216
1222
  dfile = args._versions / version / args._data
1217
1223
  release = get_json(dfile).get('release') or '?'
1218
1224
  if not release_del or release == release_del:
1219
- remove(args, version)
1225
+ remove_version(args, version)
1220
1226
  print(f'Version {args._fmtrel(version, release)} removed.')
1221
1227
 
1222
1228
 
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "2.37",
3
- "distance": 0,
4
- "node": "g0c04602c6321af5be0ab5b6b6e0337415036645d",
5
- "dirty": false,
6
- "branch": "main",
7
- "node_date": "2026-09-11"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes