Update the install instructions in the README
Marco Ricci

Marco Ricci commited on 2025-02-14 21:20:54
Zeige 2 geänderte Dateien mit 25 Einfügungen und 17 Löschungen.


Specifically mention the three possible installers `pip`, `pipx` and `uv
tool`, including explicit installation command-lines.  Remove the
"manual" installation method; it does not interact well with other
machinery such as `importlib.metadata`.

Similarly, update the install instructions in the "bash setup
(passphrase)" tutorial as well.
... ...
@@ -18,35 +18,37 @@ The service name and constraints themselves also need not be kept secret; the la
18 18
 
19 19
 ## Installation
20 20
 
21
-### With `pip`
21
+`derivepassphrase` is a pure Python package, and may be easily installed with any `pip`-compatible Python package manager such as `pip`, `pipx`, or `uv`.
22
+(`pip` is distributed with Python 3 by default.)
22 23
 
23
-(If not inside a [virtual environment][VENV], use `pip install --user` instead of plain `pip install`.)
24
+`derivepassphrase` requires Python 3.9 or higher as well as the [typing-extensions package][TYPING_EXTENSIONS] for its core functionality and programmatic interface, and [`click`][CLICK] 8.1 or higher for its command-line interface.
25
+On Python 3.9 and 3.10 only, `derivepassphrase` additionally requires the [tomli package][TOMLI].
26
+The installer should take care of installing these dependencies automatically for you.
27
+Using the `export vault` subcommand additionally requires the [cryptography package][CRYPTOGRAPHY], version 38.0 or newer.
28
+This must be separately requested at installation, via the `export` extra.
24 29
 
25
-```` shell-session
26
-$ pip install derivepassphrase
27
-````
30
+<div class="grid cards" markdown>
28 31
 
29
-To use the `export` subcommand, install the `export` extra:
32
+  * **pipx**
30 33
 
31
-```` shell-session
32
-$ pip install "derivepassphrase[export]"
33
-````
34
+    Use `pipx install derivepassphrase` in general, or `pipx install "derivepassphrase[export]"` with the `export` extra.
34 35
 
35
-[VENV]: https://docs.python.org/3/library/venv.html
36
+  * **uv**
36 37
 
37
-### Manually
38
+    Use `uv tool install derivepassphrase` in general, or `uv tool install "derivepassphrase[export]"` with the `export` extra.
38 39
 
39
-`derivepassphrase` is a pure Python package, and may be easily installed manually by placing the respective files and the package's dependencies into Python's import path.
40
-`derivepassphrase` requires Python 3.9 or higher as well as the [typing-extensions package][TYPING_EXTENSIONS] for its core functionality and programmatic interface, and [`click`][CLICK] 8.1 or higher for its command-line interface.
41
-On Python 3.9 and 3.10 only, `derivepassphrase` additionally requires the [tomli package][TOMLI].
42
-Using the `export vault` subcommand additionally requires the [cryptography package][CRYPTOGRAPHY], version 38.0 or newer.
40
+  * **pip**
41
+
42
+    First, manually create a [virtual environment][VENV] and activate it.
43
+    Then use `pip install derivepassphrase` in general, or `pip install "derivepassphrase[export]"` with the `export` extra.
43 44
 
44
-`derivepassphrase` works just fine on PyPy.
45
+</div>
45 46
 
46 47
 [TYPING_EXTENSIONS]: https://pypi.org/project/typing-extensions/
47 48
 [CLICK]: https://pypi.org/project/click/
48 49
 [TOMLI]: https://pypi.org/project/tomli/
49 50
 [CRYPTOGRAPHY]: https://pypi.org/project/cryptography/
51
+[VENV]: https://docs.python.org/3/library/venv.html
50 52
 
51 53
 ## Quick Usage
52 54
 
... ...
@@ -40,7 +40,7 @@ We will assume the following three services with the following passphrase polici
40 40
 
41 41
 ## Installing `derivepassphrase`
42 42
 
43
-You will need Python 3, and a package installer such as `pip` (bundled with Python), `pipx` or similar.
43
+You will need Python 3, and a package installer such as `pip` (bundled with Python), `pipx`, `uv`, etc.
44 44
 
45 45
 ---
46 46
 
... ...
@@ -60,6 +60,12 @@ You will need Python 3, and a package installer such as `pip` (bundled with Pyth
60 60
     $ pipx install derivepassphrase
61 61
     ~~~~
62 62
 
63
+=== "uv"
64
+
65
+    ~~~~ shell-session
66
+    $ uv tool install derivepassphrase
67
+    ~~~~
68
+
63 69
 ---
64 70
 
65 71
 Check that the installation was successful.
66 72