mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Merge pull request #1819 from RustPython/coolreader18/only-gh-actions
Remove Travis and Azure CI
This commit is contained in:
14 files changed
+99
-368
No files matched your search
@@ -57,7 +57,7 @@ jobs:
|
||||
args: --release --verbose --all
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.6
|
||||
python-version: 3.8
|
||||
- name: Install pipenv
|
||||
run: |
|
||||
python -V
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.6
|
||||
python-version: 3.8
|
||||
- name: install flake8
|
||||
run: python -m pip install flake8
|
||||
- name: run lint
|
||||
@@ -130,7 +130,7 @@ jobs:
|
||||
tar -xzf geckodriver-v0.24.0-linux32.tar.gz -C geckodriver
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.6
|
||||
python-version: 3.8
|
||||
- name: Install pipenv
|
||||
run: |
|
||||
python -V
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 6'
|
||||
|
||||
jobs:
|
||||
redox:
|
||||
name: Check compilation on Redox
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: redoxos/redoxer:latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: prepare repository for redoxer compilation
|
||||
run: bash scripts/redox/uncomment-cargo.sh
|
||||
- name: compile for redox
|
||||
run: redoxer build --verbose
|
||||
|
||||
codecov:
|
||||
name: Collect code coverage data
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --verbose
|
||||
env:
|
||||
CARGO_INCREMENTAL: '0'
|
||||
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads'
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install pipenv
|
||||
run: |
|
||||
python -V
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install pipenv
|
||||
- run: pipenv install
|
||||
working-directory: ./tests
|
||||
- name: run snippets
|
||||
run: pipenv run pytest -v
|
||||
working-directory: ./tests
|
||||
env:
|
||||
RUSTPYTHON_DEBUG: 'true'
|
||||
- name: run cpython tests
|
||||
run: cargo run -- -m test -v
|
||||
env:
|
||||
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
|
||||
- uses: actions-rs/grcov@v0.1
|
||||
id: coverage
|
||||
- name: upload to Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
file: ${{ steps.coverage.outputs.report }}
|
||||
-190
@@ -1,190 +0,0 @@
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- release
|
||||
- redox-release
|
||||
|
||||
before_cache:
|
||||
- |
|
||||
if command -v cargo; then
|
||||
if ! command -v cargo-sweep; then
|
||||
cargo install cargo-sweep
|
||||
fi
|
||||
cargo sweep -i
|
||||
cargo sweep -t 15
|
||||
fi
|
||||
- rm -rf ~/.cargo/registry/src
|
||||
|
||||
jobs:
|
||||
fast_finish: true
|
||||
include:
|
||||
- name: Run Rust tests(linux)
|
||||
language: rust
|
||||
os: linux
|
||||
rust: stable
|
||||
cache: cargo
|
||||
script:
|
||||
- cargo build --verbose --all
|
||||
- cargo test --verbose --all
|
||||
env:
|
||||
# Prevention of cache corruption.
|
||||
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
|
||||
- JOBCACHE=1
|
||||
|
||||
- name: Run Rust tests(osx)
|
||||
language: rust
|
||||
os: osx
|
||||
rust: stable
|
||||
cache: cargo
|
||||
script:
|
||||
- cargo build --verbose --all
|
||||
- cargo test --verbose --all
|
||||
env:
|
||||
# Prevention of cache corruption.
|
||||
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
|
||||
- JOBCACHE=11
|
||||
|
||||
# To test the snippets, we use Travis' Python environment (because
|
||||
# installing rust ourselves is a lot easier than installing Python)
|
||||
- name: Python test snippets
|
||||
language: python
|
||||
python: 3.8
|
||||
cache:
|
||||
- pip
|
||||
- cargo
|
||||
env:
|
||||
- JOBCACHE=2
|
||||
- TRAVIS_RUST_VERSION=stable
|
||||
- CODE_COVERAGE=false
|
||||
script: tests/.travis-runner.sh
|
||||
|
||||
- name: Check Rust code with rustfmt and clippy
|
||||
language: rust
|
||||
rust: stable
|
||||
cache: cargo
|
||||
before_script:
|
||||
- rustup component add rustfmt
|
||||
- rustup component add clippy
|
||||
script:
|
||||
- cargo fmt --all -- --check
|
||||
- cargo clippy --all -- -Dwarnings
|
||||
env:
|
||||
- JOBCACHE=3
|
||||
|
||||
- name: Lint Python code with flake8
|
||||
language: python
|
||||
python: 3.8
|
||||
cache: pip
|
||||
env: JOBCACHE=9
|
||||
install: pip install flake8
|
||||
script:
|
||||
flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82
|
||||
--show-source --statistics
|
||||
|
||||
- name: Publish documentation
|
||||
language: rust
|
||||
rust: stable
|
||||
cache: cargo
|
||||
script:
|
||||
- cargo doc --no-deps --all
|
||||
if: branch = release
|
||||
env:
|
||||
- JOBCACHE=4
|
||||
deploy:
|
||||
- provider: pages
|
||||
repo: RustPython/website
|
||||
target-branch: master
|
||||
local-dir: target/doc
|
||||
skip-cleanup: true
|
||||
# Set in the settings page of your repository, as a secure variable
|
||||
github-token: $WEBSITE_GITHUB_TOKEN
|
||||
keep-history: true
|
||||
on:
|
||||
branch: release
|
||||
|
||||
- name: Code Coverage
|
||||
language: python
|
||||
python: 3.8
|
||||
cache:
|
||||
- pip
|
||||
- cargo
|
||||
script:
|
||||
- tests/.travis-runner.sh
|
||||
# Only do code coverage on master via a cron job.
|
||||
if: branch = master AND type = cron
|
||||
env:
|
||||
- JOBCACHE=6
|
||||
- TRAVIS_RUST_VERSION=nightly
|
||||
- CODE_COVERAGE=true
|
||||
|
||||
- name: Test WASM
|
||||
language: python
|
||||
python: 3.8
|
||||
cache:
|
||||
- pip
|
||||
- cargo
|
||||
addons:
|
||||
firefox: latest
|
||||
install:
|
||||
- nvm install node
|
||||
- pip install pipenv
|
||||
script:
|
||||
- wasm/tests/.travis-runner.sh
|
||||
env:
|
||||
- JOBCACHE=7
|
||||
- TRAVIS_RUST_VERSION=stable
|
||||
|
||||
- name: Ensure compilation on Redox OS with Redoxer
|
||||
# language: minimal so that it actually uses bionic rather than xenial;
|
||||
# rust isn't yet available on bionic
|
||||
language: minimal
|
||||
dist: bionic
|
||||
if: type = cron
|
||||
cache:
|
||||
cargo: true
|
||||
directories:
|
||||
- $HOME/.redoxer
|
||||
- $HOME/.cargo
|
||||
before_install:
|
||||
# install rust as travis does for language: rust
|
||||
- curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s --
|
||||
--default-toolchain=$TRAVIS_RUST_VERSION -y
|
||||
- export PATH=${TRAVIS_HOME}/.cargo/bin:$PATH
|
||||
- rustc --version
|
||||
- rustup --version
|
||||
- cargo --version
|
||||
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install libfuse-dev
|
||||
install:
|
||||
- if ! command -v redoxer; then cargo install redoxfs redoxer; fi
|
||||
- redoxer install
|
||||
script:
|
||||
- bash redox/uncomment-cargo.sh
|
||||
- redoxer build --verbose
|
||||
- bash redox/comment-cargo.sh
|
||||
before_cache:
|
||||
- |
|
||||
if ! command -v cargo-sweep; then
|
||||
rustup install stable
|
||||
cargo +stable install cargo-sweep
|
||||
fi
|
||||
- cargo sweep -t 15
|
||||
- rm -rf ~/.cargo/registry/src
|
||||
env:
|
||||
- JOBCACHE=10
|
||||
- TRAVIS_RUST_VERSION=nightly
|
||||
|
||||
- name: Run CPython test suite
|
||||
language: rust
|
||||
os: linux
|
||||
rust: stable
|
||||
cache: cargo
|
||||
script:
|
||||
- cargo build --verbose --all
|
||||
- export RUSTPYTHONPATH=`pwd`/Lib
|
||||
- cargo run -- -m test -v
|
||||
env:
|
||||
# Prevention of cache corruption.
|
||||
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
|
||||
- JOBCACHE=12
|
||||
Generated
+20
-40
@@ -282,9 +282,9 @@ checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "0.1.9"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
|
||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
@@ -430,9 +430,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dirs"
|
||||
version = "2.0.2"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
|
||||
checksum = "1c4ef5a8b902d393339e2a2c7fe573af92ce7e0ee5a3ff827b4c9ad7e07e4fa1"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"dirs-sys",
|
||||
@@ -775,9 +775,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
|
||||
[[package]]
|
||||
name = "lexical"
|
||||
version = "4.2.0"
|
||||
version = "4.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eaad0ee8120fc0cf7df7e8fdbe79bf9d6189351404feb88f4e4a4bb5307bc594"
|
||||
checksum = "0afaeae1c07c575338ef6809875bfea8daa9ea8b2ee381ef1f93ba0c6e32f003"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"lexical-core",
|
||||
@@ -786,12 +786,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lexical-core"
|
||||
version = "0.6.7"
|
||||
version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f86d66d380c9c5a685aaac7a11818bdfa1f733198dfd9ec09c70b762cd12ad6f"
|
||||
checksum = "d7043aa5c05dd34fb73b47acb8c3708eac428de4545ea3682ed2f11293ebd890"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.12",
|
||||
"bitflags",
|
||||
"cfg-if",
|
||||
"rustc_version",
|
||||
"ryu",
|
||||
@@ -801,8 +800,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.67"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018"
|
||||
source = "git+https://github.com/rust-lang/libc#64b919f1d4cf601cf016350673564e4b364b13e5"
|
||||
|
||||
[[package]]
|
||||
name = "libz-sys"
|
||||
@@ -894,22 +892,8 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"void",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.16.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd0eaf8df8bab402257e0a5c17a254e4cc1f72a93588a1ddfb5d356c801aa7cb"
|
||||
version = "0.17.0"
|
||||
source = "git+https://github.com/coolreader18/nix?branch=add-redox-support#318603039bf1f7e1e56b4c1ba96fbab42d9a9aca"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
@@ -1433,7 +1417,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"clap",
|
||||
"cpython",
|
||||
"dirs 2.0.2",
|
||||
"dirs 2.0.1",
|
||||
"env_logger",
|
||||
"flame",
|
||||
"flamescope",
|
||||
@@ -1531,7 +1515,7 @@ dependencies = [
|
||||
"maplit",
|
||||
"md-5",
|
||||
"mt19937",
|
||||
"nix 0.16.1",
|
||||
"nix",
|
||||
"num-bigint",
|
||||
"num-complex",
|
||||
"num-integer",
|
||||
@@ -1598,15 +1582,14 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustyline"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de64be8eecbe428b6924f1d8430369a01719fbb182c26fa431ddbb0a95f5315d"
|
||||
source = "git+https://github.com/kkawakam/rustyline#91ea17d8143c0bcf8326b656428a3d959627308a"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"dirs 2.0.2",
|
||||
"dirs 2.0.1",
|
||||
"libc",
|
||||
"log",
|
||||
"memchr",
|
||||
"nix 0.14.1",
|
||||
"nix",
|
||||
"unicode-segmentation",
|
||||
"unicode-width",
|
||||
"utf8parse",
|
||||
@@ -1729,8 +1712,7 @@ checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc"
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85"
|
||||
source = "git+https://github.com/alexcrichton/socket2-rs?rev=75fe3f2fe0e3079ad9d4dfb3a19e60bea3f2f055#75fe3f2fe0e3079ad9d4dfb3a19e60bea3f2f055"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
@@ -1907,11 +1889,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.1.42"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
|
||||
source = "git+https://gitlab.redox-os.org/redox-os/time.git?branch=redox-unix#726efec5f1c47ef89ab740335439ff4fda047f8f"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
@@ -2273,9 +2253,9 @@ checksum = "a7a928b876ff873d4a0ac966acce72423879dd86afcf190017aa700207188078"
|
||||
|
||||
[[package]]
|
||||
name = "utf8parse"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d"
|
||||
checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372"
|
||||
|
||||
[[package]]
|
||||
name = "vcpkg"
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ clap = "2.33"
|
||||
rustpython-compiler = {path = "compiler", version = "0.1.1"}
|
||||
rustpython-parser = {path = "parser", version = "0.1.1"}
|
||||
rustpython-vm = {path = "vm", version = "0.1.1"}
|
||||
dirs = "2.0"
|
||||
dirs = "=2.0.1"
|
||||
num-traits = "0.2.8"
|
||||
cfg-if = "0.1"
|
||||
|
||||
@@ -46,9 +46,9 @@ path = "src/main.rs"
|
||||
[patch.crates-io]
|
||||
# REDOX START, Uncommment when you want to compile/check with redoxer
|
||||
# time = { git = "https://gitlab.redox-os.org/redox-os/time.git", branch = "redox-unix" }
|
||||
# nix = { git = "https://github.com/AdminXVII/nix", branch = "add-redox-support" }
|
||||
# nix = { git = "https://github.com/coolreader18/nix", branch = "add-redox-support" }
|
||||
# # following patches are just waiting on a new version to be released to crates.io
|
||||
# socket2 = { git = "https://github.com/alexcrichton/socket2-rs" }
|
||||
# socket2 = { git = "https://github.com/alexcrichton/socket2-rs", rev = "75fe3f2fe0e3079ad9d4dfb3a19e60bea3f2f055" }
|
||||
# rustyline = { git = "https://github.com/kkawakam/rustyline" }
|
||||
# libc = { git = "https://github.com/rust-lang/libc" }
|
||||
# REDOX END
|
||||
@@ -1,56 +0,0 @@
|
||||
trigger:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
|
||||
- job: 'Test'
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
strategy:
|
||||
maxParallel: 10
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.7'
|
||||
architecture: 'x64'
|
||||
|
||||
- script: |
|
||||
powershell.exe scripts/symlinks-to-hardlinks.ps1
|
||||
"C:\Program Files\Git\mingw64\bin\curl.exe" -sSf -o rustup-init.exe https://win.rustup.rs/
|
||||
.\rustup-init.exe -y
|
||||
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
||||
rustup default stable-x86_64-pc-windows-msvc
|
||||
rustup update
|
||||
rustc -V
|
||||
cargo -V
|
||||
displayName: 'Installing Rust'
|
||||
|
||||
- script: |
|
||||
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
||||
cargo build --verbose --all
|
||||
displayName: 'Build'
|
||||
|
||||
- script: |
|
||||
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
||||
cargo test --verbose --all
|
||||
displayName: 'Run tests'
|
||||
|
||||
- script: |
|
||||
pip install pipenv
|
||||
pushd tests
|
||||
pipenv install
|
||||
popd
|
||||
displayName: 'Install pipenv and python packages'
|
||||
|
||||
- script: |
|
||||
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
||||
cargo build --verbose --release
|
||||
displayName: 'Build release'
|
||||
|
||||
- script: |
|
||||
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
||||
pushd tests
|
||||
pipenv run pytest
|
||||
popd
|
||||
displayName: 'Run snippet tests'
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/sh -eux
|
||||
# This script is intended to be run in Travis from the root of the repository
|
||||
|
||||
# Install Rust
|
||||
curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION -y
|
||||
export PATH=$HOME/.cargo/bin:$PATH
|
||||
|
||||
# Install pipenv
|
||||
pip install pipenv
|
||||
(cd tests; pipenv install)
|
||||
|
||||
# Build outside of the test runner
|
||||
if [ $CODE_COVERAGE = "true" ]
|
||||
then
|
||||
find . -name '*.gcda' -delete
|
||||
find . -name '*.gcno' -delete
|
||||
|
||||
export CARGO_INCREMENTAL=0
|
||||
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"
|
||||
|
||||
cargo build --verbose
|
||||
else
|
||||
cargo build --verbose --release
|
||||
fi
|
||||
|
||||
# Run the tests
|
||||
(cd tests; pipenv run pytest)
|
||||
|
||||
if [ $CODE_COVERAGE = "true" ]
|
||||
then
|
||||
cargo test --verbose --all
|
||||
zip -0 ccov.zip `find . \( -name "rustpython*.gc*" \) -print`
|
||||
|
||||
# Install grcov
|
||||
curl -L https://github.com/mozilla/grcov/releases/download/v0.4.2/grcov-linux-x86_64.tar.bz2 | tar jxf -
|
||||
|
||||
./grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir "/*" -p "x" > lcov.info
|
||||
|
||||
# Install codecov.io reporter
|
||||
curl -s https://codecov.io/bash -o codecov.sh
|
||||
bash codecov.sh -f lcov.info
|
||||
fi
|
||||
@@ -264,7 +264,7 @@ with TestWithTempDir() as tmpdir:
|
||||
|
||||
with TestWithTempCurrentDir():
|
||||
os.chdir(tmpdir)
|
||||
assert os.getcwd() == os.path.realpath(tmpdir)
|
||||
assert os.path.realpath(os.getcwd()) == os.path.realpath(tmpdir)
|
||||
assert os.path.exists(FILE_NAME)
|
||||
|
||||
# supports
|
||||
|
||||
@@ -49,7 +49,8 @@ def run_via_cpython(filename):
|
||||
env = os.environ.copy()
|
||||
subprocess.check_call([sys.executable, filename], env=env)
|
||||
|
||||
RUST_TARGET = "debug" if os.environ.get("CODE_COVERAGE", "false") == "true" else "release"
|
||||
RUST_DEBUG = os.environ.get("RUSTPYTHON_DEBUG") == "true"
|
||||
RUST_PROFILE = "debug" if RUST_DEBUG else "release"
|
||||
|
||||
def run_via_rustpython(filename, test_type):
|
||||
env = os.environ.copy()
|
||||
@@ -57,7 +58,7 @@ def run_via_rustpython(filename, test_type):
|
||||
env['RUST_BACKTRACE'] = '1'
|
||||
env['PYTHONPATH'] = RUSTPYTHON_LIB_DIR
|
||||
|
||||
binary = os.path.abspath(os.path.join(ROOT_DIR, "target", RUST_TARGET, "rustpython"))
|
||||
binary = os.path.abspath(os.path.join(ROOT_DIR, "target", RUST_PROFILE, "rustpython"))
|
||||
|
||||
subprocess.check_call([binary, filename], env=env)
|
||||
|
||||
@@ -134,7 +135,8 @@ class SampleTestCase(unittest.TestCase):
|
||||
generate_slices(cls.slices_resource_path)
|
||||
|
||||
# cargo stuff
|
||||
subprocess.check_call(["cargo", "build", "--{}".format(RUST_TARGET)])
|
||||
profile_args = [] if RUST_DEBUG else ["--release"]
|
||||
subprocess.check_call(["cargo", "build", *profile_args])
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
|
||||
+3
-3
@@ -63,7 +63,7 @@ unic-common = "0.9"
|
||||
maplit = "1.0"
|
||||
bitflags = "1.2.1"
|
||||
libc = "0.2"
|
||||
nix = "0.16.0"
|
||||
nix = "0.17"
|
||||
arr_macro = "0.1.2"
|
||||
csv = "1.1.1"
|
||||
paste = "0.1"
|
||||
@@ -84,8 +84,6 @@ uname = "0.1.1"
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
crc32fast = "1.2.0"
|
||||
adler32 = "1.0.3"
|
||||
flate2 = { version = "1.0", features = ["zlib"], default-features = false }
|
||||
libz-sys = "1.0.25"
|
||||
gethostname = "0.2.0"
|
||||
subprocess = "0.2.2"
|
||||
num_cpus = "1"
|
||||
@@ -94,6 +92,8 @@ rustyline = "6.0"
|
||||
|
||||
[target.'cfg(not(any(target_arch = "wasm32", target_os = "redox")))'.dependencies]
|
||||
dns-lookup = "1.0"
|
||||
flate2 = { version = "1.0", features = ["zlib"], default-features = false }
|
||||
libz-sys = "1.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winreg = "0.7"
|
||||
|
||||
@@ -60,7 +60,7 @@ mod subprocess;
|
||||
mod winapi;
|
||||
#[cfg(windows)]
|
||||
mod winreg;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(any(target_arch = "wasm32", target_os = "redox")))]
|
||||
mod zlib;
|
||||
|
||||
pub type StdlibInitFunc = Box<dyn Fn(&VirtualMachine) -> PyObjectRef>;
|
||||
@@ -124,6 +124,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));
|
||||
modules.insert("_subprocess".to_owned(), Box::new(subprocess::make_module));
|
||||
#[cfg(not(target_os = "redox"))]
|
||||
modules.insert("zlib".to_owned(), Box::new(zlib::make_module));
|
||||
modules.insert(
|
||||
"faulthandler".to_owned(),
|
||||
|
||||
+3
-2
@@ -890,7 +890,7 @@ fn os_chdir(path: PyStringRef, vm: &VirtualMachine) -> PyResult<()> {
|
||||
env::set_current_dir(path.as_str()).map_err(|err| convert_io_error(vm, err))
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[cfg(all(unix, not(target_os = "redox")))]
|
||||
fn os_chroot(path: PyStringRef, vm: &VirtualMachine) -> PyResult<()> {
|
||||
nix::unistd::chroot(path.as_str()).map_err(|err| convert_nix_error(vm, err))
|
||||
}
|
||||
@@ -1340,6 +1340,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
|
||||
#[cfg(unix)]
|
||||
support_funcs.extend(vec![
|
||||
SupportFunc::new(vm, "chmod", os_chmod, Some(false), Some(false), Some(false)),
|
||||
#[cfg(not(target_os = "redox"))]
|
||||
SupportFunc::new(vm, "chroot", os_chroot, Some(false), None, None),
|
||||
]);
|
||||
let supports_fd = PySet::default().into_ref(vm);
|
||||
@@ -1427,7 +1428,6 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: PyObjectRef) ->
|
||||
extend_module!(vm, module, {
|
||||
"access" => ctx.new_function(os_access),
|
||||
"chmod" => ctx.new_function(os_chmod),
|
||||
"chroot" => ctx.new_function(os_chroot),
|
||||
"get_inheritable" => ctx.new_function(os_get_inheritable), // TODO: windows
|
||||
"get_blocking" => ctx.new_function(os_get_blocking),
|
||||
"getppid" => ctx.new_function(os_getppid),
|
||||
@@ -1468,6 +1468,7 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: PyObjectRef) ->
|
||||
|
||||
#[cfg(not(target_os = "redox"))]
|
||||
extend_module!(vm, module, {
|
||||
"chroot" => ctx.new_function(os_chroot),
|
||||
"getsid" => ctx.new_function(os_getsid),
|
||||
"setsid" => ctx.new_function(os_setsid),
|
||||
"setegid" => ctx.new_function(os_setegid),
|
||||
|
||||
+1
-1
@@ -197,7 +197,7 @@ impl VirtualMachine {
|
||||
use_tracing: RefCell::new(false),
|
||||
signal_handlers,
|
||||
settings,
|
||||
recursion_limit: Cell::new(512),
|
||||
recursion_limit: Cell::new(if cfg!(debug_assertions) { 256 } else { 512 }),
|
||||
codec_registry: RefCell::default(),
|
||||
initialized: false,
|
||||
};
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/sh -eux
|
||||
# This script is intended to be run in Travis from the root of the repository
|
||||
|
||||
# Install Rust
|
||||
curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION -y
|
||||
export PATH=$HOME/.cargo/bin:$PATH
|
||||
|
||||
# install wasm-pack
|
||||
if [ ! -f $HOME/.cargo/bin/wasm-pack ]; then
|
||||
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
fi
|
||||
|
||||
# install geckodriver
|
||||
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz
|
||||
mkdir geckodriver
|
||||
tar -xzf geckodriver-v0.24.0-linux32.tar.gz -C geckodriver
|
||||
export PATH=$PATH:$PWD/geckodriver
|
||||
|
||||
# Install pipenv
|
||||
pip install pipenv
|
||||
(cd wasm/tests; pipenv install)
|
||||
|
||||
(cd wasm/demo; npm install; npm run test)
|
||||
Reference in new issue
Block a user