pystand 2.3__tar.gz → 2.5__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.
@@ -13,7 +13,7 @@ upload: build
13
13
  twine3 upload dist/*
14
14
 
15
15
  doc:
16
- update-readme-usage
16
+ update-readme-usage -A
17
17
 
18
18
  clean:
19
19
  @rm -vrf *.egg-info build/ dist/ __pycache__
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pystand
3
- Version: 2.3
3
+ Version: 2.5
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: GPLv3
@@ -131,7 +131,7 @@ usage: pystand [-h] [-D DISTRIBUTION] [-P PREFIX_DIR] [-C CACHE_DIR]
131
131
  [-M CACHE_MINUTES] [--purge-days PURGE_DAYS]
132
132
  [--github-access-token GITHUB_ACCESS_TOKEN] [--no-strip]
133
133
  [-V]
134
- {install,update,remove,list,show,path} ...
134
+ {install,update,upgrade,remove,uninstall,list,show,path} ...
135
135
 
136
136
  Command line tool to download, install, and update pre-built Python versions
137
137
  from the python-build-standalone project at
@@ -140,9 +140,9 @@ https://github.com/indygreg/python-build-standalone.
140
140
  options:
141
141
  -h, --help show this help message and exit
142
142
  -D DISTRIBUTION, --distribution DISTRIBUTION
143
- python-build-standalone distribution. Default is auto-
144
- detected (detected as "x86_64-unknown-linux-gnu-
145
- install_only_stripped" for this current host).
143
+ python-build-standalone distribution. Default is
144
+ "x86_64-unknown-linux-gnu-install_only_stripped" for
145
+ this host.
146
146
  -P PREFIX_DIR, --prefix-dir PREFIX_DIR
147
147
  specify prefix dir for storing versions. Default is
148
148
  "$HOME/.local/share/pystand"
@@ -164,18 +164,18 @@ options:
164
164
  -V, --version just show pystand version
165
165
 
166
166
  Commands:
167
- {install,update,remove,list,show,path}
167
+ {install,update,upgrade,remove,uninstall,list,show,path}
168
168
  install Install one or more versions from a python-build-
169
169
  standalone release.
170
- update Update one, more, or all versions to another release.
171
- remove Remove/uninstall one, more, or all versions.
170
+ update (upgrade) Update one, more, or all versions to another release.
171
+ remove (uninstall) Remove/uninstall one, more, or all versions.
172
172
  list List installed versions and show which have an update
173
173
  available.
174
174
  show Show versions available from a release.
175
175
  path Show path prefix to installed version base directory.
176
176
 
177
- Note you can set default starting global options in
178
- $HOME/.config/pystand-flags.conf.
177
+ Some commands offer aliases as shown in brackets above. Note you can set
178
+ default starting global options in $HOME/.config/pystand-flags.conf.
179
179
  ```
180
180
 
181
181
  Type `pystand <command> -h` to see specific help/usage for any
@@ -184,7 +184,7 @@ individual command:
184
184
  ### Command `install`
185
185
 
186
186
  ```
187
- usage: pystand install [-h] [-r RELEASE] [-f] version [version ...]
187
+ usage: pystand install [-h] [-r RELEASE] [-f] [-s] version [version ...]
188
188
 
189
189
  Install one or more versions from a python-build-standalone release.
190
190
 
@@ -198,6 +198,8 @@ options:
198
198
  YYYYMMDD release (e.g. 20240415), default is latest
199
199
  release
200
200
  -f, --force force install even if already installed
201
+ -s, --include-source also install source files if available in distribution
202
+ download
201
203
  ```
202
204
 
203
205
  ### Command `update`
@@ -220,6 +222,8 @@ options:
220
222
  can be specified with --all)
221
223
  -k, --keep keep old version after updating (but only if different
222
224
  version number)
225
+
226
+ aliases: upgrade
223
227
  ```
224
228
 
225
229
  ### Command `remove`
@@ -240,6 +244,8 @@ options:
240
244
  -r RELEASE, --release RELEASE
241
245
  only remove versions if from specified YYYMMDD release
242
246
  (e.g. 20240415)
247
+
248
+ aliases: uninstall
243
249
  ```
244
250
 
245
251
  ### Command `list`
@@ -264,18 +270,21 @@ options:
264
270
  ### Command `show`
265
271
 
266
272
  ```
267
- usage: pystand show [-h] [-a] [release]
273
+ usage: pystand show [-h] [-r RELEASE] [-a] [re_match]
268
274
 
269
275
  Show versions available from a release.
270
276
 
271
277
  positional arguments:
272
- release python-build-standalone YYYYMMDD release to show (e.g.
273
- 20240415), default is latest release
278
+ re_match show only versions+distributions matching this regular
279
+ expression pattern
274
280
 
275
281
  options:
276
- -h, --help show this help message and exit
277
- -a, --all also show all available distributions for each version from the
278
- release
282
+ -h, --help show this help message and exit
283
+ -r RELEASE, --release RELEASE
284
+ python-build-standalone YYYYMMDD release to show (e.g.
285
+ 20240415), default is latest release
286
+ -a, --all show all available distributions for each version from
287
+ the release
279
288
  ```
280
289
 
281
290
  ### Command `path`
@@ -320,35 +329,6 @@ To uninstall:
320
329
  $ pipx uninstall pystand
321
330
  ```
322
331
 
323
- ## Installing Other Builds/Distributions
324
-
325
- The _`install_only_stripped`_ build of each distribution is installed by
326
- default. See description of distributions/builds
327
- [here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
328
- However, you can choose to install other distributions/builds. E.g. If
329
- we use a standard modern Linux x86_64 machine as an example, the default
330
- distribution is _`x86_64-unknown-linux-gnu-install_only_stripped`_ and
331
- the versions for these are installed by default at
332
- `~/.local/share/pystand/<version>`.
333
-
334
- However, let's say you want to experiment with the new free-threaded
335
- 3.13 build, installed to a different directory. E.g.:
336
-
337
- ```sh
338
- $ mkdir ./3.13-freethreaded
339
- $ cd ./3.13-freethreaded
340
-
341
- $ pystand -P. -D x86_64-unknown-linux-gnu-freethreaded+lto-full install 3.13
342
- $ ./3.13/bin/python -V
343
- Python 3.13.0
344
-
345
- $ pystand -P . list
346
- 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
347
- ```
348
-
349
- Note you can set a different default distribution by specifying
350
- `--distribution` as a [default option](#command-default-options).
351
-
352
332
  ## Extrapolation of Python Versions
353
333
 
354
334
  For all commands except the `path` command, `pystand` extrapolates
@@ -407,6 +387,150 @@ $ uv venv -p $(pystand path 3.12.2)
407
387
  $ uv venv -p $(pystand path -r 3.12)
408
388
  ```
409
389
 
390
+ ## Installing Other Builds/Distributions
391
+
392
+ The _`install_only_stripped`_ distribution build is installed by default
393
+ for your running machine architecture. See description of
394
+ distributions/builds
395
+ [here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
396
+ However, you can choose to install other distributions/builds (even for
397
+ other architectures). E.g. If we use a standard modern Linux x86_64
398
+ machine as an example, the default distribution is
399
+ _`x86_64-unknown-linux-gnu-install_only_stripped`_ and the versions for
400
+ these are installed by default at `~/.local/share/pystand/<version>`.
401
+
402
+ However, let's say you want to experiment with the new free-threaded
403
+ 3.13 build, installed to a different directory. E.g.:
404
+
405
+ ```sh
406
+ $ mkdir ./3.13-freethreaded
407
+ $ cd ./3.13-freethreaded
408
+
409
+ $ pystand -P. -D x86_64-unknown-linux-gnu-freethreaded+lto-full install 3.13
410
+ $ ./3.13/bin/python -V
411
+ Python 3.13.0
412
+
413
+ $ pystand -P . list
414
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
415
+ ```
416
+
417
+ Note you can set a different default distribution by specifying
418
+ `--distribution` as a [default option](#command-default-options).
419
+
420
+ ### Searching for Available Versions and Distributions
421
+
422
+ The `show` command can be used to search for distributions as seen in the
423
+ following examples.
424
+
425
+ ```sh
426
+
427
+ List all the versions installed on this system (at the default location):
428
+
429
+ ```sh
430
+ $ pystand list
431
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
432
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
433
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
434
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
435
+ ```
436
+
437
+ The above shows versions 3.9, 3.12, and 3.13 are installed from the latest
438
+ release 20241016. Version 3.8 is installed from the previous release
439
+ 20241002 (and is not available in the latest release otherwise it would
440
+ be shown with an update message).
441
+
442
+ Now show all available versions from the latest release:
443
+
444
+ ```sh
445
+ $ pystand show
446
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
447
+ 3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
448
+ 3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
449
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
450
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
451
+ ```
452
+
453
+ We can see that versions 3.9, 3.12, and 3.13 are already installed (as
454
+ we also knew from list output), and that 3.10 and 3.11 are also available.
455
+
456
+ What is available from the previous release 20241002?
457
+
458
+ ```sh
459
+ $ pystand show -r 20241002
460
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
461
+ 3.9.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
462
+ 3.10.15 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
463
+ 3.11.10 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
464
+ 3.12.7 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
465
+ 3.13.0rc3 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
466
+ ```
467
+
468
+ Let's install one of the threaded builds of Python 3.13. We can use the
469
+ `-a/-all` option to show all available distributions and then give the
470
+ `show` command a [regular
471
+ expression](https://en.wikipedia.org/wiki/Regular_expression) to filter
472
+ the output (this is really just a shorthand for piping the output of
473
+ `show -a` to grep). E.g.:
474
+
475
+ ```sh
476
+ $ pystand show -a 3.13.*x86_64.*unknown-linux-gnu.*thread
477
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+debug-full"
478
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo+lto-full"
479
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo-full"
480
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+debug-full"
481
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo+lto-full"
482
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo-full"
483
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+debug-full"
484
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
485
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo-full"
486
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+debug-full"
487
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
488
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+noopt-full"
489
+ ```
490
+
491
+ So let's install the
492
+ `x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full` build of Python
493
+ 3.13 (to the default location):
494
+
495
+ ```sh
496
+ $ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install 3.13
497
+ Version "3.13.0" is already installed.
498
+ ```
499
+
500
+ An error is given because the version is already installed. We can
501
+ overwrite that with the `-f/--force` option:
502
+
503
+ ```sh
504
+ $ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install -f 3.13
505
+ Version 3.13.0 @ 20241016 installed.
506
+ ```
507
+
508
+ Now we can see the new version distribution is installed:
509
+
510
+ ```sh
511
+
512
+ $ pystand list
513
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
514
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
515
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
516
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
517
+
518
+ $ pystand show
519
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
520
+ 3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
521
+ 3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
522
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
523
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
524
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full" (installed)
525
+ ```
526
+
527
+ Note that `pystand` caches all downloaded files (at least for a period
528
+ specified by `--purge-days`) so you can easily switch between different
529
+ versions/distributions quite quickly. You can also choose to install any
530
+ distribution/build in a specific directory using the `-P/--prefix-dir`
531
+ global option if you want to keep different distributions separate and
532
+ available in parallel.
533
+
410
534
  ## Command Default Options
411
535
 
412
536
  You can add default global options to a personal configuration file
@@ -423,11 +547,11 @@ as defaults.
423
547
 
424
548
  ## Github API Rate Limiting
425
549
 
426
- This tool minimises and caches Github API responses from the
427
- [`python-build-standalone`][pbs] repository. However, if you install
428
- many different versions particularly across various releases, you may
429
- get rate limited by Github so the command will block and you will see
430
- "backoff" messages reported. You can create a Github access token to
550
+ This tool minimises and caches Github API responses and file downloads
551
+ from the [`python-build-standalone`][pbs] repository. However, if you
552
+ install many different versions particularly across various releases,
553
+ you may get rate limited by Github so the command can block and you will
554
+ see "backoff" messages reported. You can create a Github access token to
431
555
  gain increased rate limits. Create a token in your Github account under
432
556
  `Settings -> Developer settings -> Personal access tokens`. Specify the
433
557
  token on the command line with `--github-access-token`, or set that as a
@@ -114,7 +114,7 @@ usage: pystand [-h] [-D DISTRIBUTION] [-P PREFIX_DIR] [-C CACHE_DIR]
114
114
  [-M CACHE_MINUTES] [--purge-days PURGE_DAYS]
115
115
  [--github-access-token GITHUB_ACCESS_TOKEN] [--no-strip]
116
116
  [-V]
117
- {install,update,remove,list,show,path} ...
117
+ {install,update,upgrade,remove,uninstall,list,show,path} ...
118
118
 
119
119
  Command line tool to download, install, and update pre-built Python versions
120
120
  from the python-build-standalone project at
@@ -123,9 +123,9 @@ https://github.com/indygreg/python-build-standalone.
123
123
  options:
124
124
  -h, --help show this help message and exit
125
125
  -D DISTRIBUTION, --distribution DISTRIBUTION
126
- python-build-standalone distribution. Default is auto-
127
- detected (detected as "x86_64-unknown-linux-gnu-
128
- install_only_stripped" for this current host).
126
+ python-build-standalone distribution. Default is
127
+ "x86_64-unknown-linux-gnu-install_only_stripped" for
128
+ this host.
129
129
  -P PREFIX_DIR, --prefix-dir PREFIX_DIR
130
130
  specify prefix dir for storing versions. Default is
131
131
  "$HOME/.local/share/pystand"
@@ -147,18 +147,18 @@ options:
147
147
  -V, --version just show pystand version
148
148
 
149
149
  Commands:
150
- {install,update,remove,list,show,path}
150
+ {install,update,upgrade,remove,uninstall,list,show,path}
151
151
  install Install one or more versions from a python-build-
152
152
  standalone release.
153
- update Update one, more, or all versions to another release.
154
- remove Remove/uninstall one, more, or all versions.
153
+ update (upgrade) Update one, more, or all versions to another release.
154
+ remove (uninstall) Remove/uninstall one, more, or all versions.
155
155
  list List installed versions and show which have an update
156
156
  available.
157
157
  show Show versions available from a release.
158
158
  path Show path prefix to installed version base directory.
159
159
 
160
- Note you can set default starting global options in
161
- $HOME/.config/pystand-flags.conf.
160
+ Some commands offer aliases as shown in brackets above. Note you can set
161
+ default starting global options in $HOME/.config/pystand-flags.conf.
162
162
  ```
163
163
 
164
164
  Type `pystand <command> -h` to see specific help/usage for any
@@ -167,7 +167,7 @@ individual command:
167
167
  ### Command `install`
168
168
 
169
169
  ```
170
- usage: pystand install [-h] [-r RELEASE] [-f] version [version ...]
170
+ usage: pystand install [-h] [-r RELEASE] [-f] [-s] version [version ...]
171
171
 
172
172
  Install one or more versions from a python-build-standalone release.
173
173
 
@@ -181,6 +181,8 @@ options:
181
181
  YYYYMMDD release (e.g. 20240415), default is latest
182
182
  release
183
183
  -f, --force force install even if already installed
184
+ -s, --include-source also install source files if available in distribution
185
+ download
184
186
  ```
185
187
 
186
188
  ### Command `update`
@@ -203,6 +205,8 @@ options:
203
205
  can be specified with --all)
204
206
  -k, --keep keep old version after updating (but only if different
205
207
  version number)
208
+
209
+ aliases: upgrade
206
210
  ```
207
211
 
208
212
  ### Command `remove`
@@ -223,6 +227,8 @@ options:
223
227
  -r RELEASE, --release RELEASE
224
228
  only remove versions if from specified YYYMMDD release
225
229
  (e.g. 20240415)
230
+
231
+ aliases: uninstall
226
232
  ```
227
233
 
228
234
  ### Command `list`
@@ -247,18 +253,21 @@ options:
247
253
  ### Command `show`
248
254
 
249
255
  ```
250
- usage: pystand show [-h] [-a] [release]
256
+ usage: pystand show [-h] [-r RELEASE] [-a] [re_match]
251
257
 
252
258
  Show versions available from a release.
253
259
 
254
260
  positional arguments:
255
- release python-build-standalone YYYYMMDD release to show (e.g.
256
- 20240415), default is latest release
261
+ re_match show only versions+distributions matching this regular
262
+ expression pattern
257
263
 
258
264
  options:
259
- -h, --help show this help message and exit
260
- -a, --all also show all available distributions for each version from the
261
- release
265
+ -h, --help show this help message and exit
266
+ -r RELEASE, --release RELEASE
267
+ python-build-standalone YYYYMMDD release to show (e.g.
268
+ 20240415), default is latest release
269
+ -a, --all show all available distributions for each version from
270
+ the release
262
271
  ```
263
272
 
264
273
  ### Command `path`
@@ -303,35 +312,6 @@ To uninstall:
303
312
  $ pipx uninstall pystand
304
313
  ```
305
314
 
306
- ## Installing Other Builds/Distributions
307
-
308
- The _`install_only_stripped`_ build of each distribution is installed by
309
- default. See description of distributions/builds
310
- [here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
311
- However, you can choose to install other distributions/builds. E.g. If
312
- we use a standard modern Linux x86_64 machine as an example, the default
313
- distribution is _`x86_64-unknown-linux-gnu-install_only_stripped`_ and
314
- the versions for these are installed by default at
315
- `~/.local/share/pystand/<version>`.
316
-
317
- However, let's say you want to experiment with the new free-threaded
318
- 3.13 build, installed to a different directory. E.g.:
319
-
320
- ```sh
321
- $ mkdir ./3.13-freethreaded
322
- $ cd ./3.13-freethreaded
323
-
324
- $ pystand -P. -D x86_64-unknown-linux-gnu-freethreaded+lto-full install 3.13
325
- $ ./3.13/bin/python -V
326
- Python 3.13.0
327
-
328
- $ pystand -P . list
329
- 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
330
- ```
331
-
332
- Note you can set a different default distribution by specifying
333
- `--distribution` as a [default option](#command-default-options).
334
-
335
315
  ## Extrapolation of Python Versions
336
316
 
337
317
  For all commands except the `path` command, `pystand` extrapolates
@@ -390,6 +370,150 @@ $ uv venv -p $(pystand path 3.12.2)
390
370
  $ uv venv -p $(pystand path -r 3.12)
391
371
  ```
392
372
 
373
+ ## Installing Other Builds/Distributions
374
+
375
+ The _`install_only_stripped`_ distribution build is installed by default
376
+ for your running machine architecture. See description of
377
+ distributions/builds
378
+ [here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
379
+ However, you can choose to install other distributions/builds (even for
380
+ other architectures). E.g. If we use a standard modern Linux x86_64
381
+ machine as an example, the default distribution is
382
+ _`x86_64-unknown-linux-gnu-install_only_stripped`_ and the versions for
383
+ these are installed by default at `~/.local/share/pystand/<version>`.
384
+
385
+ However, let's say you want to experiment with the new free-threaded
386
+ 3.13 build, installed to a different directory. E.g.:
387
+
388
+ ```sh
389
+ $ mkdir ./3.13-freethreaded
390
+ $ cd ./3.13-freethreaded
391
+
392
+ $ pystand -P. -D x86_64-unknown-linux-gnu-freethreaded+lto-full install 3.13
393
+ $ ./3.13/bin/python -V
394
+ Python 3.13.0
395
+
396
+ $ pystand -P . list
397
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
398
+ ```
399
+
400
+ Note you can set a different default distribution by specifying
401
+ `--distribution` as a [default option](#command-default-options).
402
+
403
+ ### Searching for Available Versions and Distributions
404
+
405
+ The `show` command can be used to search for distributions as seen in the
406
+ following examples.
407
+
408
+ ```sh
409
+
410
+ List all the versions installed on this system (at the default location):
411
+
412
+ ```sh
413
+ $ pystand list
414
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
415
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
416
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
417
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
418
+ ```
419
+
420
+ The above shows versions 3.9, 3.12, and 3.13 are installed from the latest
421
+ release 20241016. Version 3.8 is installed from the previous release
422
+ 20241002 (and is not available in the latest release otherwise it would
423
+ be shown with an update message).
424
+
425
+ Now show all available versions from the latest release:
426
+
427
+ ```sh
428
+ $ pystand show
429
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
430
+ 3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
431
+ 3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
432
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
433
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
434
+ ```
435
+
436
+ We can see that versions 3.9, 3.12, and 3.13 are already installed (as
437
+ we also knew from list output), and that 3.10 and 3.11 are also available.
438
+
439
+ What is available from the previous release 20241002?
440
+
441
+ ```sh
442
+ $ pystand show -r 20241002
443
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
444
+ 3.9.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
445
+ 3.10.15 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
446
+ 3.11.10 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
447
+ 3.12.7 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
448
+ 3.13.0rc3 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
449
+ ```
450
+
451
+ Let's install one of the threaded builds of Python 3.13. We can use the
452
+ `-a/-all` option to show all available distributions and then give the
453
+ `show` command a [regular
454
+ expression](https://en.wikipedia.org/wiki/Regular_expression) to filter
455
+ the output (this is really just a shorthand for piping the output of
456
+ `show -a` to grep). E.g.:
457
+
458
+ ```sh
459
+ $ pystand show -a 3.13.*x86_64.*unknown-linux-gnu.*thread
460
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+debug-full"
461
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo+lto-full"
462
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo-full"
463
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+debug-full"
464
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo+lto-full"
465
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo-full"
466
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+debug-full"
467
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
468
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo-full"
469
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+debug-full"
470
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
471
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+noopt-full"
472
+ ```
473
+
474
+ So let's install the
475
+ `x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full` build of Python
476
+ 3.13 (to the default location):
477
+
478
+ ```sh
479
+ $ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install 3.13
480
+ Version "3.13.0" is already installed.
481
+ ```
482
+
483
+ An error is given because the version is already installed. We can
484
+ overwrite that with the `-f/--force` option:
485
+
486
+ ```sh
487
+ $ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install -f 3.13
488
+ Version 3.13.0 @ 20241016 installed.
489
+ ```
490
+
491
+ Now we can see the new version distribution is installed:
492
+
493
+ ```sh
494
+
495
+ $ pystand list
496
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
497
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
498
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
499
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
500
+
501
+ $ pystand show
502
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
503
+ 3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
504
+ 3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
505
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
506
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
507
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full" (installed)
508
+ ```
509
+
510
+ Note that `pystand` caches all downloaded files (at least for a period
511
+ specified by `--purge-days`) so you can easily switch between different
512
+ versions/distributions quite quickly. You can also choose to install any
513
+ distribution/build in a specific directory using the `-P/--prefix-dir`
514
+ global option if you want to keep different distributions separate and
515
+ available in parallel.
516
+
393
517
  ## Command Default Options
394
518
 
395
519
  You can add default global options to a personal configuration file
@@ -406,11 +530,11 @@ as defaults.
406
530
 
407
531
  ## Github API Rate Limiting
408
532
 
409
- This tool minimises and caches Github API responses from the
410
- [`python-build-standalone`][pbs] repository. However, if you install
411
- many different versions particularly across various releases, you may
412
- get rate limited by Github so the command will block and you will see
413
- "backoff" messages reported. You can create a Github access token to
533
+ This tool minimises and caches Github API responses and file downloads
534
+ from the [`python-build-standalone`][pbs] repository. However, if you
535
+ install many different versions particularly across various releases,
536
+ you may get rate limited by Github so the command can block and you will
537
+ see "backoff" messages reported. You can create a Github access token to
414
538
  gain increased rate limits. Create a token in your Github account under
415
539
  `Settings -> Developer settings -> Personal access tokens`. Specify the
416
540
  token on the command line with `--github-access-token`, or set that as a
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pystand
3
- Version: 2.3
3
+ Version: 2.5
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: GPLv3
@@ -131,7 +131,7 @@ usage: pystand [-h] [-D DISTRIBUTION] [-P PREFIX_DIR] [-C CACHE_DIR]
131
131
  [-M CACHE_MINUTES] [--purge-days PURGE_DAYS]
132
132
  [--github-access-token GITHUB_ACCESS_TOKEN] [--no-strip]
133
133
  [-V]
134
- {install,update,remove,list,show,path} ...
134
+ {install,update,upgrade,remove,uninstall,list,show,path} ...
135
135
 
136
136
  Command line tool to download, install, and update pre-built Python versions
137
137
  from the python-build-standalone project at
@@ -140,9 +140,9 @@ https://github.com/indygreg/python-build-standalone.
140
140
  options:
141
141
  -h, --help show this help message and exit
142
142
  -D DISTRIBUTION, --distribution DISTRIBUTION
143
- python-build-standalone distribution. Default is auto-
144
- detected (detected as "x86_64-unknown-linux-gnu-
145
- install_only_stripped" for this current host).
143
+ python-build-standalone distribution. Default is
144
+ "x86_64-unknown-linux-gnu-install_only_stripped" for
145
+ this host.
146
146
  -P PREFIX_DIR, --prefix-dir PREFIX_DIR
147
147
  specify prefix dir for storing versions. Default is
148
148
  "$HOME/.local/share/pystand"
@@ -164,18 +164,18 @@ options:
164
164
  -V, --version just show pystand version
165
165
 
166
166
  Commands:
167
- {install,update,remove,list,show,path}
167
+ {install,update,upgrade,remove,uninstall,list,show,path}
168
168
  install Install one or more versions from a python-build-
169
169
  standalone release.
170
- update Update one, more, or all versions to another release.
171
- remove Remove/uninstall one, more, or all versions.
170
+ update (upgrade) Update one, more, or all versions to another release.
171
+ remove (uninstall) Remove/uninstall one, more, or all versions.
172
172
  list List installed versions and show which have an update
173
173
  available.
174
174
  show Show versions available from a release.
175
175
  path Show path prefix to installed version base directory.
176
176
 
177
- Note you can set default starting global options in
178
- $HOME/.config/pystand-flags.conf.
177
+ Some commands offer aliases as shown in brackets above. Note you can set
178
+ default starting global options in $HOME/.config/pystand-flags.conf.
179
179
  ```
180
180
 
181
181
  Type `pystand <command> -h` to see specific help/usage for any
@@ -184,7 +184,7 @@ individual command:
184
184
  ### Command `install`
185
185
 
186
186
  ```
187
- usage: pystand install [-h] [-r RELEASE] [-f] version [version ...]
187
+ usage: pystand install [-h] [-r RELEASE] [-f] [-s] version [version ...]
188
188
 
189
189
  Install one or more versions from a python-build-standalone release.
190
190
 
@@ -198,6 +198,8 @@ options:
198
198
  YYYYMMDD release (e.g. 20240415), default is latest
199
199
  release
200
200
  -f, --force force install even if already installed
201
+ -s, --include-source also install source files if available in distribution
202
+ download
201
203
  ```
202
204
 
203
205
  ### Command `update`
@@ -220,6 +222,8 @@ options:
220
222
  can be specified with --all)
221
223
  -k, --keep keep old version after updating (but only if different
222
224
  version number)
225
+
226
+ aliases: upgrade
223
227
  ```
224
228
 
225
229
  ### Command `remove`
@@ -240,6 +244,8 @@ options:
240
244
  -r RELEASE, --release RELEASE
241
245
  only remove versions if from specified YYYMMDD release
242
246
  (e.g. 20240415)
247
+
248
+ aliases: uninstall
243
249
  ```
244
250
 
245
251
  ### Command `list`
@@ -264,18 +270,21 @@ options:
264
270
  ### Command `show`
265
271
 
266
272
  ```
267
- usage: pystand show [-h] [-a] [release]
273
+ usage: pystand show [-h] [-r RELEASE] [-a] [re_match]
268
274
 
269
275
  Show versions available from a release.
270
276
 
271
277
  positional arguments:
272
- release python-build-standalone YYYYMMDD release to show (e.g.
273
- 20240415), default is latest release
278
+ re_match show only versions+distributions matching this regular
279
+ expression pattern
274
280
 
275
281
  options:
276
- -h, --help show this help message and exit
277
- -a, --all also show all available distributions for each version from the
278
- release
282
+ -h, --help show this help message and exit
283
+ -r RELEASE, --release RELEASE
284
+ python-build-standalone YYYYMMDD release to show (e.g.
285
+ 20240415), default is latest release
286
+ -a, --all show all available distributions for each version from
287
+ the release
279
288
  ```
280
289
 
281
290
  ### Command `path`
@@ -320,35 +329,6 @@ To uninstall:
320
329
  $ pipx uninstall pystand
321
330
  ```
322
331
 
323
- ## Installing Other Builds/Distributions
324
-
325
- The _`install_only_stripped`_ build of each distribution is installed by
326
- default. See description of distributions/builds
327
- [here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
328
- However, you can choose to install other distributions/builds. E.g. If
329
- we use a standard modern Linux x86_64 machine as an example, the default
330
- distribution is _`x86_64-unknown-linux-gnu-install_only_stripped`_ and
331
- the versions for these are installed by default at
332
- `~/.local/share/pystand/<version>`.
333
-
334
- However, let's say you want to experiment with the new free-threaded
335
- 3.13 build, installed to a different directory. E.g.:
336
-
337
- ```sh
338
- $ mkdir ./3.13-freethreaded
339
- $ cd ./3.13-freethreaded
340
-
341
- $ pystand -P. -D x86_64-unknown-linux-gnu-freethreaded+lto-full install 3.13
342
- $ ./3.13/bin/python -V
343
- Python 3.13.0
344
-
345
- $ pystand -P . list
346
- 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
347
- ```
348
-
349
- Note you can set a different default distribution by specifying
350
- `--distribution` as a [default option](#command-default-options).
351
-
352
332
  ## Extrapolation of Python Versions
353
333
 
354
334
  For all commands except the `path` command, `pystand` extrapolates
@@ -407,6 +387,150 @@ $ uv venv -p $(pystand path 3.12.2)
407
387
  $ uv venv -p $(pystand path -r 3.12)
408
388
  ```
409
389
 
390
+ ## Installing Other Builds/Distributions
391
+
392
+ The _`install_only_stripped`_ distribution build is installed by default
393
+ for your running machine architecture. See description of
394
+ distributions/builds
395
+ [here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
396
+ However, you can choose to install other distributions/builds (even for
397
+ other architectures). E.g. If we use a standard modern Linux x86_64
398
+ machine as an example, the default distribution is
399
+ _`x86_64-unknown-linux-gnu-install_only_stripped`_ and the versions for
400
+ these are installed by default at `~/.local/share/pystand/<version>`.
401
+
402
+ However, let's say you want to experiment with the new free-threaded
403
+ 3.13 build, installed to a different directory. E.g.:
404
+
405
+ ```sh
406
+ $ mkdir ./3.13-freethreaded
407
+ $ cd ./3.13-freethreaded
408
+
409
+ $ pystand -P. -D x86_64-unknown-linux-gnu-freethreaded+lto-full install 3.13
410
+ $ ./3.13/bin/python -V
411
+ Python 3.13.0
412
+
413
+ $ pystand -P . list
414
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
415
+ ```
416
+
417
+ Note you can set a different default distribution by specifying
418
+ `--distribution` as a [default option](#command-default-options).
419
+
420
+ ### Searching for Available Versions and Distributions
421
+
422
+ The `show` command can be used to search for distributions as seen in the
423
+ following examples.
424
+
425
+ ```sh
426
+
427
+ List all the versions installed on this system (at the default location):
428
+
429
+ ```sh
430
+ $ pystand list
431
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
432
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
433
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
434
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
435
+ ```
436
+
437
+ The above shows versions 3.9, 3.12, and 3.13 are installed from the latest
438
+ release 20241016. Version 3.8 is installed from the previous release
439
+ 20241002 (and is not available in the latest release otherwise it would
440
+ be shown with an update message).
441
+
442
+ Now show all available versions from the latest release:
443
+
444
+ ```sh
445
+ $ pystand show
446
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
447
+ 3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
448
+ 3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
449
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
450
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
451
+ ```
452
+
453
+ We can see that versions 3.9, 3.12, and 3.13 are already installed (as
454
+ we also knew from list output), and that 3.10 and 3.11 are also available.
455
+
456
+ What is available from the previous release 20241002?
457
+
458
+ ```sh
459
+ $ pystand show -r 20241002
460
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
461
+ 3.9.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
462
+ 3.10.15 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
463
+ 3.11.10 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
464
+ 3.12.7 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
465
+ 3.13.0rc3 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
466
+ ```
467
+
468
+ Let's install one of the threaded builds of Python 3.13. We can use the
469
+ `-a/-all` option to show all available distributions and then give the
470
+ `show` command a [regular
471
+ expression](https://en.wikipedia.org/wiki/Regular_expression) to filter
472
+ the output (this is really just a shorthand for piping the output of
473
+ `show -a` to grep). E.g.:
474
+
475
+ ```sh
476
+ $ pystand show -a 3.13.*x86_64.*unknown-linux-gnu.*thread
477
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+debug-full"
478
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo+lto-full"
479
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo-full"
480
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+debug-full"
481
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo+lto-full"
482
+ 3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo-full"
483
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+debug-full"
484
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
485
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo-full"
486
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+debug-full"
487
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
488
+ 3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+noopt-full"
489
+ ```
490
+
491
+ So let's install the
492
+ `x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full` build of Python
493
+ 3.13 (to the default location):
494
+
495
+ ```sh
496
+ $ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install 3.13
497
+ Version "3.13.0" is already installed.
498
+ ```
499
+
500
+ An error is given because the version is already installed. We can
501
+ overwrite that with the `-f/--force` option:
502
+
503
+ ```sh
504
+ $ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install -f 3.13
505
+ Version 3.13.0 @ 20241016 installed.
506
+ ```
507
+
508
+ Now we can see the new version distribution is installed:
509
+
510
+ ```sh
511
+
512
+ $ pystand list
513
+ 3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
514
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
515
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
516
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
517
+
518
+ $ pystand show
519
+ 3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
520
+ 3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
521
+ 3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
522
+ 3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
523
+ 3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
524
+ 3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full" (installed)
525
+ ```
526
+
527
+ Note that `pystand` caches all downloaded files (at least for a period
528
+ specified by `--purge-days`) so you can easily switch between different
529
+ versions/distributions quite quickly. You can also choose to install any
530
+ distribution/build in a specific directory using the `-P/--prefix-dir`
531
+ global option if you want to keep different distributions separate and
532
+ available in parallel.
533
+
410
534
  ## Command Default Options
411
535
 
412
536
  You can add default global options to a personal configuration file
@@ -423,11 +547,11 @@ as defaults.
423
547
 
424
548
  ## Github API Rate Limiting
425
549
 
426
- This tool minimises and caches Github API responses from the
427
- [`python-build-standalone`][pbs] repository. However, if you install
428
- many different versions particularly across various releases, you may
429
- get rate limited by Github so the command will block and you will see
430
- "backoff" messages reported. You can create a Github access token to
550
+ This tool minimises and caches Github API responses and file downloads
551
+ from the [`python-build-standalone`][pbs] repository. However, if you
552
+ install many different versions particularly across various releases,
553
+ you may get rate limited by Github so the command can block and you will
554
+ see "backoff" messages reported. You can create a Github access token to
431
555
  gain increased rate limits. Create a token in your Github account under
432
556
  `Settings -> Developer settings -> Personal access tokens`. Specify the
433
557
  token on the command line with `--github-access-token`, or set that as a
@@ -163,9 +163,19 @@ def fetch(args: Namespace, release: str, url: str, tdir: Path) -> str | None:
163
163
  except Exception as e:
164
164
  error = f'Failed to unpack "{url}": {e}'
165
165
  else:
166
- pdir = tmpdir / 'python' / 'install'
167
- if not pdir.exists():
168
- pdir = pdir.parent
166
+ pdir = tmpdir / 'python'
167
+ idir = pdir / 'install'
168
+ if idir.exists():
169
+ # This is a source distribution, copy the source if
170
+ # requested
171
+ if args.include_source:
172
+ srcdir = idir / 'src'
173
+ for subpath in pdir.iterdir():
174
+ if subpath.name != idir.name:
175
+ srcdir.mkdir(parents=True, exist_ok=True)
176
+ subpath.replace(srcdir / subpath.name)
177
+
178
+ pdir = idir
169
179
 
170
180
  pdir.replace(tdir)
171
181
 
@@ -523,14 +533,15 @@ def main() -> str | None:
523
533
 
524
534
  # Parse arguments
525
535
  opt = ArgumentParser(description=__doc__,
526
- epilog='Note you can set default starting global options '
527
- f'in {CNFFILE}.')
536
+ epilog='Some commands offer aliases as shown in brackets above. '
537
+ 'Note you can set default starting global options in '
538
+ f'{CNFFILE}.')
528
539
 
529
540
  # Set up main/global arguments
530
541
  opt.add_argument('-D', '--distribution',
531
542
  help=f'{REPO} distribution. '
532
- f'Default is auto-detected (detected as "{distro_help}" '
533
- 'for this current host).')
543
+ f'Default is "{distro_help}" '
544
+ 'for this host.')
534
545
  opt.add_argument('-P', '--prefix-dir', default=prefix_dir,
535
546
  help='specify prefix dir for storing '
536
547
  'versions. Default is "%(default)s"')
@@ -565,8 +576,10 @@ def main() -> str | None:
565
576
  else:
566
577
  return f'Must define a docstring for command class "{name}".'
567
578
 
579
+ aliases = cls.aliases if hasattr(cls, 'aliases') else []
568
580
  title = get_title(desc)
569
- cmdopt = cmd.add_parser(name, description=desc, help=title)
581
+ cmdopt = cmd.add_parser(name, description=desc, help=title,
582
+ aliases=aliases)
570
583
 
571
584
  # Set up this commands own arguments, if it has any
572
585
  if hasattr(cls, 'init'):
@@ -636,6 +649,9 @@ class _install(COMMAND):
636
649
  'default is latest release')
637
650
  parser.add_argument('-f', '--force', action='store_true',
638
651
  help='force install even if already installed')
652
+ parser.add_argument('-s', '--include-source', action='store_true',
653
+ help='also install source files if available in '
654
+ 'distribution download')
639
655
  parser.add_argument('version', nargs='+',
640
656
  help='version to install. E.g. 3.12 or 3.12.3')
641
657
 
@@ -666,6 +682,8 @@ class _install(COMMAND):
666
682
  @COMMAND.add
667
683
  class _update(COMMAND):
668
684
  'Update one, more, or all versions to another release.'
685
+ aliases = ['upgrade']
686
+
669
687
  @staticmethod
670
688
  def init(parser: ArgumentParser) -> None:
671
689
  parser.add_argument('-r', '--release',
@@ -692,7 +710,8 @@ class _update(COMMAND):
692
710
 
693
711
  matcher = VersionMatcher(files)
694
712
  for version in get_version_names(args):
695
- if not (data := get_json(args._versions / version / args._data)):
713
+ vdir = args._versions / version
714
+ if not (data := get_json(vdir / args._data)):
696
715
  continue
697
716
 
698
717
  if (release := data.get('release')) == release_target:
@@ -719,6 +738,10 @@ class _update(COMMAND):
719
738
  f'{fmt(nextver, release_target)} '
720
739
  f'distribution="{distribution}" ..')
721
740
 
741
+ # If the source was originally included, then include it in
742
+ # the update.
743
+ args.include_source = (vdir / 'src').is_dir()
744
+
722
745
  if error := install(args, new_vdir, release_target, distribution,
723
746
  files):
724
747
  return error
@@ -729,6 +752,8 @@ class _update(COMMAND):
729
752
  @COMMAND.add
730
753
  class _remove(COMMAND):
731
754
  'Remove/uninstall one, more, or all versions.'
755
+ aliases = ['uninstall']
756
+
732
757
  @staticmethod
733
758
  def init(parser: ArgumentParser) -> None:
734
759
  parser.add_argument('-a', '--all', action='store_true',
@@ -827,12 +852,15 @@ class _show(COMMAND):
827
852
  'Show versions available from a release.'
828
853
  @staticmethod
829
854
  def init(parser: ArgumentParser) -> None:
830
- parser.add_argument('-a', '--all', action='store_true',
831
- help='also show all available distributions for '
832
- 'each version from the release')
833
- parser.add_argument('release', nargs='?',
855
+ parser.add_argument('-r', '--release',
834
856
  help=f'{REPO} YYYYMMDD release to show (e.g. '
835
857
  f'{SAMPL_RELEASE}), default is latest release')
858
+ parser.add_argument('-a', '--all', action='store_true',
859
+ help='show all available distributions for '
860
+ 'each version from the release')
861
+ parser.add_argument('re_match', nargs='?',
862
+ help='show only versions+distributions '
863
+ 'matching this regular expression pattern')
836
864
 
837
865
  @staticmethod
838
866
  def run(args: Namespace) -> None:
@@ -859,8 +887,11 @@ class _show(COMMAND):
859
887
  if distribution == args._distribution:
860
888
  installable = True
861
889
 
862
- print(f'{fmt(version, release)} '
863
- f'distribution="{distribution}"{app}')
890
+ if not args.re_match or \
891
+ re.search(args.re_match,
892
+ f'{version}+{distribution}'):
893
+ print(f'{fmt(version, release)} '
894
+ f'distribution="{distribution}"{app}')
864
895
  if not installable:
865
896
  print(f'Warning: no distribution="{args._distribution}" '
866
897
  'versions found in ' f'release "{release}".')
File without changes
File without changes
File without changes
File without changes