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.
- {pystand-2.37/pystand.egg-info → pystand-2.39}/PKG-INFO +1 -1
- {pystand-2.37 → pystand-2.39/pystand.egg-info}/PKG-INFO +1 -1
- pystand-2.39/pystand.egg-info/scm_version.json +8 -0
- {pystand-2.37 → pystand-2.39}/pystand.py +16 -10
- pystand-2.37/pystand.egg-info/scm_version.json +0 -8
- {pystand-2.37 → pystand-2.39}/.gitignore +0 -0
- {pystand-2.37 → pystand-2.39}/README.md +0 -0
- {pystand-2.37 → pystand-2.39}/check-dist.py +0 -0
- {pystand-2.37 → pystand-2.39}/justfile +0 -0
- {pystand-2.37 → pystand-2.39}/pyproject.toml +0 -0
- {pystand-2.37 → pystand-2.39}/pystand.egg-info/SOURCES.txt +0 -0
- {pystand-2.37 → pystand-2.39}/pystand.egg-info/dependency_links.txt +0 -0
- {pystand-2.37 → pystand-2.39}/pystand.egg-info/entry_points.txt +0 -0
- {pystand-2.37 → pystand-2.39}/pystand.egg-info/requires.txt +0 -0
- {pystand-2.37 → pystand-2.39}/pystand.egg-info/scm_file_list.json +0 -0
- {pystand-2.37 → pystand-2.39}/pystand.egg-info/top_level.txt +0 -0
- {pystand-2.37 → pystand-2.39}/setup.cfg +0 -0
|
@@ -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
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
962
|
-
|
|
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
|
|
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
|
-
|
|
1225
|
+
remove_version(args, version)
|
|
1220
1226
|
print(f'Version {args._fmtrel(version, release)} removed.')
|
|
1221
1227
|
|
|
1222
1228
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|