pystand 1.9__tar.gz → 1.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pystand
3
- Version: 1.9
3
+ Version: 1.10
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
@@ -86,14 +86,17 @@ $ pystand list
86
86
  Here are some examples showing how to use an installed version ..
87
87
 
88
88
  ```sh
89
- # Use uv to create a virtual environment to be run with pystand installed python:
90
- $ uv venv -p $(pystand path 3.12) myenv
89
+ # Use uv to create a virtual environment to be run with latest pystand
90
+ # installed python:
91
+ $ uv venv -p $(pystand path) myenv
91
92
 
92
- # Create a regular virtual environment to be run with pystand installed python:
93
- $ $(pystand path -p 3.12) -m venv myenv
93
+ # Create a regular virtual environment to be run with latest pystand
94
+ # installed python:
95
+ $ $(pystand path -p) -m venv myenv
94
96
 
95
- # Use pipx to install a package to be run with pystand installed python:
96
- $ pipx install --python $(pystand path -p 3.12) cowsay
97
+ # Use pipx to install a package to be run with pystand installed python
98
+ # specific version:
99
+ $ pipx install --python $(pystand path -p 3.11) cowsay
97
100
  ```
98
101
 
99
102
  See detailed usage information in the [Usage](#usage) section that
@@ -272,12 +275,13 @@ options:
272
275
  ### Command `path`
273
276
 
274
277
  ```
275
- usage: pystand path [-h] [-p] version
278
+ usage: pystand path [-h] [-p] [version]
276
279
 
277
280
  Show path prefix to installed version base directory.
278
281
 
279
282
  positional arguments:
280
- version version to return path for
283
+ version version to return path for, or latest release version if
284
+ not specified
281
285
 
282
286
  options:
283
287
  -h, --help show this help message and exit
@@ -349,6 +353,18 @@ The global options: `--distribution`, `--base-dir`, `--cache-minutes`,
349
353
  `--no-extra-strip` are the only sensible candidates to consider setting
350
354
  as defaults.
351
355
 
356
+ ## Github API Rate Limiting
357
+
358
+ This tool minimises and caches Github API responses from the
359
+ [`python-build-standalone`][pbs] repository. However, if you install
360
+ many different versions particularly across various releases, you may
361
+ get rate limited by Github so the command will block and you will see
362
+ "backoff" messages reported. You can create a Github access token to
363
+ gain increased rate limits. Create a token in your Github account under
364
+ `Settings -> Developer settings -> Personal access tokens`. Specify the
365
+ token on the command line with `--github-access-token`, or set that as a
366
+ [default option](#command-default-options).
367
+
352
368
  ## Command Line Tab Completion
353
369
 
354
370
  Command line shell [tab
@@ -70,14 +70,17 @@ $ pystand list
70
70
  Here are some examples showing how to use an installed version ..
71
71
 
72
72
  ```sh
73
- # Use uv to create a virtual environment to be run with pystand installed python:
74
- $ uv venv -p $(pystand path 3.12) myenv
73
+ # Use uv to create a virtual environment to be run with latest pystand
74
+ # installed python:
75
+ $ uv venv -p $(pystand path) myenv
75
76
 
76
- # Create a regular virtual environment to be run with pystand installed python:
77
- $ $(pystand path -p 3.12) -m venv myenv
77
+ # Create a regular virtual environment to be run with latest pystand
78
+ # installed python:
79
+ $ $(pystand path -p) -m venv myenv
78
80
 
79
- # Use pipx to install a package to be run with pystand installed python:
80
- $ pipx install --python $(pystand path -p 3.12) cowsay
81
+ # Use pipx to install a package to be run with pystand installed python
82
+ # specific version:
83
+ $ pipx install --python $(pystand path -p 3.11) cowsay
81
84
  ```
82
85
 
83
86
  See detailed usage information in the [Usage](#usage) section that
@@ -256,12 +259,13 @@ options:
256
259
  ### Command `path`
257
260
 
258
261
  ```
259
- usage: pystand path [-h] [-p] version
262
+ usage: pystand path [-h] [-p] [version]
260
263
 
261
264
  Show path prefix to installed version base directory.
262
265
 
263
266
  positional arguments:
264
- version version to return path for
267
+ version version to return path for, or latest release version if
268
+ not specified
265
269
 
266
270
  options:
267
271
  -h, --help show this help message and exit
@@ -333,6 +337,18 @@ The global options: `--distribution`, `--base-dir`, `--cache-minutes`,
333
337
  `--no-extra-strip` are the only sensible candidates to consider setting
334
338
  as defaults.
335
339
 
340
+ ## Github API Rate Limiting
341
+
342
+ This tool minimises and caches Github API responses from the
343
+ [`python-build-standalone`][pbs] repository. However, if you install
344
+ many different versions particularly across various releases, you may
345
+ get rate limited by Github so the command will block and you will see
346
+ "backoff" messages reported. You can create a Github access token to
347
+ gain increased rate limits. Create a token in your Github account under
348
+ `Settings -> Developer settings -> Personal access tokens`. Specify the
349
+ token on the command line with `--github-access-token`, or set that as a
350
+ [default option](#command-default-options).
351
+
336
352
  ## Command Line Tab Completion
337
353
 
338
354
  Command line shell [tab
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pystand
3
- Version: 1.9
3
+ Version: 1.10
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
@@ -86,14 +86,17 @@ $ pystand list
86
86
  Here are some examples showing how to use an installed version ..
87
87
 
88
88
  ```sh
89
- # Use uv to create a virtual environment to be run with pystand installed python:
90
- $ uv venv -p $(pystand path 3.12) myenv
89
+ # Use uv to create a virtual environment to be run with latest pystand
90
+ # installed python:
91
+ $ uv venv -p $(pystand path) myenv
91
92
 
92
- # Create a regular virtual environment to be run with pystand installed python:
93
- $ $(pystand path -p 3.12) -m venv myenv
93
+ # Create a regular virtual environment to be run with latest pystand
94
+ # installed python:
95
+ $ $(pystand path -p) -m venv myenv
94
96
 
95
- # Use pipx to install a package to be run with pystand installed python:
96
- $ pipx install --python $(pystand path -p 3.12) cowsay
97
+ # Use pipx to install a package to be run with pystand installed python
98
+ # specific version:
99
+ $ pipx install --python $(pystand path -p 3.11) cowsay
97
100
  ```
98
101
 
99
102
  See detailed usage information in the [Usage](#usage) section that
@@ -272,12 +275,13 @@ options:
272
275
  ### Command `path`
273
276
 
274
277
  ```
275
- usage: pystand path [-h] [-p] version
278
+ usage: pystand path [-h] [-p] [version]
276
279
 
277
280
  Show path prefix to installed version base directory.
278
281
 
279
282
  positional arguments:
280
- version version to return path for
283
+ version version to return path for, or latest release version if
284
+ not specified
281
285
 
282
286
  options:
283
287
  -h, --help show this help message and exit
@@ -349,6 +353,18 @@ The global options: `--distribution`, `--base-dir`, `--cache-minutes`,
349
353
  `--no-extra-strip` are the only sensible candidates to consider setting
350
354
  as defaults.
351
355
 
356
+ ## Github API Rate Limiting
357
+
358
+ This tool minimises and caches Github API responses from the
359
+ [`python-build-standalone`][pbs] repository. However, if you install
360
+ many different versions particularly across various releases, you may
361
+ get rate limited by Github so the command will block and you will see
362
+ "backoff" messages reported. You can create a Github access token to
363
+ gain increased rate limits. Create a token in your Github account under
364
+ `Settings -> Developer settings -> Personal access tokens`. Specify the
365
+ token on the command line with `--github-access-token`, or set that as a
366
+ [default option](#command-default-options).
367
+
352
368
  ## Command Line Tab Completion
353
369
 
354
370
  Command line shell [tab
@@ -141,8 +141,17 @@ class VersionMatcher:
141
141
  def __init__(self, seq: Iterable[str]) -> None:
142
142
  self.seq = sorted(seq, key=parse_version, reverse=True)
143
143
 
144
- def match(self, version: str, *, upgrade: bool = False) -> str | None:
144
+ def match(self, version: str | None, *,
145
+ upgrade: bool = False) -> str | None:
145
146
  'Return full version string given a [possibly] part version prefix'
147
+
148
+ # If no version specified, return the latest release version
149
+ if not version:
150
+ for version in self.seq:
151
+ if is_release_version(version):
152
+ return version
153
+ return None
154
+
146
155
  if version in self.seq:
147
156
  return version
148
157
 
@@ -830,7 +839,9 @@ class _path(COMMAND):
830
839
  def init(parser: ArgumentParser) -> None:
831
840
  parser.add_argument('-p', '--python-path', action='store_true',
832
841
  help='return full path to python executable')
833
- parser.add_argument('version', help='version to return path for')
842
+ parser.add_argument('version', nargs='?',
843
+ help='version to return path for, or latest '
844
+ 'release version if not specified')
834
845
 
835
846
  @staticmethod
836
847
  def run(args: Namespace) -> str | None:
File without changes
File without changes
File without changes
File without changes
File without changes