pystand 2.28__tar.gz → 2.30__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.28
3
+ Version: 2.30
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
@@ -26,17 +26,17 @@ installation, and update of pre-built Python versions from the
26
26
  [`python-build-standalone`][pbs] project. The following commands are
27
27
  provided:
28
28
 
29
- |Command|Description|
30
- |---------|--------------------------------------------------------------------|
31
- |`install`|Install one, more, or all versions from a python-build-standalone release.|
32
- |`update` (or `upgrade`)|Update one, more, or all versions to another release.|
33
- |`remove` (or `uninstall`)|Remove/uninstall one, more, or all versions.|
34
- |`list`|List installed versions and show which have an update available.|
35
- |`show`|Show versions available from a release.|
36
- |`path`|Show path prefix to installed version base directory.|
37
- |`cache`|Show size of release download caches.|
38
- |`uv`|Run a uv command using a version of python installed by pystand.|
39
- |`uvx`|Run a program using uvx and a version of python installed by pystand.|
29
+ |Command |Aliases |Description |
30
+ |---------|---------|------------|
31
+ |`install`|`i` |Install one, more, or all versions from a python-build-standalone release|
32
+ |`update` |`u`, `up`|Update one, more, or all versions to another releas |
33
+ |`remove` |`r`, `rm`|Remove/uninstall one, more, or all versions|
34
+ |`list` |`l` |List installed versions and show which have an update available|
35
+ |`show` |`s` |Show versions available from a release|
36
+ |`path` |`p` |Show path prefix to installed version base directory|
37
+ |`cache` |`c` |Show size of release download caches|
38
+ |`uv` | |Run a uv command using a version of python installed by pystand|
39
+ |`uvx` | |Run a program using uvx and a version of python installed by pystand|
40
40
 
41
41
  By default, Python versions are sourced from the latest
42
42
  `python-build-standalone` [release][pbs-rel] available (e.g.
@@ -144,7 +144,7 @@ usage: pystand [-h] [-D DISTRIBUTION] [-P PREFIX_DIR] [-C CACHE_DIR]
144
144
  [-M CACHE_MINUTES] [--purge-days PURGE_DAYS]
145
145
  [--github-access-token GITHUB_ACCESS_TOKEN] [--no-strip]
146
146
  [--no-color] [--cert {system,certifi,none}] [-V]
147
- {install,i,update,u,upgrade,remove,r,uninstall,list,l,show,s,path,p,cache,c,uv,uvx} ...
147
+ {install,i,update,u,up,remove,r,rm,list,l,show,s,path,p,cache,c,uv,uvx} ...
148
148
 
149
149
  Command line tool to download, install, and update pre-built Python versions
150
150
  from the python-build-standalone project at https://github.com/astral-
@@ -184,13 +184,11 @@ options:
184
184
  -V, --version just show pystand version
185
185
 
186
186
  Commands:
187
- {install,i,update,u,upgrade,remove,r,uninstall,list,l,show,s,path,p,cache,c,uv,uvx}
187
+ {install,i,update,u,up,remove,r,rm,list,l,show,s,path,p,cache,c,uv,uvx}
188
188
  install (i) Install one, more, or all versions from a python-
189
189
  build-standalone release.
190
- update (u, upgrade)
191
- Update one, more, or all versions to another release.
192
- remove (r, uninstall)
193
- Remove/uninstall one, more, or all versions.
190
+ update (u, up) Update one, more, or all versions to another release.
191
+ remove (r, rm) Remove/uninstall one, more, or all versions.
194
192
  list (l) List installed versions and show which have an update
195
193
  available.
196
194
  show (s) Show versions available from a release.
@@ -258,7 +256,7 @@ options:
258
256
  -k, --keep keep old version after updating (but only if different
259
257
  version number)
260
258
 
261
- aliases: u, upgrade
259
+ aliases: u, up
262
260
  ```
263
261
 
264
262
  ### Command `remove`
@@ -280,7 +278,7 @@ options:
280
278
  only remove versions if from specified YYYMMDD release
281
279
  (e.g. 20240415)
282
280
 
283
- aliases: r, uninstall
281
+ aliases: r, rm
284
282
  ```
285
283
 
286
284
  ### Command `list`
@@ -351,7 +349,7 @@ aliases: p
351
349
  ### Command `cache`
352
350
 
353
351
  ```
354
- usage: pystand cache [-h] [-T] [-H] [-r | -R] [release ...]
352
+ usage: pystand cache [-h] [-T] [-H] [-r | -R] [-f] [release ...]
355
353
 
356
354
  Show size of release download caches.
357
355
 
@@ -367,6 +365,8 @@ options:
367
365
  -R, --remove-all-unused
368
366
  remove caches for all currently unused releases
369
367
  instead of showing size
368
+ -f, --file also remove cached release file list when removing
369
+ download caches
370
370
 
371
371
  aliases: c
372
372
  ```
@@ -7,17 +7,17 @@ installation, and update of pre-built Python versions from the
7
7
  [`python-build-standalone`][pbs] project. The following commands are
8
8
  provided:
9
9
 
10
- |Command|Description|
11
- |---------|--------------------------------------------------------------------|
12
- |`install`|Install one, more, or all versions from a python-build-standalone release.|
13
- |`update` (or `upgrade`)|Update one, more, or all versions to another release.|
14
- |`remove` (or `uninstall`)|Remove/uninstall one, more, or all versions.|
15
- |`list`|List installed versions and show which have an update available.|
16
- |`show`|Show versions available from a release.|
17
- |`path`|Show path prefix to installed version base directory.|
18
- |`cache`|Show size of release download caches.|
19
- |`uv`|Run a uv command using a version of python installed by pystand.|
20
- |`uvx`|Run a program using uvx and a version of python installed by pystand.|
10
+ |Command |Aliases |Description |
11
+ |---------|---------|------------|
12
+ |`install`|`i` |Install one, more, or all versions from a python-build-standalone release|
13
+ |`update` |`u`, `up`|Update one, more, or all versions to another releas |
14
+ |`remove` |`r`, `rm`|Remove/uninstall one, more, or all versions|
15
+ |`list` |`l` |List installed versions and show which have an update available|
16
+ |`show` |`s` |Show versions available from a release|
17
+ |`path` |`p` |Show path prefix to installed version base directory|
18
+ |`cache` |`c` |Show size of release download caches|
19
+ |`uv` | |Run a uv command using a version of python installed by pystand|
20
+ |`uvx` | |Run a program using uvx and a version of python installed by pystand|
21
21
 
22
22
  By default, Python versions are sourced from the latest
23
23
  `python-build-standalone` [release][pbs-rel] available (e.g.
@@ -125,7 +125,7 @@ usage: pystand [-h] [-D DISTRIBUTION] [-P PREFIX_DIR] [-C CACHE_DIR]
125
125
  [-M CACHE_MINUTES] [--purge-days PURGE_DAYS]
126
126
  [--github-access-token GITHUB_ACCESS_TOKEN] [--no-strip]
127
127
  [--no-color] [--cert {system,certifi,none}] [-V]
128
- {install,i,update,u,upgrade,remove,r,uninstall,list,l,show,s,path,p,cache,c,uv,uvx} ...
128
+ {install,i,update,u,up,remove,r,rm,list,l,show,s,path,p,cache,c,uv,uvx} ...
129
129
 
130
130
  Command line tool to download, install, and update pre-built Python versions
131
131
  from the python-build-standalone project at https://github.com/astral-
@@ -165,13 +165,11 @@ options:
165
165
  -V, --version just show pystand version
166
166
 
167
167
  Commands:
168
- {install,i,update,u,upgrade,remove,r,uninstall,list,l,show,s,path,p,cache,c,uv,uvx}
168
+ {install,i,update,u,up,remove,r,rm,list,l,show,s,path,p,cache,c,uv,uvx}
169
169
  install (i) Install one, more, or all versions from a python-
170
170
  build-standalone release.
171
- update (u, upgrade)
172
- Update one, more, or all versions to another release.
173
- remove (r, uninstall)
174
- Remove/uninstall one, more, or all versions.
171
+ update (u, up) Update one, more, or all versions to another release.
172
+ remove (r, rm) Remove/uninstall one, more, or all versions.
175
173
  list (l) List installed versions and show which have an update
176
174
  available.
177
175
  show (s) Show versions available from a release.
@@ -239,7 +237,7 @@ options:
239
237
  -k, --keep keep old version after updating (but only if different
240
238
  version number)
241
239
 
242
- aliases: u, upgrade
240
+ aliases: u, up
243
241
  ```
244
242
 
245
243
  ### Command `remove`
@@ -261,7 +259,7 @@ options:
261
259
  only remove versions if from specified YYYMMDD release
262
260
  (e.g. 20240415)
263
261
 
264
- aliases: r, uninstall
262
+ aliases: r, rm
265
263
  ```
266
264
 
267
265
  ### Command `list`
@@ -332,7 +330,7 @@ aliases: p
332
330
  ### Command `cache`
333
331
 
334
332
  ```
335
- usage: pystand cache [-h] [-T] [-H] [-r | -R] [release ...]
333
+ usage: pystand cache [-h] [-T] [-H] [-r | -R] [-f] [release ...]
336
334
 
337
335
  Show size of release download caches.
338
336
 
@@ -348,6 +346,8 @@ options:
348
346
  -R, --remove-all-unused
349
347
  remove caches for all currently unused releases
350
348
  instead of showing size
349
+ -f, --file also remove cached release file list when removing
350
+ download caches
351
351
 
352
352
  aliases: c
353
353
  ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pystand
3
- Version: 2.28
3
+ Version: 2.30
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
@@ -26,17 +26,17 @@ installation, and update of pre-built Python versions from the
26
26
  [`python-build-standalone`][pbs] project. The following commands are
27
27
  provided:
28
28
 
29
- |Command|Description|
30
- |---------|--------------------------------------------------------------------|
31
- |`install`|Install one, more, or all versions from a python-build-standalone release.|
32
- |`update` (or `upgrade`)|Update one, more, or all versions to another release.|
33
- |`remove` (or `uninstall`)|Remove/uninstall one, more, or all versions.|
34
- |`list`|List installed versions and show which have an update available.|
35
- |`show`|Show versions available from a release.|
36
- |`path`|Show path prefix to installed version base directory.|
37
- |`cache`|Show size of release download caches.|
38
- |`uv`|Run a uv command using a version of python installed by pystand.|
39
- |`uvx`|Run a program using uvx and a version of python installed by pystand.|
29
+ |Command |Aliases |Description |
30
+ |---------|---------|------------|
31
+ |`install`|`i` |Install one, more, or all versions from a python-build-standalone release|
32
+ |`update` |`u`, `up`|Update one, more, or all versions to another releas |
33
+ |`remove` |`r`, `rm`|Remove/uninstall one, more, or all versions|
34
+ |`list` |`l` |List installed versions and show which have an update available|
35
+ |`show` |`s` |Show versions available from a release|
36
+ |`path` |`p` |Show path prefix to installed version base directory|
37
+ |`cache` |`c` |Show size of release download caches|
38
+ |`uv` | |Run a uv command using a version of python installed by pystand|
39
+ |`uvx` | |Run a program using uvx and a version of python installed by pystand|
40
40
 
41
41
  By default, Python versions are sourced from the latest
42
42
  `python-build-standalone` [release][pbs-rel] available (e.g.
@@ -144,7 +144,7 @@ usage: pystand [-h] [-D DISTRIBUTION] [-P PREFIX_DIR] [-C CACHE_DIR]
144
144
  [-M CACHE_MINUTES] [--purge-days PURGE_DAYS]
145
145
  [--github-access-token GITHUB_ACCESS_TOKEN] [--no-strip]
146
146
  [--no-color] [--cert {system,certifi,none}] [-V]
147
- {install,i,update,u,upgrade,remove,r,uninstall,list,l,show,s,path,p,cache,c,uv,uvx} ...
147
+ {install,i,update,u,up,remove,r,rm,list,l,show,s,path,p,cache,c,uv,uvx} ...
148
148
 
149
149
  Command line tool to download, install, and update pre-built Python versions
150
150
  from the python-build-standalone project at https://github.com/astral-
@@ -184,13 +184,11 @@ options:
184
184
  -V, --version just show pystand version
185
185
 
186
186
  Commands:
187
- {install,i,update,u,upgrade,remove,r,uninstall,list,l,show,s,path,p,cache,c,uv,uvx}
187
+ {install,i,update,u,up,remove,r,rm,list,l,show,s,path,p,cache,c,uv,uvx}
188
188
  install (i) Install one, more, or all versions from a python-
189
189
  build-standalone release.
190
- update (u, upgrade)
191
- Update one, more, or all versions to another release.
192
- remove (r, uninstall)
193
- Remove/uninstall one, more, or all versions.
190
+ update (u, up) Update one, more, or all versions to another release.
191
+ remove (r, rm) Remove/uninstall one, more, or all versions.
194
192
  list (l) List installed versions and show which have an update
195
193
  available.
196
194
  show (s) Show versions available from a release.
@@ -258,7 +256,7 @@ options:
258
256
  -k, --keep keep old version after updating (but only if different
259
257
  version number)
260
258
 
261
- aliases: u, upgrade
259
+ aliases: u, up
262
260
  ```
263
261
 
264
262
  ### Command `remove`
@@ -280,7 +278,7 @@ options:
280
278
  only remove versions if from specified YYYMMDD release
281
279
  (e.g. 20240415)
282
280
 
283
- aliases: r, uninstall
281
+ aliases: r, rm
284
282
  ```
285
283
 
286
284
  ### Command `list`
@@ -351,7 +349,7 @@ aliases: p
351
349
  ### Command `cache`
352
350
 
353
351
  ```
354
- usage: pystand cache [-h] [-T] [-H] [-r | -R] [release ...]
352
+ usage: pystand cache [-h] [-T] [-H] [-r | -R] [-f] [release ...]
355
353
 
356
354
  Show size of release download caches.
357
355
 
@@ -367,6 +365,8 @@ options:
367
365
  -R, --remove-all-unused
368
366
  remove caches for all currently unused releases
369
367
  instead of showing size
368
+ -f, --file also remove cached release file list when removing
369
+ download caches
370
370
 
371
371
  aliases: c
372
372
  ```
@@ -388,10 +388,11 @@ def check_release_tag(release: str) -> str | None:
388
388
  # Note we use a simple direct URL fetch to get the latest tag info
389
389
  # because it is much faster than using the GitHub API, and has no
390
390
  # rate-limits.
391
- def fetch_tags(args: Namespace) -> Iterator[tuple[str, str]]:
391
+ def fetch_tags(args: Namespace) -> dict[str, str]:
392
392
  "Fetch the latest release tags from the GitHub release atom feed"
393
393
  import xml.etree.ElementTree as et
394
394
 
395
+ tags = {}
395
396
  try:
396
397
  with urlopen(LATEST_RELEASES, context=args._cert) as url:
397
398
  data = et.parse(url).getroot()
@@ -403,7 +404,9 @@ def fetch_tags(args: Namespace) -> Iterator[tuple[str, str]]:
403
404
  tl = entry.findtext('{http://www.w3.org/2005/Atom}title')
404
405
  dt = entry.findtext('{http://www.w3.org/2005/Atom}updated')
405
406
  if tl and dt:
406
- yield tl, dt
407
+ tags[tl.split(':', 1)[0]] = dt
408
+
409
+ return tags
407
410
 
408
411
 
409
412
  def fetch_tag_latest(args: Namespace) -> str:
@@ -590,7 +593,7 @@ def purge_unused_releases(args: Namespace) -> None:
590
593
  def show_list(args: Namespace) -> None:
591
594
  "Show a list of available releases"
592
595
  latest = parse_version(args._release)
593
- releases = {r: d for r, d in fetch_tags(args)}
596
+ releases = fetch_tags(args)
594
597
  cached = set(p.name for p in args._releases.iterdir())
595
598
  for release in sorted(cached.union(releases)):
596
599
  if args.re_match and not re.search(args.re_match, release):
@@ -600,6 +603,7 @@ def show_list(args: Namespace) -> None:
600
603
  try:
601
604
  this_version = parse_version(release)
602
605
  except InvalidVersion:
606
+ print(f'Invalid release tag: "{release}"', file=sys.stderr)
603
607
  continue
604
608
 
605
609
  if dt_str := releases.get(release):
@@ -1022,7 +1026,7 @@ class install_:
1022
1026
  class update_:
1023
1027
  "Update one, more, or all versions to another release."
1024
1028
 
1025
- aliases = ['u', 'upgrade']
1029
+ aliases = ['u', 'up']
1026
1030
 
1027
1031
  @staticmethod
1028
1032
  def init(parser: ArgumentParser) -> None:
@@ -1109,7 +1113,7 @@ class update_:
1109
1113
  class remove_:
1110
1114
  "Remove/uninstall one, more, or all versions."
1111
1115
 
1112
- aliases = ['r', 'uninstall']
1116
+ aliases = ['r', 'rm']
1113
1117
 
1114
1118
  @staticmethod
1115
1119
  def init(parser: ArgumentParser) -> None:
@@ -1394,12 +1398,21 @@ class cache_:
1394
1398
  action='store_true',
1395
1399
  help='remove caches for all currently unused releases instead of showing size',
1396
1400
  )
1401
+ parser.add_argument(
1402
+ '-f',
1403
+ '--file',
1404
+ action='store_true',
1405
+ help='also remove cached release file list when removing download caches',
1406
+ )
1397
1407
  parser.add_argument(
1398
1408
  'release', nargs='*', help='show cache size for given release[s] only'
1399
1409
  )
1400
1410
 
1401
1411
  @staticmethod
1402
1412
  def run(args: Namespace) -> str | None:
1413
+ if args.file and not (args.remove or args.remove_all_unused):
1414
+ args.parser.error('The -f/--file option only applies when removing.')
1415
+
1403
1416
  if args.remove_all_unused:
1404
1417
  if args.release:
1405
1418
  args.parser.error(
@@ -1407,31 +1420,49 @@ class cache_:
1407
1420
  )
1408
1421
 
1409
1422
  keep = keeplist(args)
1410
- for release in args._downloads.iterdir():
1411
- if (name := release.name) not in keep and name.isdigit():
1412
- if rm_path(release):
1413
- print(f'Removed cache for release {name}.')
1423
+ releases = set(
1424
+ p.name for p in args._downloads.iterdir() if p.name.isdigit()
1425
+ )
1426
+ releases.update(
1427
+ p.name for p in args._releases.iterdir() if p.name.isdigit()
1428
+ )
1429
+ for release in sorted(releases):
1430
+ if release not in keep:
1431
+ if rm_path(args._downloads / release):
1432
+ print(f'Removed download cache for release {release}.')
1433
+ if args.file and rm_path(args._releases / release):
1434
+ print(f'Removed file list cache for release {release}.')
1414
1435
 
1415
1436
  elif args.release:
1416
1437
  for release in args.release:
1417
1438
  # Allow user to include cache path in release name
1418
1439
  path = (args._downloads / release).expanduser()
1440
+ release = path.name
1419
1441
 
1420
- if err := check_release_tag(path.name):
1442
+ if err := check_release_tag(release):
1421
1443
  return err
1422
1444
 
1423
- if not path.exists():
1424
- return f'No cache for release {release}.'
1425
-
1426
1445
  if args.remove:
1427
- if rm_path(args._downloads / release):
1428
- print(f'Removed cache for release {release.name}.')
1446
+ removed = False
1447
+ if rm_path(path):
1448
+ print(f'Removed download cache for release {release}.')
1449
+ removed = True
1450
+
1451
+ if args.file and rm_path((args._releases / release).expanduser()):
1452
+ print(f'Removed file list cache for release {release}.')
1453
+ removed = True
1454
+
1455
+ if not removed:
1456
+ print(f'No caches found for release {release}.')
1457
+
1429
1458
  else:
1430
1459
  show_cache_size(path, args)
1431
1460
  else:
1432
1461
  if args.remove:
1433
1462
  if rm_path(args._downloads):
1434
1463
  print('Removed download cache.')
1464
+ if args.file and rm_path(args._releases):
1465
+ print('Removed file lists cache.')
1435
1466
  else:
1436
1467
  show_cache_size(args._downloads, args)
1437
1468
 
File without changes
File without changes
File without changes
File without changes