Merge pull request #1905 from RustPython/coolreader18/ssl-optional

Make the ssl module optional
This commit is contained in:
Windel Bouwman
2020-05-05 14:32:49 +02:00
committed by GitHub
4 changed files with 14 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ on:
name: CI
env:
VCPKGRS_DYNAMIC: 1
CARGO_ARGS: --all --features ssl
jobs:
rust_tests:
@@ -33,7 +33,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all
args: --verbose ${{ env.CARGO_ARGS }}
snippets_cpython:
name: Run snippets and cpython tests
@@ -59,7 +59,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --release --verbose --all
args: --release --verbose ${{ env.CARGO_ARGS }}
- uses: actions/setup-python@v1
with:
python-version: 3.8
@@ -74,7 +74,7 @@ jobs:
run: pipenv run pytest -v
working-directory: ./tests
- name: run cpython tests
run: cargo run --release -- -m test -v
run: target/release/rustpython -m test -v
env:
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
if: runner.os != 'Windows'
@@ -99,7 +99,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -Dwarnings
args: ${{ env.CARGO_ARGS }} -- -Dwarnings
lint:
name: Lint Python code with flake8

View File

@@ -18,6 +18,8 @@ path = "./benchmarks/bench.rs"
flame-it = ["rustpython-vm/flame-it", "flame", "flamescope"]
freeze-stdlib = ["rustpython-vm/freeze-stdlib"]
ssl = ["rustpython-vm/ssl"]
[dependencies]
log = "0.4"
env_logger = "0.7"

View File

@@ -14,6 +14,8 @@ vm-tracing-logging = []
flame-it = ["flame", "flamer"]
freeze-stdlib = []
ssl = ["openssl", "openssl-sys", "openssl-probe"]
[dependencies]
# Crypto:
digest = "0.8.1"
@@ -99,9 +101,9 @@ gethostname = "0.2.0"
subprocess = "0.2.2"
socket2 = { version = "0.3", features = ["unix"] }
rustyline = "6.0"
openssl = { version = "0.10", features = ["vendored"] }
openssl-sys = "0.9"
openssl-probe = "0.1"
openssl = { version = "0.10", features = ["vendored"], optional = true }
openssl-sys = { version = "0.9", optional = true }
openssl-probe = { version = "0.1", optional = true }
[target.'cfg(any(not(target_arch = "wasm32"), target_os = "wasi"))'.dependencies]
num_cpus = "1"

View File

@@ -53,7 +53,7 @@ mod pwd;
mod select;
#[cfg(not(target_arch = "wasm32"))]
pub mod signal;
#[cfg(not(target_arch = "wasm32"))]
#[cfg(all(not(target_arch = "wasm32"), feature = "ssl"))]
mod ssl;
#[cfg(not(target_arch = "wasm32"))]
mod subprocess;
@@ -125,6 +125,7 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
);
modules.insert("signal".to_owned(), Box::new(signal::make_module));
modules.insert("select".to_owned(), Box::new(select::make_module));
#[cfg(feature = "ssl")]
modules.insert("_ssl".to_owned(), Box::new(ssl::make_module));
modules.insert("_subprocess".to_owned(), Box::new(subprocess::make_module));
#[cfg(not(target_os = "redox"))]