Merge pull request #2630 from RustPython/onboarding-improvements

Onboarding improvements
This commit is contained in:
Jeong YunWon
2021-05-11 08:58:31 +09:00
committed by GitHub
5 changed files with 32 additions and 9 deletions

View File

@@ -29,7 +29,10 @@ jobs:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
- name: Set up the Windows environment
run: choco install llvm
shell: bash
run: |
choco install llvm openssl
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
if: runner.os == 'Windows'
- name: Set up the Mac environment
run: brew install autoconf automake libtool
@@ -60,7 +63,10 @@ jobs:
with:
python-version: 3.8
- name: Set up the Windows environment
run: choco install llvm
shell: bash
run: |
choco install llvm openssl
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
if: runner.os == 'Windows'
- name: Set up the Mac environment
run: brew install autoconf automake libtool

View File

@@ -24,6 +24,7 @@ threading = ["rustpython-vm/threading"]
zlib = ["rustpython-vm/zlib"]
ssl = ["rustpython-vm/ssl"]
ssl-vendor = ["rustpython-vm/ssl-vendor"]
[dependencies]
log = "0.4"

View File

@@ -41,12 +41,27 @@ Or use the interactive shell:
You can also install and run RustPython with the following:
$ cargo install rustpython
$ cargo install --git https://github.com/RustPython/RustPython
$ rustpython
Welcome to the magnificent Rust Python interpreter
>>>>>
Or through the `conda` package manager:
(The `rustpython-*` crates are currently yanked from crates.io due to being out
of date and not building on newer rust versions; we hope to release a new
version Soon™)
If you'd like to make https requests, you can enable the `ssl` feature, which
also lets you install the `pip` package manager. Note that on Windows, you may
need to install OpenSSL, or you can enable the `ssl-vendor` feature instead,
which compiles OpenSSL for you but requires a C compiler, perl, and `make`.
Once you've installed rustpython with SSL support, you can install pip by
running:
$ rustpython --install-pip
You can also install RustPython through the `conda` package manager, though
this isn't officially supported and may be out of date:
$ conda install rustpython -c conda-forge
$ rustpython

View File

@@ -22,7 +22,8 @@ ast = ["rustpython-ast"]
compiler = ["rustpython-compiler", "rustpython-compiler-core", "ast"]
parser = ["rustpython-parser", "ast"]
ssl = ["openssl", "openssl-sys", "openssl-probe", "foreign-types-shared"]
ssl = ["openssl", "openssl-sys", "foreign-types-shared"]
ssl-vendor = ["ssl", "openssl/vendored", "openssl-probe"]
[dependencies]
# Crypto:
@@ -119,7 +120,7 @@ uname = "0.1.1"
gethostname = "0.2.0"
socket2 = "0.4.0"
rustyline = "8.0"
openssl = { version = "0.10.32", features = ["vendored"], optional = true }
openssl = { version = "0.10.32", optional = true }
openssl-sys = { version = "0.9", optional = true }
openssl-probe = { version = "0.1", optional = true }
which = "4.0"

View File

@@ -967,9 +967,9 @@ fn parse_version_info(mut n: i64) -> (u8, u8, u8, u8, u8) {
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
// if openssl is vendored, it doesn't know the locations of system certificates
match option_env!("OPENSSL_NO_VENDOR") {
None | Some("0") => {}
_ => openssl_probe::init_ssl_cert_env_vars(),
#[cfg(feature = "ssl-vendor")]
if let None | Some("0") = option_env!("OPENSSL_NO_VENDOR") {
openssl_probe::init_ssl_cert_env_vars();
}
openssl::init();