pystand 2.2__py3-none-any.whl → 2.4__py3-none-any.whl
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.2.dist-info → pystand-2.4.dist-info}/METADATA +209 -59
- pystand-2.4.dist-info/RECORD +6 -0
- pystand.py +37 -38
- pystand-2.2.dist-info/RECORD +0 -6
- {pystand-2.2.dist-info → pystand-2.4.dist-info}/WHEEL +0 -0
- {pystand-2.2.dist-info → pystand-2.4.dist-info}/entry_points.txt +0 -0
- {pystand-2.2.dist-info → pystand-2.4.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pystand
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.4
|
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
|
@@ -92,16 +92,16 @@ Here are some examples showing how to use an installed version ..
|
|
92
92
|
|
93
93
|
```sh
|
94
94
|
# Use uv to create a virtual environment to be run with latest pystand
|
95
|
-
# installed python:
|
96
|
-
$ uv venv -p $(pystand path) myenv
|
95
|
+
# installed python 3.12:
|
96
|
+
$ uv venv -p $(pystand path 3.12) myenv
|
97
97
|
|
98
98
|
# Create a regular virtual environment to be run with latest pystand
|
99
|
-
# installed python:
|
100
|
-
$ $(pystand path -p) -m venv myenv
|
99
|
+
# installed python 3.12:
|
100
|
+
$ $(pystand path -p 3.12) -m venv myenv
|
101
101
|
|
102
102
|
# Use pipx to install a package to be run with pystand installed python
|
103
|
-
# specific version:
|
104
|
-
$ pipx install --python $(pystand path -p 3.11) cowsay
|
103
|
+
# specific version 3.11.1:
|
104
|
+
$ pipx install --python $(pystand path -p 3.11.1) cowsay
|
105
105
|
```
|
106
106
|
|
107
107
|
See detailed usage information in the [Usage](#usage) section that
|
@@ -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
|
144
|
-
|
145
|
-
|
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"
|
@@ -264,34 +264,38 @@ options:
|
|
264
264
|
### Command `show`
|
265
265
|
|
266
266
|
```
|
267
|
-
usage: pystand show [-h] [-a] [
|
267
|
+
usage: pystand show [-h] [-r RELEASE] [-a] [re_match]
|
268
268
|
|
269
269
|
Show versions available from a release.
|
270
270
|
|
271
271
|
positional arguments:
|
272
|
-
|
273
|
-
|
272
|
+
re_match show only versions+distributions matching this regular
|
273
|
+
expression pattern
|
274
274
|
|
275
275
|
options:
|
276
|
-
-h, --help
|
277
|
-
-
|
278
|
-
|
276
|
+
-h, --help show this help message and exit
|
277
|
+
-r RELEASE, --release RELEASE
|
278
|
+
python-build-standalone YYYYMMDD release to show (e.g.
|
279
|
+
20240415), default is latest release
|
280
|
+
-a, --all show all available distributions for each version from
|
281
|
+
the release
|
279
282
|
```
|
280
283
|
|
281
284
|
### Command `path`
|
282
285
|
|
283
286
|
```
|
284
|
-
usage: pystand path [-h] [-p] [-c | version]
|
287
|
+
usage: pystand path [-h] [-p] [-r] [-c | version]
|
285
288
|
|
286
289
|
Show path prefix to installed version base directory.
|
287
290
|
|
288
291
|
positional arguments:
|
289
|
-
version
|
292
|
+
version version number to show path for
|
290
293
|
|
291
294
|
options:
|
292
|
-
-h, --help
|
293
|
-
-p, --python-path
|
294
|
-
-
|
295
|
+
-h, --help show this help message and exit
|
296
|
+
-p, --python-path add path to python executable
|
297
|
+
-r, --resolve fully resolve given version
|
298
|
+
-c, --cache-path just show path to cache dir
|
295
299
|
```
|
296
300
|
|
297
301
|
## Installation and Upgrade
|
@@ -319,19 +323,78 @@ To uninstall:
|
|
319
323
|
$ pipx uninstall pystand
|
320
324
|
```
|
321
325
|
|
326
|
+
## Extrapolation of Python Versions
|
327
|
+
|
328
|
+
For all commands except the `path` command, `pystand` extrapolates
|
329
|
+
version text you specify on the command line to the latest available
|
330
|
+
corresponding installed or release version. For example, if you specify
|
331
|
+
`pystand install 3.12` then `pystand` will look in the release files to
|
332
|
+
find the latest (i.e. highest) available version of `3.12`, e.g.
|
333
|
+
`3.12.3` (at the time of writing), and will install that. Of course you
|
334
|
+
can specify the exact version if you wish, e.g. `3.12.3` but generally
|
335
|
+
you don't need to bother. This is true for any command that takes a
|
336
|
+
version argument so be aware that this may be confusing if there are
|
337
|
+
multiple same Python minor versions, e.g. `3.12.1` and `3.12.3`,
|
338
|
+
installed from different releases. So in that case you should specify
|
339
|
+
the exact version because e.g. `pystand remove 3.12` will remove
|
340
|
+
`3.12.3` which may not be what you want.
|
341
|
+
|
342
|
+
Note, consistent with this, you actually don't need to specify a
|
343
|
+
minor version, e.g. `pystand install 3` would also install `3.12.3`
|
344
|
+
(assuming `3.12.3` is the latest available version for Python 3).
|
345
|
+
|
346
|
+
After installs or updates or removals,`pystand` also maintains symbolic
|
347
|
+
links to each latest installed version in it's version directory, e.g. a
|
348
|
+
symlink `~/.local/share/pystand/versions/3.12` will be created pointing
|
349
|
+
to `~/.local/share/pystand/versions/3.12.3` so that you can optionally
|
350
|
+
hard code the symlink directory in places where it can not be set
|
351
|
+
dynamically (i.e. where using `pystand path` is not an option).
|
352
|
+
|
353
|
+
You can exploit these symlinks when you create virtual environments
|
354
|
+
using the `pystand path` command (or just hard code the actual link/path
|
355
|
+
for your environment/platform). E.g. The following creates a virtual
|
356
|
+
environment which runs with whatever the currently latest installed
|
357
|
+
Python 3.12 version is:
|
358
|
+
|
359
|
+
```sh
|
360
|
+
# Use uv to create a virtual environment to be run with a symlink to
|
361
|
+
# currently latest installed python 3.12:
|
362
|
+
$ uv venv -p $(pystand path 3.12)
|
363
|
+
```
|
364
|
+
|
365
|
+
So if you then update to a new version of Python 3.12 using `pystand`,
|
366
|
+
e.g. from 3.12.3 to 3.12.4, the virtual environment will automatically
|
367
|
+
use the new Python version. However, if you for some reason want to
|
368
|
+
create the virtual environment with a specific version of Python that is
|
369
|
+
never changed, then just specify that exact version when you create the
|
370
|
+
virtual environment, e.g.:
|
371
|
+
|
372
|
+
```sh
|
373
|
+
# Use uv to create a virtual environment to be run with specific pystand
|
374
|
+
# installed python 3.12.2:
|
375
|
+
$ uv venv -p $(pystand path 3.12.2)
|
376
|
+
|
377
|
+
# If you can't be bothered to look up the current latest version, then
|
378
|
+
# the following command will do the same thing as above because it
|
379
|
+
# resolves the symlink to the current latest 3.12 version at the time
|
380
|
+
# you run this command:
|
381
|
+
$ uv venv -p $(pystand path -r 3.12)
|
382
|
+
```
|
383
|
+
|
322
384
|
## Installing Other Builds/Distributions
|
323
385
|
|
324
|
-
The _`install_only_stripped`_ build
|
325
|
-
|
386
|
+
The _`install_only_stripped`_ distribution build is installed by default
|
387
|
+
for your running machine architecture. See description of
|
388
|
+
distributions/builds
|
326
389
|
[here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
|
327
|
-
However, you can choose to install other distributions/builds
|
328
|
-
we use a standard modern Linux x86_64
|
329
|
-
distribution is
|
330
|
-
the versions for
|
331
|
-
`~/.local/share/pystand/<version>`.
|
390
|
+
However, you can choose to install other distributions/builds (even for
|
391
|
+
other architectures). E.g. If we use a standard modern Linux x86_64
|
392
|
+
machine as an example, the default distribution is
|
393
|
+
_`x86_64-unknown-linux-gnu-install_only_stripped`_ and the versions for
|
394
|
+
these are installed by default at `~/.local/share/pystand/<version>`.
|
332
395
|
|
333
396
|
However, let's say you want to experiment with the new free-threaded
|
334
|
-
3.13 build
|
397
|
+
3.13 build, installed to a different directory. E.g.:
|
335
398
|
|
336
399
|
```sh
|
337
400
|
$ mkdir ./3.13-freethreaded
|
@@ -345,35 +408,122 @@ $ pystand -P . list
|
|
345
408
|
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
|
346
409
|
```
|
347
410
|
|
348
|
-
Note you can set a different default distribution by
|
349
|
-
|
350
|
-
option](#command-default-options).
|
411
|
+
Note you can set a different default distribution by specifying
|
412
|
+
`--distribution` as a [default option](#command-default-options).
|
351
413
|
|
352
|
-
|
414
|
+
### Searching for Available Versions and Distributions
|
353
415
|
|
354
|
-
`
|
355
|
-
|
356
|
-
example, if you specify `pystand install 3.12` then `pystand` will look
|
357
|
-
in the release files to find the latest (i.e. highest) available version
|
358
|
-
of `3.12`, e.g. `3.12.3` (at the time of writing), and will install
|
359
|
-
that. Of course you can specify the exact version if you wish, e.g.
|
360
|
-
`3.12.3` but generally you don't need to bother. This is true for any
|
361
|
-
command that takes a version argument so be aware that this may be
|
362
|
-
confusing if there are multiple same Python minor versions, e.g.
|
363
|
-
`3.12.1` and `3.12.3`, installed from different releases. So in that
|
364
|
-
case you should specify the exact version because e.g. `pystand remove
|
365
|
-
3.12` will remove `3.12.3` which may not be what you want.
|
416
|
+
The `show` command can be used to search for distributions as seen in the
|
417
|
+
following examples.
|
366
418
|
|
367
|
-
|
368
|
-
minor version, e.g. `pystand install 3` would also install `3.12.3`
|
369
|
-
(assuming `3.12.3` is the latest available version for Python 3).
|
419
|
+
```sh
|
370
420
|
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
421
|
+
List all the versions installed on this system (at the default location):
|
422
|
+
|
423
|
+
```sh
|
424
|
+
$ pystand list
|
425
|
+
3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
426
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
427
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
428
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
429
|
+
```
|
430
|
+
|
431
|
+
The above shows versions 3.9, 3.12, and 3.13 are installed from the latest
|
432
|
+
release 20241016. Version 3.8 is installed from the previous release
|
433
|
+
20241002 (and is not available in the latest release otherwise it would
|
434
|
+
be shown with an update message).
|
435
|
+
|
436
|
+
Now show all available versions from the latest release:
|
437
|
+
|
438
|
+
```sh
|
439
|
+
$ pystand show
|
440
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
441
|
+
3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
442
|
+
3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
443
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
444
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
445
|
+
```
|
446
|
+
|
447
|
+
We can see that versions 3.9, 3.12, and 3.13 are already installed (as
|
448
|
+
we also knew from list output), and that 3.10 and 3.11 are also available.
|
449
|
+
|
450
|
+
What is available from the previous release 20241002?
|
451
|
+
|
452
|
+
```sh
|
453
|
+
$ pystand show -r 20241002
|
454
|
+
3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
455
|
+
3.9.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
456
|
+
3.10.15 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
457
|
+
3.11.10 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
458
|
+
3.12.7 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
459
|
+
3.13.0rc3 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
460
|
+
```
|
461
|
+
|
462
|
+
Let's install one of the threaded builds of Python 3.13. We can use the
|
463
|
+
`-a/-all` option to show all available distributions and then give the
|
464
|
+
`show` command a [regular
|
465
|
+
expression](https://en.wikipedia.org/wiki/Regular_expression) to filter
|
466
|
+
the output (this is really just a shorthand for piping the output of
|
467
|
+
`show -a` to grep). E.g.:
|
468
|
+
|
469
|
+
```sh
|
470
|
+
$ pystand show -a 3.13.*x86_64.*unknown-linux-gnu.*thread
|
471
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+debug-full"
|
472
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
473
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo-full"
|
474
|
+
3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+debug-full"
|
475
|
+
3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
476
|
+
3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo-full"
|
477
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+debug-full"
|
478
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
479
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo-full"
|
480
|
+
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+debug-full"
|
481
|
+
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
|
482
|
+
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+noopt-full"
|
483
|
+
```
|
484
|
+
|
485
|
+
So let's install the
|
486
|
+
`x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full` build of Python
|
487
|
+
3.13 (to the default location):
|
488
|
+
|
489
|
+
```sh
|
490
|
+
$ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install 3.13
|
491
|
+
Version "3.13.0" is already installed.
|
492
|
+
```
|
493
|
+
|
494
|
+
An error is given because the version is already installed. We can
|
495
|
+
overwrite that with the `-f/--force` option:
|
496
|
+
|
497
|
+
```sh
|
498
|
+
$ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install -f 3.13
|
499
|
+
Version 3.13.0 @ 20241016 installed.
|
500
|
+
```
|
501
|
+
|
502
|
+
Now we can see the new version distribution is installed:
|
503
|
+
|
504
|
+
```sh
|
505
|
+
|
506
|
+
$ pystand list
|
507
|
+
3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
508
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
509
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
510
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
511
|
+
|
512
|
+
$ pystand show
|
513
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
514
|
+
3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
515
|
+
3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
516
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
517
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
518
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full" (installed)
|
519
|
+
```
|
520
|
+
|
521
|
+
Note that `pystand` caches all downloaded files (at least for a period
|
522
|
+
specified by `--purge-days`) so you can easily switch between different
|
523
|
+
versions/distributions quite quickly. You can also choose to install any
|
524
|
+
distribution/build in a specific directory using the `-P/--prefix-dir`
|
525
|
+
global option if you want to keep different distributions separate and
|
526
|
+
available in parallel.
|
377
527
|
|
378
528
|
## Command Default Options
|
379
529
|
|
@@ -391,11 +541,11 @@ as defaults.
|
|
391
541
|
|
392
542
|
## Github API Rate Limiting
|
393
543
|
|
394
|
-
This tool minimises and caches Github API responses
|
395
|
-
[`python-build-standalone`][pbs] repository. However, if you
|
396
|
-
many different versions particularly across various releases,
|
397
|
-
get rate limited by Github so the command
|
398
|
-
"backoff" messages reported. You can create a Github access token to
|
544
|
+
This tool minimises and caches Github API responses and file downloads
|
545
|
+
from the [`python-build-standalone`][pbs] repository. However, if you
|
546
|
+
install many different versions particularly across various releases,
|
547
|
+
you may get rate limited by Github so the command can block and you will
|
548
|
+
see "backoff" messages reported. You can create a Github access token to
|
399
549
|
gain increased rate limits. Create a token in your Github account under
|
400
550
|
`Settings -> Developer settings -> Personal access tokens`. Specify the
|
401
551
|
token on the command line with `--github-access-token`, or set that as a
|
@@ -0,0 +1,6 @@
|
|
1
|
+
pystand.py,sha256=DGbYpdOu54cMuasq0hpcSfhn8vNhT-dDll4Xx6Xx628,33340
|
2
|
+
pystand-2.4.dist-info/METADATA,sha256=GdWm913Z7KD50Wq7gsHPR5COHU1fZhSuONSYFBf_H5c,24353
|
3
|
+
pystand-2.4.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
4
|
+
pystand-2.4.dist-info/entry_points.txt,sha256=DG4ps3I3nni1bubV1tXs6u8FARgkdbAYaEAzZD4RAo8,41
|
5
|
+
pystand-2.4.dist-info/top_level.txt,sha256=NoWUh19UQymAJLHTCdxMnVwV6Teftef5fzyF3OWLyNY,8
|
6
|
+
pystand-2.4.dist-info/RECORD,,
|
pystand.py
CHANGED
@@ -529,8 +529,8 @@ def main() -> str | None:
|
|
529
529
|
# Set up main/global arguments
|
530
530
|
opt.add_argument('-D', '--distribution',
|
531
531
|
help=f'{REPO} distribution. '
|
532
|
-
f'Default is
|
533
|
-
'for this
|
532
|
+
f'Default is "{distro_help}" '
|
533
|
+
'for this host.')
|
534
534
|
opt.add_argument('-P', '--prefix-dir', default=prefix_dir,
|
535
535
|
help='specify prefix dir for storing '
|
536
536
|
'versions. Default is "%(default)s"')
|
@@ -827,12 +827,15 @@ class _show(COMMAND):
|
|
827
827
|
'Show versions available from a release.'
|
828
828
|
@staticmethod
|
829
829
|
def init(parser: ArgumentParser) -> None:
|
830
|
-
parser.add_argument('-
|
831
|
-
help='also show all available distributions for '
|
832
|
-
'each version from the release')
|
833
|
-
parser.add_argument('release', nargs='?',
|
830
|
+
parser.add_argument('-r', '--release',
|
834
831
|
help=f'{REPO} YYYYMMDD release to show (e.g. '
|
835
832
|
f'{SAMPL_RELEASE}), default is latest release')
|
833
|
+
parser.add_argument('-a', '--all', action='store_true',
|
834
|
+
help='show all available distributions for '
|
835
|
+
'each version from the release')
|
836
|
+
parser.add_argument('re_match', nargs='?',
|
837
|
+
help='show only versions+distributions '
|
838
|
+
'matching this regular expression pattern')
|
836
839
|
|
837
840
|
@staticmethod
|
838
841
|
def run(args: Namespace) -> None:
|
@@ -859,8 +862,11 @@ class _show(COMMAND):
|
|
859
862
|
if distribution == args._distribution:
|
860
863
|
installable = True
|
861
864
|
|
862
|
-
|
863
|
-
|
865
|
+
if not args.re_match or \
|
866
|
+
re.search(args.re_match,
|
867
|
+
f'{version}+{distribution}'):
|
868
|
+
print(f'{fmt(version, release)} '
|
869
|
+
f'distribution="{distribution}"{app}')
|
864
870
|
if not installable:
|
865
871
|
print(f'Warning: no distribution="{args._distribution}" '
|
866
872
|
'versions found in ' f'release "{release}".')
|
@@ -871,47 +877,40 @@ class _path(COMMAND):
|
|
871
877
|
@staticmethod
|
872
878
|
def init(parser: ArgumentParser) -> None:
|
873
879
|
parser.add_argument('-p', '--python-path', action='store_true',
|
874
|
-
help='
|
880
|
+
help='add path to python executable')
|
881
|
+
parser.add_argument('-r', '--resolve', action='store_true',
|
882
|
+
help='fully resolve given version')
|
875
883
|
group = parser.add_mutually_exclusive_group()
|
876
|
-
group.add_argument('-c', '--cache-
|
877
|
-
help='
|
884
|
+
group.add_argument('-c', '--cache-path', action='store_true',
|
885
|
+
help='just show path to cache dir')
|
878
886
|
group.add_argument('version', nargs='?',
|
879
|
-
help='
|
887
|
+
help='version number to show path for')
|
880
888
|
|
881
889
|
@staticmethod
|
882
890
|
def run(args: Namespace) -> str | None:
|
883
|
-
|
891
|
+
version = args.version
|
892
|
+
if args.cache_path or not version:
|
884
893
|
if args.python_path:
|
885
894
|
args.parser.error('Can not specify --python-path.')
|
886
|
-
print(args._downloads.parent)
|
887
|
-
return
|
888
895
|
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
896
|
+
print(args._downloads.parent if args.cache_path else args._versions)
|
897
|
+
else:
|
898
|
+
path = args._versions / version
|
899
|
+
if not path.is_symlink() or not path.exists():
|
900
|
+
return f'Version "{version}" is not installed.'
|
894
901
|
|
895
|
-
|
896
|
-
|
897
|
-
if not version:
|
898
|
-
return 'No Python version installed.'
|
902
|
+
if args.resolve:
|
903
|
+
path = path.resolve()
|
899
904
|
|
900
|
-
|
901
|
-
|
902
|
-
|
905
|
+
if args.python_path:
|
906
|
+
basepath = path
|
907
|
+
path = basepath / 'bin' / 'python'
|
908
|
+
if not path.exists():
|
909
|
+
path = basepath / 'python.exe'
|
910
|
+
if not path.exists():
|
911
|
+
return 'Error: Can not find python executable in '\
|
912
|
+
f'"{basepath}"'
|
903
913
|
|
904
|
-
if args.python_path:
|
905
|
-
subpath = path / 'bin' / 'python'
|
906
|
-
if subpath.exists():
|
907
|
-
print(subpath)
|
908
|
-
else:
|
909
|
-
subpath = path / 'python.exe'
|
910
|
-
if subpath.exists():
|
911
|
-
print(subpath)
|
912
|
-
else:
|
913
|
-
return f'Error: Can not find python executable in "{path}"'
|
914
|
-
else:
|
915
914
|
print(path)
|
916
915
|
|
917
916
|
if __name__ == '__main__':
|
pystand-2.2.dist-info/RECORD
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
pystand.py,sha256=tOQ4SxeqAtz3Tc-kd9jt_v-Hbx_vXnatHPkT5f1pdAA,33114
|
2
|
-
pystand-2.2.dist-info/METADATA,sha256=45hYFkXnngYMEDtsQ_lciU38qxK-Jl98ZxXyjvhhd2I,17403
|
3
|
-
pystand-2.2.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
4
|
-
pystand-2.2.dist-info/entry_points.txt,sha256=DG4ps3I3nni1bubV1tXs6u8FARgkdbAYaEAzZD4RAo8,41
|
5
|
-
pystand-2.2.dist-info/top_level.txt,sha256=NoWUh19UQymAJLHTCdxMnVwV6Teftef5fzyF3OWLyNY,8
|
6
|
-
pystand-2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|