Skip to content

Commit c9c754f

Browse files
committed
fix docs
1 parent b6b0fd0 commit c9c754f

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,11 @@ Welcome to the magnificent Rust Python interpreter
6666
>>>>>
6767
```
6868

69-
// TODO: fixme
70-
If you'd like to make https requests, you can enable the `ssl` feature, which
71-
also lets you install the `pip` package manager. Note that on Windows, you may
72-
need to install OpenSSL, or you can enable the `ssl-vendor` feature instead,
73-
which compiles OpenSSL for you but requires a C compiler, perl, and `make`.
74-
OpenSSL version 3 is expected and tested in CI. Older versions may not work.
75-
76-
Once you've installed rustpython with SSL support, you can install pip by
69+
You can install pip by
7770
running:
7871

7972
```bash
80-
cargo install --git https://github.com/RustPython/RustPython --features ssl
73+
cargo install --git https://github.com/RustPython/RustPython
8174
rustpython --install-pip
8275
```
8376

@@ -89,6 +82,13 @@ conda install rustpython -c conda-forge
8982
rustpython
9083
```
9184

85+
### SSL provider
86+
87+
For HTTPS requests, `ssl-rustls` feature is enabled by default. You can replace it with `ssl-openssl` feature if your environment requires OpenSSL.
88+
Note that to use OpenSSL on Windows, you may need to install OpenSSL, or you can enable the `ssl-vendor` feature instead,
89+
which compiles OpenSSL for you but requires a C compiler, perl, and `make`.
90+
OpenSSL version 3 is expected and tested in CI. Older versions may not work.
91+
9292
### WASI
9393

9494
You can compile RustPython to a standalone WebAssembly WASI module so it can run anywhere.

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ __import__("io").TextIOWrapper(
142142

143143
fn install_pip(installer: InstallPipMode, scope: Scope, vm: &VirtualMachine) -> PyResult<()> {
144144
if cfg!(feature = "ssl") {
145-
if cfg!(not(any(feature = "ssl-rustls", feature = "ssl-openssl"))) {
146-
// TODO: something
147-
}
145+
#[cfg(not(any(feature = "ssl-rustls", feature = "ssl-openssl")))]
146+
compile_error!(
147+
"Feature \"ssl\" is now enabled by either \"ssl-rustls\" or \"ssl-openssl\" to be enabled. Do not manually pass \"ssl\" feature. To enable ssl-openssl, use --no-default-features to disable ssl-rustls"
148+
);
148149
} else {
149150
return Err(vm.new_exception_msg(
150151
vm.ctx.exceptions.system_error.to_owned(),

stdlib/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ mod sqlite;
8080
mod openssl;
8181
#[cfg(all(not(target_arch = "wasm32"), feature = "ssl-rustls"))]
8282
mod ssl;
83+
#[cfg(all(feature = "ssl-openssl", feature = "ssl-rustls"))]
84+
compile_error!("features \"ssl-openssl\" and \"ssl-rustls\" are mutually exclusive");
8385

8486
#[cfg(all(unix, not(target_os = "redox"), not(target_os = "ios")))]
8587
mod termios;

0 commit comments

Comments
 (0)