dotlocalslashbin 0.0.8__py2.py3-none-any.whl → 0.0.10__py2.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: dotlocalslashbin
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: Download and extract files to `~/.local/bin/`.
5
5
  Author-email: Keith Maxwell <keith.maxwell@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -11,7 +11,10 @@ Requires-Dist: codespell ; extra == "test"
11
11
  Requires-Dist: flit ; extra == "test"
12
12
  Requires-Dist: mypy ; extra == "test"
13
13
  Requires-Dist: nox ; extra == "test"
14
+ Requires-Dist: pytest ; extra == "test"
15
+ Requires-Dist: reuse ; extra == "test"
14
16
  Requires-Dist: ruff ; extra == "test"
17
+ Requires-Dist: twine ; extra == "test"
15
18
  Requires-Dist: usort ; extra == "test"
16
19
  Project-URL: Home, https://github.com/maxwell-k/dotlocalslashbin/
17
20
  Provides-Extra: test
@@ -43,12 +46,27 @@ Optionally can:
43
46
  \* if the URL is an absolute path on the local file system; it is not downloaded
44
47
  to the cache.
45
48
 
49
+ [uv]: https://github.com/astral-sh/uv
46
50
  [TOML]: https://en.wikipedia.org/wiki/TOML
47
51
 
52
+ ## Installation
53
+
54
+ The recommended way to run `dotlocalslashbin` is with [uv].
55
+
56
+ Command to install the latest released `dotlocalslashbin` from PyPI:
57
+
58
+ uv tool install dotlocalslashbin
59
+
60
+ Command to run latest development version of `dotlocalslashbin` directly from
61
+ GitHub:
62
+
63
+ uv run https://raw.githubusercontent.com/maxwell-k/dotfiles/refs/heads/main/dotlocalslashbin.py --help
64
+
48
65
  ## Examples
49
66
 
50
67
  For example to download `yq` to the current working directory, first save the
51
- following as `yq.toml`, then run the command below:
68
+ following as `yq.toml`, then install with uv (above) and then run the command
69
+ below:
52
70
 
53
71
  ```
54
72
  [yq]
@@ -0,0 +1,5 @@
1
+ dotlocalslashbin.py,sha256=nUPegFMgTLe79Mtr59VA1WBvQ-6od-ThLr9X3m3IXsc,5963
2
+ dotlocalslashbin-0.0.10.dist-info/METADATA,sha256=l3fXw-DIFUn347nPPNQ-x4ktUGDO5uJoLu9EPwGpGmQ,3033
3
+ dotlocalslashbin-0.0.10.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
4
+ dotlocalslashbin-0.0.10.dist-info/entry_points.txt,sha256=eK8C0lW2h7WAcr78hM-_OBrLotRptdLvjbnT7f67m34,58
5
+ dotlocalslashbin-0.0.10.dist-info/RECORD,,
dotlocalslashbin.py CHANGED
@@ -2,6 +2,10 @@
2
2
  # src/dotlocalslashbin.py
3
3
  # Copyright 2022 Keith Maxwell
4
4
  # SPDX-License-Identifier: MPL-2.0
5
+ # /// script
6
+ # requires-python = ">=3.11"
7
+ # dependencies = []
8
+ # ///
5
9
  """Download and extract files to `~/.local/bin/`."""
6
10
  import tarfile
7
11
  from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace
@@ -19,9 +23,9 @@ from urllib.request import urlopen
19
23
  from zipfile import ZipFile
20
24
 
21
25
 
22
- __version__ = "0.0.8"
26
+ __version__ = "0.0.10"
23
27
 
24
- DEFAULT_OUTPUT = Path("~/.local/bin/")
28
+ _OUTPUT = Path("~/.local/bin/")
25
29
  _SHA512_LENGTH = 128
26
30
 
27
31
 
@@ -84,7 +88,7 @@ def main() -> int:
84
88
  print(f"Error {e.code} downloading {e.url}")
85
89
  return 1
86
90
 
87
- arg0 = item.name if args.output == DEFAULT_OUTPUT else str(item.target)
91
+ arg0 = item.name if args.output == _OUTPUT else str(item.target.absolute())
88
92
  print(" ".join(("#" if item.version else "$", arg0, item.version or "")))
89
93
  if item.version:
90
94
  run([arg0, item.version], check=True)
@@ -135,7 +139,7 @@ def _parse_args() -> _CustomNamespace:
135
139
  help_ = "TOML specification"
136
140
  parser.add_argument("--input", default="bin.toml", help=help_, type=Path)
137
141
  help_ = "Target directory"
138
- parser.add_argument("--output", default=DEFAULT_OUTPUT, help=help_, type=Path)
142
+ parser.add_argument("--output", default=_OUTPUT, help=help_, type=Path)
139
143
  help_ = "Output directory"
140
144
  default = "~/.cache/dotlocalslashbin/"
141
145
  parser.add_argument("--downloaded", default=default, help=help_, type=Path)
@@ -1,5 +0,0 @@
1
- dotlocalslashbin.py,sha256=GVz-O7DMLnq0MbJMrn7RdDJUoiXpoWewYvOcFjDd08Q,5904
2
- dotlocalslashbin-0.0.8.dist-info/METADATA,sha256=6Kzw5I9vuP68MBwJR3X64LDM9Y59lfEkNI1sIYj5mqk,2462
3
- dotlocalslashbin-0.0.8.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
4
- dotlocalslashbin-0.0.8.dist-info/entry_points.txt,sha256=eK8C0lW2h7WAcr78hM-_OBrLotRptdLvjbnT7f67m34,58
5
- dotlocalslashbin-0.0.8.dist-info/RECORD,,