@@ -20,71 +20,76 @@ requirements on the type of interpreter you want (e.g. 32-bit, framework build
20
20
on macOS, etc.). The Python Launcher should be viewed as a tool of convenience,
21
21
not necessity.
22
22
23
- ## Documentation
23
+ ## Installation
24
24
25
- The general control flow for finding the appropriate Python executable is the
26
- following (with Python 3.6, Python 3, and the newest version of Python installed
27
- as examples):
25
+ ### Via ` cargo `
28
26
29
- <img src =" https://raw.githubusercontent.com/brettcannon/python-launcher/main/docs/control-flow/control_flow.svg " >
27
+ If you have the latest stable
28
+ [ release of Rust] ( https://www.rust-lang.org/tools/install ) installed, then you
29
+ can install the [ Python Launcher via crates.io] ( https://crates.io/crates/python-launcher ) :
30
30
31
- See the top section of
32
- ` py --help ` or the
33
- [ man page] ( https://github.com/brettcannon/python-launcher/blob/main/docs/man-page/py.1.md )
34
- for more details.
31
+ ```
32
+ cargo install python-launcher
33
+ ```
35
34
36
- ## FAQ
35
+ If you get a compilation error then it's very likely you don't have the latest
36
+ stable release of Rust as there is a
37
+ [ release every 6 weeks] ( https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md )
38
+ and this project tracks Rust's stable channel closely.
37
39
38
- ### How do I install the Launcher?
40
+ ### From a ` .tar.xz ` file
39
41
40
- You can either install from [ crates.io] ( https://crates.io/ ) or from source.
41
- Both approaches require you install the Rust toolchain. You can use
42
- [ rustup] ( https://rustup.rs/ ) to accomplish this or whatever your OS suggests.
43
- Do note that if the compilation fails then your version of Rust is probably too
44
- old; while the project is always compatible with the stable version of Rust, it
45
- can update as quickly as the day of a new stable release of Rust.
42
+ If you go to the
43
+ [ releases page] ( https://github.com/brettcannon/python-launcher/releases ) you will
44
+ find various ` .tar.xz ` files for each release that target various platforms. If
45
+ one is available for your platform then you can download the tarball and install
46
+ it into e.g. ` /usr/local/ ` via:
46
47
47
- #### From crates.io
48
+ ```
49
+ tar --extract --strip-components 1 --directory /usr/local --file <tarball>
50
+ ```
48
51
49
- If you want to
50
- [ install from crates.io ] ( https://crates.io/crates/python-launcher ) , run:
52
+ You can use ` tar -t -f <tarball> ` to see what files are included and where they
53
+ will be installed.
51
54
52
- ``` shell
53
- cargo install python-launcher
54
- ```
55
+ If you don't want to install the tarball then you can extract the tarball
56
+ and copy the files manually as desired; the ` py ` binary is self-contained and is
57
+ not dependent on any other files from the tarball.
55
58
56
- #### From source
57
59
58
- If you want to install from source, you can either use ` cargo ` directly:
60
+ ### From [ source] ( https://github.com/brettcannon/python-launcher/ )
59
61
60
- ``` shell
62
+ #### Using [ ` cargo ` ] ( https://doc.rust-lang.org/cargo/ )
63
+
64
+ ```
61
65
cargo install --path .
62
66
```
63
67
64
- Or you can use ` doit ` to do the install only if source code as changed since
65
- the last time you used the ` install ` command:
68
+ #### Using [ ` doit ` ] ( https://pydoit.org/ )
69
+
70
+ [ Doit] ( https://pydoit.org/ ) will only perform an installation if source code as
71
+ changed since the last time you used the ` install ` command:
66
72
67
- ``` shell
73
+ ```
68
74
doit install
69
75
```
70
76
71
- ### How do I get shell completions for [ fish ] ( https://fishshell.com/ ) ?
77
+ ## Documentation
72
78
73
- The [ ` completions/py.fish ` file in the repository] ( https://github.com/brettcannon/python-launcher/blob/main/completions/py.fish )
74
- provides completions for the Launcher. Beyond the statically-known completions
75
- (e.g. ` --list ` ), the completions are also system-specific by providing version
76
- completions tied to the running shell (e.g. ` -3.9 ` is only a completion if
77
- Python 3.9 is installed and will list the path to the Python executable that
78
- would be used). Completions for ` python ` itself are also included
79
- (although they are generic to Python itself, so all options may not be valid
80
- for the version of Python you will be launching).
79
+ The general control flow for finding the appropriate Python executable is the
80
+ following (with Python 3.6, Python 3, and the newest version of Python installed
81
+ as examples):
81
82
82
- <img width = " 537 " alt = " fish_completions " src =" https://user-images .githubusercontent.com/54418/113020397-6a71be00-9137-11eb-9047-2df1022592fa.png " >
83
+ <img src =" https://raw .githubusercontent.com/brettcannon/python-launcher/main/docs/control-flow/control_flow.svg " >
83
84
84
- See [ fish's documentation on where to put completions] ( https://fishshell.com/docs/current/completions.html#where-to-put-completions )
85
- to know where the file should be copied/symlinked.
85
+ See the top section of
86
+ ` py --help ` or the
87
+ [ man page] ( https://github.com/brettcannon/python-launcher/blob/main/docs/man-page/py.1.md )
88
+ for more details.
86
89
87
- ### How do I have [ Starship] ( https://starship.rs/ ) use the Launcher to display the Python version?
90
+ ## FAQ
91
+
92
+ ### How do I have [ Starship] ( https://starship.rs/ ) use the Python Launcher to display the Python version?
88
93
89
94
Add the following to your [ Starship configuration file] ( https://fishshell.com/docs/current/completions.html#where-to-put-completions ) :
90
95
@@ -112,14 +117,10 @@ Do note that the character that is being split on is **not** the traditional
112
117
[ U+007C/"Vertical Line"/pipe character] ( https://www.compart.com/en/unicode/U+007C ) (` | ` ),
113
118
but [ U+2502/"Box Drawings Light Vertical"] ( https://www.compart.com/en/unicode/U+2502 ) (` │ ` ).
114
119
115
- ## TODO
116
-
117
- [ Issues to finish to reach MVP] ( https://github.com/brettcannon/python-launcher/milestone/1 )
118
-
119
120
## Appendix
120
121
121
122
- [ PEP 397: Python launcher for Windows] ( https://www.python.org/dev/peps/pep-0397/ )
122
123
- [ PEP 486: Make the Python Launcher aware of virtual environments] ( https://www.python.org/dev/peps/pep-0486/ )
123
- - Windows Launcher
124
+ - Python Launcher for Windows
124
125
- [ Documentation] ( https://docs.python.org/3/using/windows.html#launcher )
125
126
- [ Source] ( https://github.com/python/cpython/blob/master/PC/launcher.c )
0 commit comments