pystand 2.24__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.24.dist-info/METADATA +658 -0
- pystand-2.24.dist-info/RECORD +6 -0
- pystand-2.24.dist-info/WHEEL +5 -0
- pystand-2.24.dist-info/entry_points.txt +2 -0
- pystand-2.24.dist-info/top_level.txt +1 -0
- pystand.py +1349 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pystand
|
|
3
|
+
Version: 2.24
|
|
4
|
+
Summary: Install Python versions from python-build-standalone project
|
|
5
|
+
Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://github.com/bulletmark/pystand
|
|
8
|
+
Keywords: python-build-standalone,pyenv,hatch,pdm
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: argcomplete
|
|
13
|
+
Requires-Dist: packaging
|
|
14
|
+
Requires-Dist: platformdirs
|
|
15
|
+
Requires-Dist: argparse-from-file
|
|
16
|
+
Requires-Dist: pygithub
|
|
17
|
+
Requires-Dist: certifi
|
|
18
|
+
Requires-Dist: filelock
|
|
19
|
+
Requires-Dist: zstandard; python_version < "3.14"
|
|
20
|
+
|
|
21
|
+
## PYSTAND - Install Python Versions From The Python-Build-Standalone Project
|
|
22
|
+
[](https://pypi.org/project/pystand/)
|
|
23
|
+
[](https://aur.archlinux.org/packages/pystand/)
|
|
24
|
+
|
|
25
|
+
[`pystand`][pystand] is a command line tool to facilitate the download,
|
|
26
|
+
installation, and update of pre-built Python versions from the
|
|
27
|
+
[`python-build-standalone`][pbs] project. The following commands are
|
|
28
|
+
provided:
|
|
29
|
+
|
|
30
|
+
|Command|Description|
|
|
31
|
+
|---------|--------------------------------------------------------------------|
|
|
32
|
+
|`install`|Install one, more, or all versions from a python-build-standalone release.|
|
|
33
|
+
|`update` (or `upgrade`)|Update one, more, or all versions to another release.|
|
|
34
|
+
|`remove` (or `uninstall`)|Remove/uninstall one, more, or all versions.|
|
|
35
|
+
|`list`|List installed versions and show which have an update available.|
|
|
36
|
+
|`show`|Show versions available from a release.|
|
|
37
|
+
|`path`|Show path prefix to installed version base directory.|
|
|
38
|
+
|
|
39
|
+
By default, Python versions are sourced from the latest
|
|
40
|
+
`python-build-standalone` [release][pbs-rel] available (e.g.
|
|
41
|
+
"`20240415`") but you can optionally specify any older release. The
|
|
42
|
+
required
|
|
43
|
+
[distribution](https://gregoryszorc.com/docs/python-build-standalone/main/running.html)
|
|
44
|
+
for your machine architecture is normally auto-detected. By default, the
|
|
45
|
+
_`install_only_stripped`_ build of the distribution is installed but you
|
|
46
|
+
can choose to [install any other
|
|
47
|
+
build/distribution](#installing-other-buildsdistributions) instead, or
|
|
48
|
+
in parallel.
|
|
49
|
+
|
|
50
|
+
Some simple usage examples are:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
$ pystand install 3.12
|
|
54
|
+
Version 3.12.3 @ 20240415 installed.
|
|
55
|
+
|
|
56
|
+
$ ls -l $(pystand path 3.12)/bin
|
|
57
|
+
total 4136
|
|
58
|
+
lrwxrwxrwx 1 user user 9 May 30 22:23 2to3 -> 2to3-3.12
|
|
59
|
+
-rwxrwxr-x 1 user user 128 Jan 1 10:00 2to3-3.12
|
|
60
|
+
lrwxrwxrwx 1 user user 8 May 30 22:23 idle3 -> idle3.12
|
|
61
|
+
-rwxrwxr-x 1 user user 126 Jan 1 10:00 idle3.12
|
|
62
|
+
-rwxrwxr-x 1 user user 256 Jan 1 10:00 pip
|
|
63
|
+
-rwxrwxr-x 1 user user 256 Jan 1 10:00 pip3
|
|
64
|
+
-rwxrwxr-x 1 user user 256 Jan 1 10:00 pip3.12
|
|
65
|
+
lrwxrwxrwx 1 user user 9 May 30 22:23 pydoc3 -> pydoc3.12
|
|
66
|
+
-rwxrwxr-x 1 user user 111 Jan 1 10:00 pydoc3.12
|
|
67
|
+
lrwxrwxrwx 1 user user 10 May 30 22:23 python -> python3.12
|
|
68
|
+
lrwxrwxrwx 1 user user 10 May 30 22:23 python3 -> python3.12
|
|
69
|
+
-rwxrwxr-x 1 user user 4206512 Jan 1 10:00 python3.12
|
|
70
|
+
-rwxrwxr-x 1 user user 3078 Jan 1 10:00 python3.12-config
|
|
71
|
+
lrwxrwxrwx 1 user user 17 May 30 22:23 python3-config -> python3.12-config
|
|
72
|
+
|
|
73
|
+
$ pystand install 3.10
|
|
74
|
+
Version 3.10.14 @ 20240415 installed.
|
|
75
|
+
|
|
76
|
+
$ pystand list
|
|
77
|
+
3.10.14 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
78
|
+
3.12.3 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
79
|
+
|
|
80
|
+
$ pystand show
|
|
81
|
+
3.8.19 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
82
|
+
3.9.19 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
83
|
+
3.10.14 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
84
|
+
3.11.9 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
85
|
+
3.12.3 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
86
|
+
|
|
87
|
+
$ pystand remove 3.10
|
|
88
|
+
Version 3.10.14 @ 20240415 removed.
|
|
89
|
+
|
|
90
|
+
$ pystand list
|
|
91
|
+
3.12.3 @ 20240415 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
92
|
+
|
|
93
|
+
# Install all available versions from latest release:
|
|
94
|
+
$ pystand install -a
|
|
95
|
+
Version 3.8.19 @ 20240415 installed.
|
|
96
|
+
Version 3.9.19 @ 20240415 installed.
|
|
97
|
+
Version 3.10.14 @ 20240415 installed.
|
|
98
|
+
Version 3.11.9 @ 20240415 installed.
|
|
99
|
+
Version 3.12.3 is already installed.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Here are some examples showing how to use an installed version ..
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
# Use uv to create a virtual environment to be run with latest pystand
|
|
106
|
+
# installed python 3.12:
|
|
107
|
+
$ uv venv -p $(pystand path 3.12) myenv
|
|
108
|
+
|
|
109
|
+
# Create a regular virtual environment to be run with latest pystand
|
|
110
|
+
# installed python 3.12:
|
|
111
|
+
$ $(pystand path -p 3.12) -m venv myenv
|
|
112
|
+
|
|
113
|
+
# Use uv tool to install a package to be run with pystand installed python
|
|
114
|
+
# specific version 3.11.1:
|
|
115
|
+
$ uv tool install -p $(pystand path 3.11.1) cowsay
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
See detailed usage information in the [Usage](#usage) section that
|
|
119
|
+
follows.
|
|
120
|
+
|
|
121
|
+
Note that similar tools such as [`pdm python`][pdmpy], [`hatch
|
|
122
|
+
python`][hatchpy], and [`rye toolchain`][ryepy] also use
|
|
123
|
+
[`python-build-standalone`][pbs] build releases. However, `pystand` is
|
|
124
|
+
unique because it directly checks the [`python-build-standalone`][pbs]
|
|
125
|
+
github site for new [releases][pbs-rel]. Those other tools
|
|
126
|
+
require a software update before they can fetch and use new
|
|
127
|
+
[`python-build-standalone`][pbs] releases. This means that new Python
|
|
128
|
+
versions and updates are always available more quickly from `pystand`
|
|
129
|
+
than those other tools.
|
|
130
|
+
|
|
131
|
+
This utility has been developed and tested on Linux but should also work
|
|
132
|
+
on macOS and Windows although has not been tried on those platforms. The
|
|
133
|
+
latest documentation and code is available at
|
|
134
|
+
https://github.com/bulletmark/pystand.
|
|
135
|
+
|
|
136
|
+
## Usage
|
|
137
|
+
|
|
138
|
+
Type `pystand` or `pystand -h` to view the usage summary:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
usage: pystand [-h] [-D DISTRIBUTION] [-P PREFIX_DIR] [-C CACHE_DIR]
|
|
142
|
+
[-M CACHE_MINUTES] [--purge-days PURGE_DAYS]
|
|
143
|
+
[--github-access-token GITHUB_ACCESS_TOKEN] [--no-strip]
|
|
144
|
+
[--no-color] [--cert {system,certifi,none}] [-V]
|
|
145
|
+
{install,update,upgrade,remove,uninstall,list,show,path,cache} ...
|
|
146
|
+
|
|
147
|
+
Command line tool to download, install, and update pre-built Python versions
|
|
148
|
+
from the python-build-standalone project at https://github.com/astral-
|
|
149
|
+
sh/python-build-standalone.
|
|
150
|
+
|
|
151
|
+
options:
|
|
152
|
+
-h, --help show this help message and exit
|
|
153
|
+
-D, --distribution DISTRIBUTION
|
|
154
|
+
python-build-standalone distribution. Default is
|
|
155
|
+
"x86_64_v3-unknown-linux-gnu-install_only_stripped"
|
|
156
|
+
for this host. Run "pystand show -a" to see all
|
|
157
|
+
distributions. See
|
|
158
|
+
https://gregoryszorc.com/docs/python-build-
|
|
159
|
+
standalone/main/
|
|
160
|
+
-P, --prefix-dir PREFIX_DIR
|
|
161
|
+
specify prefix dir for storing versions. Default is
|
|
162
|
+
"$HOME/.local/share/pystand".
|
|
163
|
+
-C, --cache-dir CACHE_DIR
|
|
164
|
+
specify cache dir for downloads. Default is
|
|
165
|
+
"$HOME/.cache/pystand".
|
|
166
|
+
-M, --cache-minutes CACHE_MINUTES
|
|
167
|
+
cache latest YYYYMMDD release tag fetch for this many
|
|
168
|
+
minutes, before rechecking for latest. Default is 60
|
|
169
|
+
minutes.
|
|
170
|
+
--purge-days PURGE_DAYS
|
|
171
|
+
cache YYYYMMDD release file lists and downloads for
|
|
172
|
+
this number of days after last version referencing
|
|
173
|
+
that release is removed. Default is 90 days.
|
|
174
|
+
--github-access-token GITHUB_ACCESS_TOKEN
|
|
175
|
+
optional Github access token. Can specify to reduce
|
|
176
|
+
rate limiting.
|
|
177
|
+
--no-strip do not strip downloaded binaries
|
|
178
|
+
--no-color do not use color in output
|
|
179
|
+
--cert {system,certifi,none}
|
|
180
|
+
specify which SSL certificates to use for HTTPS
|
|
181
|
+
requests. Default="system".
|
|
182
|
+
-V, --version just show pystand version
|
|
183
|
+
|
|
184
|
+
Commands:
|
|
185
|
+
{install,update,upgrade,remove,uninstall,list,show,path,cache}
|
|
186
|
+
install Install one, more, or all versions from a python-
|
|
187
|
+
build-standalone release.
|
|
188
|
+
update (upgrade) Update one, more, or all versions to another release.
|
|
189
|
+
remove (uninstall) Remove/uninstall one, more, or all versions.
|
|
190
|
+
list List installed versions and show which have an update
|
|
191
|
+
available.
|
|
192
|
+
show Show versions available from a release.
|
|
193
|
+
path Show path prefix to installed version base directory.
|
|
194
|
+
cache Show size of release download caches.
|
|
195
|
+
|
|
196
|
+
Some commands offer aliases as shown in parentheses above. Note you can set
|
|
197
|
+
default starting global options in ~/.config/pystand-flags.conf.
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Type `pystand <command> -h` to see specific help/usage for any
|
|
201
|
+
individual command:
|
|
202
|
+
|
|
203
|
+
### Command `install`
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
usage: pystand install [-h] [-r RELEASE] [-a] [-A] [--skip] [-f] [-s]
|
|
207
|
+
[version ...]
|
|
208
|
+
|
|
209
|
+
Install one, more, or all versions from a python-build-standalone release.
|
|
210
|
+
|
|
211
|
+
positional arguments:
|
|
212
|
+
version version to install. E.g. 3.12 or 3.12.3
|
|
213
|
+
|
|
214
|
+
options:
|
|
215
|
+
-h, --help show this help message and exit
|
|
216
|
+
-r, --release RELEASE
|
|
217
|
+
install from specified python-build-standalone
|
|
218
|
+
YYYYMMDD release (e.g. 20240415), default is latest
|
|
219
|
+
release
|
|
220
|
+
-a, --all install ALL versions from release
|
|
221
|
+
-A, --all-prerelease install ALL versions from release, including pre-
|
|
222
|
+
releases
|
|
223
|
+
--skip skip the specified versions when installing all (only
|
|
224
|
+
can be specified with --all)
|
|
225
|
+
-f, --force force install even if already installed
|
|
226
|
+
-s, --include-source also install source files if available in distribution
|
|
227
|
+
download
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Command `update`
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
usage: pystand update [-h] [-r RELEASE] [-a] [--skip] [-k] [version ...]
|
|
234
|
+
|
|
235
|
+
Update one, more, or all versions to another release.
|
|
236
|
+
|
|
237
|
+
positional arguments:
|
|
238
|
+
version version to update (or to skip for --all --skip)
|
|
239
|
+
|
|
240
|
+
options:
|
|
241
|
+
-h, --help show this help message and exit
|
|
242
|
+
-r, --release RELEASE
|
|
243
|
+
update to specified YYYMMDD release (e.g. 20240415),
|
|
244
|
+
default is latest release
|
|
245
|
+
-a, --all update ALL versions
|
|
246
|
+
--skip skip the specified versions when updating all (only
|
|
247
|
+
can be specified with --all)
|
|
248
|
+
-k, --keep keep old version after updating (but only if different
|
|
249
|
+
version number)
|
|
250
|
+
|
|
251
|
+
aliases: upgrade
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Command `remove`
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
usage: pystand remove [-h] [-a] [--skip] [-r RELEASE] [version ...]
|
|
258
|
+
|
|
259
|
+
Remove/uninstall one, more, or all versions.
|
|
260
|
+
|
|
261
|
+
positional arguments:
|
|
262
|
+
version version to remove (or to skip for --all --skip)
|
|
263
|
+
|
|
264
|
+
options:
|
|
265
|
+
-h, --help show this help message and exit
|
|
266
|
+
-a, --all remove ALL versions
|
|
267
|
+
--skip skip the specified versions when removing all (only
|
|
268
|
+
can be specified with --all)
|
|
269
|
+
-r, --release RELEASE
|
|
270
|
+
only remove versions if from specified YYYMMDD release
|
|
271
|
+
(e.g. 20240415)
|
|
272
|
+
|
|
273
|
+
aliases: uninstall
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Command `list`
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
usage: pystand list [-h] [-v] [-r RELEASE] [version ...]
|
|
280
|
+
|
|
281
|
+
List installed versions and show which have an update available.
|
|
282
|
+
|
|
283
|
+
positional arguments:
|
|
284
|
+
version only list specified version, else all
|
|
285
|
+
|
|
286
|
+
options:
|
|
287
|
+
-h, --help show this help message and exit
|
|
288
|
+
-v, --verbose explicitly report why a version is not eligible for
|
|
289
|
+
update
|
|
290
|
+
-r, --release RELEASE
|
|
291
|
+
use specified YYYYMMDD release (e.g. 20240415) for
|
|
292
|
+
verbose compare, default is latest release
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Command `show`
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
usage: pystand show [-h] [-l | -r RELEASE] [-a] [re_match]
|
|
299
|
+
|
|
300
|
+
Show versions available from a release. View available releases and their
|
|
301
|
+
distributions at https://github.com/astral-sh/python-build-
|
|
302
|
+
standalone/releases.
|
|
303
|
+
|
|
304
|
+
positional arguments:
|
|
305
|
+
re_match show only versions+distributions matching this regular
|
|
306
|
+
expression pattern
|
|
307
|
+
|
|
308
|
+
options:
|
|
309
|
+
-h, --help show this help message and exit
|
|
310
|
+
-l, --list just list recent releases
|
|
311
|
+
-r, --release RELEASE
|
|
312
|
+
python-build-standalone YYYYMMDD release to show (e.g.
|
|
313
|
+
20240415), default is latest release
|
|
314
|
+
-a, --all show all available distributions for each version from
|
|
315
|
+
the release
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Command `path`
|
|
319
|
+
|
|
320
|
+
```
|
|
321
|
+
usage: pystand path [-h] [-p] [-r] [-c | version]
|
|
322
|
+
|
|
323
|
+
Show path prefix to installed version base directory.
|
|
324
|
+
|
|
325
|
+
positional arguments:
|
|
326
|
+
version version number to show path for
|
|
327
|
+
|
|
328
|
+
options:
|
|
329
|
+
-h, --help show this help message and exit
|
|
330
|
+
-p, --python-path add path to python executable
|
|
331
|
+
-r, --resolve fully resolve given version
|
|
332
|
+
-c, --cache-path just show path to cache dir
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Command `cache`
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
usage: pystand cache [-h] [-T] [-H] [-r] [release ...]
|
|
339
|
+
|
|
340
|
+
Show size of release download caches.
|
|
341
|
+
|
|
342
|
+
positional arguments:
|
|
343
|
+
release show cache size for given release[s] only
|
|
344
|
+
|
|
345
|
+
options:
|
|
346
|
+
-h, --help show this help message and exit
|
|
347
|
+
-T, --no-total do not show total cache size
|
|
348
|
+
-H, --no-human-readable
|
|
349
|
+
show sizes in bytes, not human readable format
|
|
350
|
+
-r, --remove remove download cache[s] instead of showing size
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## Installation and Upgrade
|
|
354
|
+
|
|
355
|
+
Python 3.8 or later is required. Arch Linux users can install [`pystand`
|
|
356
|
+
from the AUR](https://aur.archlinux.org/packages/pystand) and skip this
|
|
357
|
+
section.
|
|
358
|
+
|
|
359
|
+
Note [pystand is on PyPI](https://pypi.org/project/pystand/) so the
|
|
360
|
+
easiest way to install it is to use [`uv tool`][uvtool] (or
|
|
361
|
+
[`pipx`][pipx] or [`pipxu`][pipxu]).
|
|
362
|
+
|
|
363
|
+
```sh
|
|
364
|
+
$ uv tool install pystand
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
To upgrade:
|
|
368
|
+
|
|
369
|
+
```sh
|
|
370
|
+
$ uv tool upgrade pystand
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
To uninstall:
|
|
374
|
+
|
|
375
|
+
```sh
|
|
376
|
+
$ uv tool uninstall pystand
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## Extrapolation of Python Versions
|
|
380
|
+
|
|
381
|
+
For all commands except the `path` command, `pystand` extrapolates
|
|
382
|
+
version text you specify on the command line to the latest available
|
|
383
|
+
corresponding installed or release version. For example, if you specify
|
|
384
|
+
`pystand install 3.12` then `pystand` will look in the release files to
|
|
385
|
+
find the latest (i.e. highest) available version of `3.12`, e.g.
|
|
386
|
+
`3.12.3` (at the time of writing), and will install that. Of course you
|
|
387
|
+
can specify the exact version if you wish, e.g. `3.12.3` but generally
|
|
388
|
+
you don't need to bother. This is true for any command that takes a
|
|
389
|
+
version argument so be aware that this may be confusing if there are
|
|
390
|
+
multiple same Python minor versions, e.g. `3.12.1` and `3.12.3`,
|
|
391
|
+
installed from different releases. So in that case you should specify
|
|
392
|
+
the exact version because e.g. `pystand remove 3.12` will remove
|
|
393
|
+
`3.12.3` which may not be what you want.
|
|
394
|
+
|
|
395
|
+
Note, consistent with this, you actually don't need to specify a
|
|
396
|
+
minor version, e.g. `pystand install 3` would also install `3.12.3`
|
|
397
|
+
(assuming `3.12.3` is the latest available version for Python 3).
|
|
398
|
+
|
|
399
|
+
After installs or updates or removals,`pystand` also maintains symbolic
|
|
400
|
+
links to each latest installed version in it's version directory, e.g. a
|
|
401
|
+
symlink `~/.local/share/pystand/versions/3.12` will be created pointing
|
|
402
|
+
to `~/.local/share/pystand/versions/3.12.3` so that you can optionally
|
|
403
|
+
hard code the symlink directory in places where it can not be set
|
|
404
|
+
dynamically (i.e. where using `pystand path` is not an option).
|
|
405
|
+
|
|
406
|
+
You can exploit these symlinks when you create virtual environments
|
|
407
|
+
using the `pystand path` command (or just hard code the actual link/path
|
|
408
|
+
for your environment/platform). E.g. The following creates a virtual
|
|
409
|
+
environment which runs with whatever the currently latest installed
|
|
410
|
+
Python 3.12 version is:
|
|
411
|
+
|
|
412
|
+
```sh
|
|
413
|
+
# Use uv to create a virtual environment to be run with a symlink to
|
|
414
|
+
# currently latest installed python 3.12:
|
|
415
|
+
$ uv venv -p $(pystand path 3.12)
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
So if you then update to a new version of Python 3.12 using `pystand`,
|
|
419
|
+
e.g. from 3.12.3 to 3.12.4, the virtual environment will automatically
|
|
420
|
+
use the new Python version. However, if you for some reason want to
|
|
421
|
+
create the virtual environment with a specific version of Python that is
|
|
422
|
+
never changed, then just specify that exact version when you create the
|
|
423
|
+
virtual environment, e.g.:
|
|
424
|
+
|
|
425
|
+
```sh
|
|
426
|
+
# Use uv to create a virtual environment to be run with specific pystand
|
|
427
|
+
# installed python 3.12.2:
|
|
428
|
+
$ uv venv -p $(pystand path 3.12.2)
|
|
429
|
+
|
|
430
|
+
# If you can't be bothered to look up the current latest version, then
|
|
431
|
+
# the following command will do the same thing as above because it
|
|
432
|
+
# resolves the symlink to the current latest 3.12 version at the time
|
|
433
|
+
# you run this command:
|
|
434
|
+
$ uv venv -p $(pystand path -r 3.12)
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## Installing Other Builds/Distributions
|
|
438
|
+
|
|
439
|
+
The _`install_only_stripped`_ distribution build is installed by default
|
|
440
|
+
for your running machine architecture. See description of
|
|
441
|
+
distributions/builds
|
|
442
|
+
[here](https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions).
|
|
443
|
+
However, you can choose to install other distributions/builds (even for
|
|
444
|
+
other architectures). E.g. If we use a standard modern Linux x86_64
|
|
445
|
+
machine as an example, the default distribution is
|
|
446
|
+
_`x86_64-unknown-linux-gnu-install_only_stripped`_ and the versions for
|
|
447
|
+
these are installed by default at `~/.local/share/pystand/<version>`.
|
|
448
|
+
|
|
449
|
+
However, let's say you want to experiment with the new free-threaded
|
|
450
|
+
3.13 build, installed to a different directory. E.g.:
|
|
451
|
+
|
|
452
|
+
```sh
|
|
453
|
+
$ mkdir ./3.13-freethreaded
|
|
454
|
+
$ cd ./3.13-freethreaded
|
|
455
|
+
|
|
456
|
+
$ pystand -P. -D x86_64-unknown-linux-gnu-freethreaded+lto-full install 3.13
|
|
457
|
+
$ ./3.13/bin/python -V
|
|
458
|
+
Python 3.13.0
|
|
459
|
+
|
|
460
|
+
$ pystand -P . list
|
|
461
|
+
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Note you can set a different default distribution by specifying
|
|
465
|
+
`--distribution` as a [default option](#command-default-options).
|
|
466
|
+
|
|
467
|
+
### Searching for Available Versions and Distributions
|
|
468
|
+
|
|
469
|
+
The `show` command can be used to search for distributions as seen in the
|
|
470
|
+
following examples.
|
|
471
|
+
|
|
472
|
+
List all the versions installed on this system (at the default location):
|
|
473
|
+
|
|
474
|
+
```sh
|
|
475
|
+
$ pystand list
|
|
476
|
+
3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
477
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
478
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
479
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
The above shows versions 3.9, 3.12, and 3.13 are installed from the latest
|
|
483
|
+
release 20241016. Version 3.8 is installed from the previous release
|
|
484
|
+
20241002 (and is not available in the latest release otherwise it would
|
|
485
|
+
be shown with an update message).
|
|
486
|
+
|
|
487
|
+
Now show all available versions from the latest release:
|
|
488
|
+
|
|
489
|
+
```sh
|
|
490
|
+
$ pystand show
|
|
491
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
492
|
+
3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
493
|
+
3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
494
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
495
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
We can see that versions 3.9, 3.12, and 3.13 are already installed (as
|
|
499
|
+
we also knew from list output), and that 3.10 and 3.11 are also available.
|
|
500
|
+
|
|
501
|
+
What is available from the previous release 20241002?
|
|
502
|
+
|
|
503
|
+
```sh
|
|
504
|
+
$ pystand show -r 20241002
|
|
505
|
+
3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
506
|
+
3.9.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
507
|
+
3.10.15 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
508
|
+
3.11.10 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
509
|
+
3.12.7 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
510
|
+
3.13.0rc3 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
Let's install one of the threaded builds of Python 3.13. We can use the
|
|
514
|
+
`-a/-all` option to show all available distributions and then give the
|
|
515
|
+
`show` command a [regular
|
|
516
|
+
expression](https://en.wikipedia.org/wiki/Regular_expression) to filter
|
|
517
|
+
the output (this is really just a shorthand for piping the output of
|
|
518
|
+
`show -a` to grep). E.g.:
|
|
519
|
+
|
|
520
|
+
```sh
|
|
521
|
+
$ pystand show -a 3.13.*x86_64.*unknown-linux-gnu.*thread
|
|
522
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+debug-full"
|
|
523
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
|
524
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-freethreaded+pgo-full"
|
|
525
|
+
3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+debug-full"
|
|
526
|
+
3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
|
527
|
+
3.13.0 @ 20241016 distribution="x86_64_v2-unknown-linux-gnu-freethreaded+pgo-full"
|
|
528
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+debug-full"
|
|
529
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
|
530
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo-full"
|
|
531
|
+
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+debug-full"
|
|
532
|
+
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+lto-full"
|
|
533
|
+
3.13.0 @ 20241016 distribution="x86_64_v4-unknown-linux-gnu-freethreaded+noopt-full"
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
So let's install the
|
|
537
|
+
`x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full` build of Python
|
|
538
|
+
3.13 (to the default location):
|
|
539
|
+
|
|
540
|
+
```sh
|
|
541
|
+
$ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install 3.13
|
|
542
|
+
Version "3.13.0" is already installed.
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
An error is given because the version is already installed. We can
|
|
546
|
+
overwrite that with the `-f/--force` option:
|
|
547
|
+
|
|
548
|
+
```sh
|
|
549
|
+
$ pystand -D x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full install -f 3.13
|
|
550
|
+
Version 3.13.0 @ 20241016 installed.
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
Now we can see the new version distribution is installed:
|
|
554
|
+
|
|
555
|
+
```sh
|
|
556
|
+
|
|
557
|
+
$ pystand list
|
|
558
|
+
3.8.20 @ 20241002 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
559
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
560
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
561
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full"
|
|
562
|
+
|
|
563
|
+
$ pystand show
|
|
564
|
+
3.9.20 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
565
|
+
3.10.15 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
566
|
+
3.11.10 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
567
|
+
3.12.7 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped" (installed)
|
|
568
|
+
3.13.0 @ 20241016 distribution="x86_64-unknown-linux-gnu-install_only_stripped"
|
|
569
|
+
3.13.0 @ 20241016 distribution="x86_64_v3-unknown-linux-gnu-freethreaded+pgo+lto-full" (installed)
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
Note that `pystand` caches all downloaded files (at least for a period
|
|
573
|
+
specified by `--purge-days`) so you can easily switch between different
|
|
574
|
+
versions/distributions quite quickly. You can also choose to install any
|
|
575
|
+
distribution/build in a specific directory using the `-P/--prefix-dir`
|
|
576
|
+
global option if you want to keep different distributions separate and
|
|
577
|
+
available in parallel.
|
|
578
|
+
|
|
579
|
+
## Command Default Options
|
|
580
|
+
|
|
581
|
+
You can add default global options to a personal configuration file
|
|
582
|
+
`~/.config/pystand-flags.conf`. If that file exists then each line of
|
|
583
|
+
options will be concatenated and automatically prepended to your
|
|
584
|
+
`pystand` command line arguments. Comments in the file (i.e. `#` and
|
|
585
|
+
anything after on a line) are ignored. Type `pystand` to see all
|
|
586
|
+
supported options.
|
|
587
|
+
|
|
588
|
+
The global options: `--distribution`, `--prefix-dir`, `--cache-dir`,
|
|
589
|
+
`--cache-minutes`, `--purge-days`, `--github-access-token`, `--no-strip`,
|
|
590
|
+
`--cert` are the only sensible candidates to consider setting as defaults.
|
|
591
|
+
|
|
592
|
+
## Github API Rate Limiting
|
|
593
|
+
|
|
594
|
+
This tool minimises and caches Github API responses and file downloads
|
|
595
|
+
from the [`python-build-standalone`][pbs] repository. However, if you
|
|
596
|
+
install many different versions particularly across various releases,
|
|
597
|
+
you may get rate limited by Github so the command can block and you will
|
|
598
|
+
see "backoff" messages reported. You can create a Github access token to
|
|
599
|
+
gain increased rate limits. Create a token in your Github account under
|
|
600
|
+
`Settings -> Developer settings -> Personal access tokens`. You can use
|
|
601
|
+
either a Github "fine-grained" or "classic" token. Specify the token on
|
|
602
|
+
the command line with `--github-access-token`, or set that as a [default
|
|
603
|
+
option](#command-default-options).
|
|
604
|
+
|
|
605
|
+
## HTTPS Certificate Verification
|
|
606
|
+
|
|
607
|
+
A global option `--cert` is provided to specify which SSL certificates to use
|
|
608
|
+
for HTTPS requests. This is useful if you are running `pystand` in an
|
|
609
|
+
environment where the system certificates are not available, or you want to use
|
|
610
|
+
the bundled [`certifi`][certifi] certificates instead.
|
|
611
|
+
|
|
612
|
+
The available options are:
|
|
613
|
+
|
|
614
|
+
|Option |Description
|
|
615
|
+
|-------- |------------
|
|
616
|
+
|`system` |Use system certificates (as used normally by Python). This is the default.|
|
|
617
|
+
|`certifi`|Use the [`certifi`][certifi] package, i.e. use the certificates bundled within the application.|
|
|
618
|
+
|`none` |Perform unverified https requests (best to avoid using this).|
|
|
619
|
+
|
|
620
|
+
Specify the option on the command line with `--cert`, or set that as a [default
|
|
621
|
+
option](#command-default-options).
|
|
622
|
+
|
|
623
|
+
## Command Line Tab Completion
|
|
624
|
+
|
|
625
|
+
Command line shell [tab
|
|
626
|
+
completion](https://en.wikipedia.org/wiki/Command-line_completion) is
|
|
627
|
+
automatically enabled on `pystand` commands and options using
|
|
628
|
+
[`argcomplete`](https://github.com/kislyuk/argcomplete). You may need to
|
|
629
|
+
first (once-only) [activate argcomplete global
|
|
630
|
+
completion](https://github.com/kislyuk/argcomplete#global-completion).
|
|
631
|
+
|
|
632
|
+
## License
|
|
633
|
+
|
|
634
|
+
Copyright (C) 2024 Mark Blakeney. This program is distributed under the
|
|
635
|
+
terms of the GNU General Public License. This program is free software:
|
|
636
|
+
you can redistribute it and/or modify it under the terms of the GNU
|
|
637
|
+
General Public License as published by the Free Software Foundation,
|
|
638
|
+
either version 3 of the License, or any later version. This program is
|
|
639
|
+
distributed in the hope that it will be useful, but WITHOUT ANY
|
|
640
|
+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
641
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at
|
|
642
|
+
<https://opensource.org/license/gpl-3-0> for more details.
|
|
643
|
+
|
|
644
|
+
[pystand]: https://github.com/bulletmark/pystand
|
|
645
|
+
[pbs]: https://github.com/astral-sh/python-build-standalone
|
|
646
|
+
[pbs-rel]: https://github.com/astral-sh/python-build-standalone/releases
|
|
647
|
+
[pipx]: https://github.com/pypa/pipx
|
|
648
|
+
[pipxu]: https://github.com/bulletmark/pipxu
|
|
649
|
+
[uvtool]: https://docs.astral.sh/uv/guides/tools/#installing-tools
|
|
650
|
+
[pyenv]: https://github.com/pyenv/pyenv
|
|
651
|
+
[pdm]: https://pdm-project.org/
|
|
652
|
+
[pdmpy]: https://pdm-project.org/en/latest/usage/project/#install-python-interpreters-with-pdm
|
|
653
|
+
[hatch]: https://hatch.pypa.io/
|
|
654
|
+
[hatchpy]: https://hatch.pypa.io/latest/tutorials/python/manage/
|
|
655
|
+
[ryepy]: https://rye.astral.sh/guide/toolchains/#fetching-toolchains
|
|
656
|
+
[certifi]: https://pypi.org/project/certifi/
|
|
657
|
+
|
|
658
|
+
<!-- vim: se ai syn=markdown: -->
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
pystand.py,sha256=XPtXqmAgUUzx4k4vzssNI6iVFRwaYIWd6UsaqIZPQBE,43749
|
|
2
|
+
pystand-2.24.dist-info/METADATA,sha256=U7y7TRuv58VBJSO0riqNqZ5SvOgsXgX34oiig4butO8,27266
|
|
3
|
+
pystand-2.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
+
pystand-2.24.dist-info/entry_points.txt,sha256=DG4ps3I3nni1bubV1tXs6u8FARgkdbAYaEAzZD4RAo8,41
|
|
5
|
+
pystand-2.24.dist-info/top_level.txt,sha256=NoWUh19UQymAJLHTCdxMnVwV6Teftef5fzyF3OWLyNY,8
|
|
6
|
+
pystand-2.24.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pystand
|