pystand 2.17__py3-none-any.whl → 2.18__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.4
2
2
  Name: pystand
3
- Version: 2.17
3
+ Version: 2.18
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-Expression: GPL-3.0-or-later
@@ -12,6 +12,7 @@ Description-Content-Type: text/markdown
12
12
  Requires-Dist: argcomplete
13
13
  Requires-Dist: packaging
14
14
  Requires-Dist: platformdirs
15
+ Requires-Dist: argparse-from-file
15
16
  Requires-Dist: pygithub
16
17
  Requires-Dist: certifi
17
18
  Requires-Dist: zstandard; python_version < "3.14"
@@ -25,14 +26,14 @@ installation, and update of pre-built Python versions from the
25
26
  [`python-build-standalone`][pbs] project. The following commands are
26
27
  provided:
27
28
 
28
- |Command |Description |
29
- |---------|----------------------------------------------------------------------|
30
- |`install`|Install one or more versions from a python-build-standalone release |
31
- |`update` (or `upgrade`) |Update one, more, or all versions to another release |
32
- |`remove` (or `uninstall`) |Remove/uninstall one, more, or all versions |
33
- |`list` |List installed versions and show which have an update available |
34
- |`show` |Show versions available from a release |
35
- |`path` |Show path prefix to installed version base directory |
29
+ |Command |Description |
30
+ |---------|--------------------------------------------------------------------|
31
+ |`install`|Install one or more versions from a python-build-standalone release.|
32
+ |`update` (or `upgrade`) |Update one, more, or all versions to another release.|
33
+ |`remove` (or `uninstall`) |Remove/uninstall one, more, or all versions.|
34
+ |`list` |List installed versions and show which have an update available.|
35
+ |`show` |Show versions available from a release.|
36
+ |`path` |Show path prefix to installed version base directory.|
36
37
 
37
38
  By default, Python versions are sourced from the latest
38
39
  `python-build-standalone` [release][pbs-rel] available (e.g.
@@ -147,25 +148,25 @@ options:
147
148
  distributions.
148
149
  -P, --prefix-dir PREFIX_DIR
149
150
  specify prefix dir for storing versions. Default is
150
- "$HOME/.local/share/pystand"
151
+ "$HOME/.local/share/pystand".
151
152
  -C, --cache-dir CACHE_DIR
152
153
  specify cache dir for downloads. Default is
153
- "$HOME/.cache/pystand"
154
+ "$HOME/.cache/pystand".
154
155
  -M, --cache-minutes CACHE_MINUTES
155
156
  cache latest YYYYMMDD release tag fetch for this many
156
157
  minutes, before rechecking for latest. Default is 60
157
- minutes
158
+ minutes.
158
159
  --purge-days PURGE_DAYS
159
160
  cache YYYYMMDD release file lists and downloads for
160
161
  this number of days after last version referencing
161
- that release is removed. Default is 90 days
162
+ that release is removed. Default is 90 days.
162
163
  --github-access-token GITHUB_ACCESS_TOKEN
163
164
  optional Github access token. Can specify to reduce
164
165
  rate limiting.
165
166
  --no-strip do not strip downloaded binaries
166
167
  --cert {system,certifi,none}
167
168
  specify which SSL certificates to use for HTTPS
168
- requests. Default="system"
169
+ requests. Default="system".
169
170
  -V, --version just show pystand version
170
171
 
171
172
  Commands:
@@ -566,9 +567,8 @@ anything after on a line) are ignored. Type `pystand` to see all
566
567
  supported options.
567
568
 
568
569
  The global options: `--distribution`, `--prefix-dir`, `--cache-dir`,
569
- `--cache-minutes`, `--purge-days`, `--github-access-token`,
570
- `--no-strip`, are the only sensible candidates to consider setting
571
- as defaults.
570
+ `--cache-minutes`, `--purge-days`, `--github-access-token`, `--no-strip`,
571
+ `--cert` are the only sensible candidates to consider setting as defaults.
572
572
 
573
573
  ## Github API Rate Limiting
574
574
 
@@ -583,6 +583,24 @@ either a Github "fine-grained" or "classic" token. Specify the token on
583
583
  the command line with `--github-access-token`, or set that as a [default
584
584
  option](#command-default-options).
585
585
 
586
+ ## HTTPS Certificate Verification
587
+
588
+ A global option `--cert` is provided to specify which SSL certificates to use
589
+ for HTTPS requests. This is useful if you are running `pystand` in an
590
+ environment where the system certificates are not available, or you want to use
591
+ the bundled [`certifi`][certifi] certificates instead.
592
+
593
+ The available options are:
594
+
595
+ |Option |Description
596
+ |-------- |------------
597
+ |`system` |Use system certificates (as used normally by Python). This is the default.|
598
+ |`certifi`|Use the [`certifi`][certifi] package, i.e. use the certificates bundled within the application.|
599
+ |`none` |Perform unverified https requests (best to avoid using this).|
600
+
601
+ Specify the option on the command line with `--cert`, or set that as a [default
602
+ option](#command-default-options).
603
+
586
604
  ## Command Line Tab Completion
587
605
 
588
606
  Command line shell [tab
@@ -602,7 +620,7 @@ either version 3 of the License, or any later version. This program is
602
620
  distributed in the hope that it will be useful, but WITHOUT ANY
603
621
  WARRANTY; without even the implied warranty of MERCHANTABILITY or
604
622
  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at
605
- <https://en.wikipedia.org/wiki/GNU_General_Public_License> for more details.
623
+ <https://opensource.org/license/gpl-3-0> for more details.
606
624
 
607
625
  [pystand]: https://github.com/bulletmark/pystand
608
626
  [pbs]: https://github.com/astral-sh/python-build-standalone
@@ -616,5 +634,6 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at
616
634
  [hatch]: https://hatch.pypa.io/
617
635
  [hatchpy]: https://hatch.pypa.io/latest/tutorials/python/manage/
618
636
  [ryepy]: https://rye.astral.sh/guide/toolchains/#fetching-toolchains
637
+ [certifi]: https://pypi.org/project/certifi/
619
638
 
620
639
  <!-- vim: se ai syn=markdown: -->
@@ -0,0 +1,6 @@
1
+ pystand.py,sha256=gszpzgPfqC4D20miYkJBrXwHQRnPc_JkfV_jRX_7N-s,39441
2
+ pystand-2.18.dist-info/METADATA,sha256=ORcOKU-54QsYhbZIpB6zEJRcmNv_H8ThamsTNBFT9aQ,26416
3
+ pystand-2.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ pystand-2.18.dist-info/entry_points.txt,sha256=DG4ps3I3nni1bubV1tXs6u8FARgkdbAYaEAzZD4RAo8,41
5
+ pystand-2.18.dist-info/top_level.txt,sha256=NoWUh19UQymAJLHTCdxMnVwV6Teftef5fzyF3OWLyNY,8
6
+ pystand-2.18.dist-info/RECORD,,
pystand.py CHANGED
@@ -11,20 +11,20 @@ from __future__ import annotations
11
11
  import os
12
12
  import platform
13
13
  import re
14
- import shlex
15
14
  import shutil
16
15
  import ssl
17
16
  import sys
18
17
  import time
19
- from argparse import ArgumentParser, Namespace
20
18
  from collections import defaultdict
19
+ from collections.abc import Iterable, Iterator
21
20
  from datetime import date, datetime
22
21
  from pathlib import Path
23
- from typing import Any, Iterable, Iterator
22
+ from typing import Any
24
23
  from urllib.request import urlopen
25
24
 
26
25
  import argcomplete
27
26
  import platformdirs
27
+ from argparse_from_file import ArgumentParser, Namespace # type: ignore
28
28
  from packaging.version import parse as parse_version
29
29
 
30
30
  REPO = 'python-build-standalone'
@@ -37,7 +37,6 @@ LATEST_RELEASE_TAG = f'{GITHUB_SITE}/releases/latest'
37
37
  SAMPL_RELEASE = '20240415'
38
38
 
39
39
  PROG = Path(__file__).stem
40
- CNFFILE = platformdirs.user_config_path(f'{PROG}-flags.conf')
41
40
 
42
41
  # Default distributions for various platforms
43
42
  DISTRIBUTIONS = {
@@ -678,8 +677,7 @@ def main() -> str | None:
678
677
  opt = ArgumentParser(
679
678
  description=__doc__,
680
679
  epilog='Some commands offer aliases as shown in parentheses above. '
681
- 'Note you can set default starting global options in '
682
- f'{CNFFILE}.',
680
+ 'Note you can set default starting global options in #FROM_FILE_PATH#',
683
681
  )
684
682
 
685
683
  # Set up main/global arguments
@@ -693,13 +691,13 @@ def main() -> str | None:
693
691
  '-P',
694
692
  '--prefix-dir',
695
693
  default=prefix_dir,
696
- help='specify prefix dir for storing versions. Default is "%(default)s"',
694
+ help='specify prefix dir for storing versions. Default is "%(default)s".',
697
695
  )
698
696
  opt.add_argument(
699
697
  '-C',
700
698
  '--cache-dir',
701
699
  default=str(cache_dir),
702
- help='specify cache dir for downloads. Default is "%(default)s"',
700
+ help='specify cache dir for downloads. Default is "%(default)s".',
703
701
  )
704
702
  opt.add_argument(
705
703
  '-M',
@@ -708,7 +706,7 @@ def main() -> str | None:
708
706
  type=float,
709
707
  help='cache latest YYYYMMDD release tag fetch for this '
710
708
  'many minutes, before rechecking for latest. '
711
- 'Default is %(default)d minutes',
709
+ 'Default is %(default)d minutes.',
712
710
  )
713
711
  opt.add_argument(
714
712
  '--purge-days',
@@ -716,7 +714,7 @@ def main() -> str | None:
716
714
  type=int,
717
715
  help='cache YYYYMMDD release file lists and downloads for '
718
716
  'this number of days after last version referencing that '
719
- 'release is removed. Default is %(default)d days',
717
+ 'release is removed. Default is %(default)d days.',
720
718
  )
721
719
  opt.add_argument(
722
720
  '--github-access-token',
@@ -728,7 +726,7 @@ def main() -> str | None:
728
726
  opt.add_argument(
729
727
  '--cert',
730
728
  choices=CERTS,
731
- help=f'specify which SSL certificates to use for HTTPS requests. Default="{CERTS[0]}"',
729
+ help=f'specify which SSL certificates to use for HTTPS requests. Default="{CERTS[0]}".',
732
730
  )
733
731
  opt.add_argument(
734
732
  '-V', '--version', action='store_true', help=f'just show {PROG} version'
@@ -763,18 +761,7 @@ def main() -> str | None:
763
761
 
764
762
  # Command arguments are now defined, so we can set up argcomplete
765
763
  argcomplete.autocomplete(opt)
766
-
767
- # Merge in default args from user config file. Then parse the
768
- # command line.
769
- cnffile = CNFFILE.expanduser()
770
- if cnffile.is_file():
771
- with cnffile.open() as fp:
772
- lines = [re.sub(r'#.*$', '', line).strip() for line in fp]
773
- cnflines = ' '.join(lines).strip()
774
- else:
775
- cnflines = ''
776
-
777
- args = opt.parse_args(shlex.split(cnflines) + sys.argv[1:])
764
+ args = opt.parse_args()
778
765
 
779
766
  if 'func' not in args:
780
767
  if args.version:
@@ -1,6 +0,0 @@
1
- pystand.py,sha256=P1m9MPvtswYsQ1EgwGi324v61FY7g9O28suXJln87Ko,39830
2
- pystand-2.17.dist-info/METADATA,sha256=ecEhgvLgCKC4sVhhEMKcrQnY-yNHVMSYMYGr9dXWG14,25632
3
- pystand-2.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
- pystand-2.17.dist-info/entry_points.txt,sha256=DG4ps3I3nni1bubV1tXs6u8FARgkdbAYaEAzZD4RAo8,41
5
- pystand-2.17.dist-info/top_level.txt,sha256=NoWUh19UQymAJLHTCdxMnVwV6Teftef5fzyF3OWLyNY,8
6
- pystand-2.17.dist-info/RECORD,,
File without changes