pystand 1.9__py3-none-any.whl → 1.10__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.
@@ -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
@@ -0,0 +1,6 @@
1
+ pystand.py,sha256=KJbvxHMzi28M4HqgGS9A4YaGYrpDn-T4hhuaQqbGW2E,31942
2
+ pystand-1.10.dist-info/METADATA,sha256=f_l5yws3MCMJicGVN-o40gj1RlehBZ_Hg9jeYxLzLb4,15916
3
+ pystand-1.10.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
4
+ pystand-1.10.dist-info/entry_points.txt,sha256=DG4ps3I3nni1bubV1tXs6u8FARgkdbAYaEAzZD4RAo8,41
5
+ pystand-1.10.dist-info/top_level.txt,sha256=NoWUh19UQymAJLHTCdxMnVwV6Teftef5fzyF3OWLyNY,8
6
+ pystand-1.10.dist-info/RECORD,,
pystand.py CHANGED
@@ -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:
@@ -1,6 +0,0 @@
1
- pystand.py,sha256=MtVQfHakq71D_-O_56508AJAvS67LsouV7JDR4no86E,31568
2
- pystand-1.9.dist-info/METADATA,sha256=KnR67QfaY5HxJ2t5ddCWHGXs0hz-rm9YzVvPQ0oTLZw,15191
3
- pystand-1.9.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
4
- pystand-1.9.dist-info/entry_points.txt,sha256=DG4ps3I3nni1bubV1tXs6u8FARgkdbAYaEAzZD4RAo8,41
5
- pystand-1.9.dist-info/top_level.txt,sha256=NoWUh19UQymAJLHTCdxMnVwV6Teftef5fzyF3OWLyNY,8
6
- pystand-1.9.dist-info/RECORD,,
File without changes