Skip to content

Commit be42508

Browse files
Merge pull request RustPython#1741 from RustPython/master
Merge to release
2 parents f4c432b + 3595f4e commit be42508

File tree

583 files changed

+141092
-13481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

583 files changed

+141092
-13481
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lib/* linguist-vendored

.github/workflows/ci.yaml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
on:
2+
push:
3+
branches: [master, release]
4+
pull_request:
5+
6+
name: CI
7+
8+
jobs:
9+
rust_tests:
10+
name: Run rust tests
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [macos-latest, ubuntu-latest, windows-latest]
15+
fail-fast: false
16+
steps:
17+
- uses: actions/checkout@master
18+
- name: Convert symlinks to hardlink (windows only)
19+
run: powershell.exe scripts/symlinks-to-hardlinks.ps1
20+
if: runner.os == 'Windows'
21+
- name: Cache cargo dependencies
22+
uses: actions/cache@v1
23+
with:
24+
key: ${{ runner.os }}-rust_tests-${{ hashFiles('Cargo.lock') }}
25+
path: target
26+
restore-keys: |
27+
${{ runner.os }}-rust_tests-
28+
- name: run rust tests
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: test
32+
args: --verbose --all
33+
34+
snippets:
35+
name: Run snippets tests
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
matrix:
39+
os: [macos-latest, ubuntu-latest, windows-latest]
40+
fail-fast: false
41+
steps:
42+
- uses: actions/checkout@master
43+
- name: Convert symlinks to hardlink (windows only)
44+
run: powershell.exe scripts/symlinks-to-hardlinks.ps1
45+
if: runner.os == 'Windows'
46+
- name: Cache cargo dependencies
47+
uses: actions/cache@v1
48+
with:
49+
key: ${{ runner.os }}-snippets-${{ hashFiles('Cargo.lock') }}
50+
path: target
51+
restore-keys: |
52+
${{ runner.os }}-snippets-
53+
- name: build rustpython
54+
uses: actions-rs/cargo@v1
55+
with:
56+
command: build
57+
args: --release --verbose --all
58+
- uses: actions/setup-python@v1
59+
with:
60+
python-version: 3.6
61+
- name: Install pipenv
62+
run: |
63+
python -V
64+
python -m pip install --upgrade pip
65+
python -m pip install pipenv
66+
- run: pipenv install
67+
working-directory: ./tests
68+
- name: run snippets
69+
run: pipenv run pytest -v
70+
working-directory: ./tests
71+
72+
format:
73+
name: Check Rust code with rustfmt and clippy
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@master
77+
- uses: actions-rs/toolchain@v1
78+
with:
79+
profile: minimal
80+
toolchain: stable
81+
components: rustfmt
82+
override: true
83+
- name: run rustfmt
84+
uses: actions-rs/cargo@v1
85+
with:
86+
command: fmt
87+
args: --all -- --check
88+
- name: run clippy
89+
uses: actions-rs/cargo@v1
90+
with:
91+
command: clippy
92+
args: --all -- -Dwarnings
93+
94+
lint:
95+
name: Lint Python code with flake8
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: actions/checkout@master
99+
- uses: actions/setup-python@v1
100+
with:
101+
python-version: 3.6
102+
- name: install flake8
103+
run: python -m pip install flake8
104+
- name: run lint
105+
run: flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82 --show-source --statistics
106+
107+
cpython:
108+
name: Run CPython test suite
109+
runs-on: ubuntu-latest
110+
steps:
111+
- uses: actions/checkout@master
112+
- name: build rustpython
113+
uses: actions-rs/cargo@v1
114+
with:
115+
command: build
116+
args: --verbose --all
117+
- name: run tests
118+
run: |
119+
export RUSTPYTHONPATH=`pwd`/Lib
120+
cargo run -- -m test -v
121+
122+
wasm:
123+
name: Check the WASM package and demo
124+
runs-on: ubuntu-latest
125+
steps:
126+
- uses: actions/checkout@master
127+
- name: install wasm-pack
128+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
129+
- name: install geckodriver
130+
run: |
131+
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz
132+
mkdir geckodriver
133+
tar -xzf geckodriver-v0.24.0-linux32.tar.gz -C geckodriver
134+
- uses: actions/setup-python@v1
135+
with:
136+
python-version: 3.6
137+
- name: Install pipenv
138+
run: |
139+
python -V
140+
python -m pip install --upgrade pip
141+
python -m pip install pipenv
142+
- run: pipenv install
143+
working-directory: ./wasm/tests
144+
- uses: actions/setup-node@v1
145+
- name: run test
146+
run: |
147+
export PATH=$PATH:`pwd`/../../geckodriver
148+
npm install
149+
npm run test
150+
working-directory: ./wasm/demo
151+
- name: Deploy demo to Github Pages
152+
if: success() && github.ref == 'refs/heads/release'
153+
uses: peaceiris/actions-gh-pages@v2
154+
env:
155+
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEMO_DEPLOY_KEY }}
156+
PUBLISH_DIR: ./wasm/demo/dist
157+
EXTERNAL_REPOSITORY: RustPython/demo
158+
PUBLISH_BRANCH: master
159+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ tests/snippets/resources
1414
flame-graph.html
1515
flame.txt
1616
flamescope.json
17+
/wapm.lock
18+
/wapm_packages

.travis.yml

Lines changed: 94 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
before_cache: |
2-
if command -v cargo; then
3-
! command -v cargo-sweep && cargo install cargo-sweep
4-
cargo sweep -i
5-
cargo sweep -t 15
6-
fi
1+
branches:
2+
only:
3+
- master
4+
- release
5+
- redox-release
76

8-
matrix:
7+
before_cache:
8+
- |
9+
if command -v cargo; then
10+
if ! command -v cargo-sweep; then
11+
cargo install cargo-sweep
12+
fi
13+
cargo sweep -i
14+
cargo sweep -t 15
15+
fi
16+
- rm -rf ~/.cargo/registry/src
17+
18+
jobs:
919
fast_finish: true
1020
include:
11-
- name: Run Rust tests
21+
- name: Run Rust tests(linux)
1222
language: rust
23+
os: linux
1324
rust: stable
1425
cache: cargo
1526
script:
@@ -20,11 +31,24 @@ matrix:
2031
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
2132
- JOBCACHE=1
2233

34+
- name: Run Rust tests(osx)
35+
language: rust
36+
os: osx
37+
rust: stable
38+
cache: cargo
39+
script:
40+
- cargo build --verbose --all
41+
- cargo test --verbose --all
42+
env:
43+
# Prevention of cache corruption.
44+
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
45+
- JOBCACHE=11
46+
2347
# To test the snippets, we use Travis' Python environment (because
2448
# installing rust ourselves is a lot easier than installing Python)
2549
- name: Python test snippets
2650
language: python
27-
python: 3.6
51+
python: 3.8
2852
cache:
2953
- pip
3054
- cargo
@@ -34,31 +58,22 @@ matrix:
3458
- CODE_COVERAGE=false
3559
script: tests/.travis-runner.sh
3660

37-
- name: Check Rust code style with rustfmt
61+
- name: Check Rust code with rustfmt and clippy
3862
language: rust
3963
rust: stable
4064
cache: cargo
4165
before_script:
4266
- rustup component add rustfmt
43-
script:
44-
- cargo fmt --all -- --check
45-
env:
46-
- JOBCACHE=3
47-
48-
- name: Lint Rust code with clippy
49-
language: rust
50-
rust: stable
51-
cache: cargo
52-
before_script:
5367
- rustup component add clippy
5468
script:
69+
- cargo fmt --all -- --check
5570
- cargo clippy --all -- -Dwarnings
5671
env:
57-
- JOBCACHE=8
72+
- JOBCACHE=3
5873

5974
- name: Lint Python code with flake8
6075
language: python
61-
python: 3.6
76+
python: 3.8
6277
cache: pip
6378
env: JOBCACHE=9
6479
install: pip install flake8
@@ -87,36 +102,9 @@ matrix:
87102
on:
88103
branch: release
89104

90-
- name: WASM online demo
91-
language: rust
92-
rust: stable
93-
cache: cargo
94-
install:
95-
- nvm install node
96-
# install wasm-pack
97-
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
98-
script:
99-
- cd wasm/demo
100-
- npm install
101-
- npm run dist
102-
if: branch = release
103-
env:
104-
- JOBCACHE=5
105-
deploy:
106-
- provider: pages
107-
repo: RustPython/demo
108-
target-branch: master
109-
local-dir: wasm/demo/dist
110-
skip-cleanup: true
111-
# Set in the settings page of your repository, as a secure variable
112-
github-token: $WEBSITE_GITHUB_TOKEN
113-
keep-history: true
114-
on:
115-
branch: release
116-
117105
- name: Code Coverage
118106
language: python
119-
python: 3.6
107+
python: 3.8
120108
cache:
121109
- pip
122110
- cargo
@@ -131,7 +119,7 @@ matrix:
131119

132120
- name: Test WASM
133121
language: python
134-
python: 3.6
122+
python: 3.8
135123
cache:
136124
- pip
137125
- cargo
@@ -145,3 +133,58 @@ matrix:
145133
env:
146134
- JOBCACHE=7
147135
- TRAVIS_RUST_VERSION=stable
136+
137+
- name: Ensure compilation on Redox OS with Redoxer
138+
# language: minimal so that it actually uses bionic rather than xenial;
139+
# rust isn't yet available on bionic
140+
language: minimal
141+
dist: bionic
142+
if: type = cron
143+
cache:
144+
cargo: true
145+
directories:
146+
- $HOME/.redoxer
147+
- $HOME/.cargo
148+
before_install:
149+
# install rust as travis does for language: rust
150+
- curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s --
151+
--default-toolchain=$TRAVIS_RUST_VERSION -y
152+
- export PATH=${TRAVIS_HOME}/.cargo/bin:$PATH
153+
- rustc --version
154+
- rustup --version
155+
- cargo --version
156+
157+
- sudo apt-get update -qq
158+
- sudo apt-get install libfuse-dev
159+
install:
160+
- if ! command -v redoxer; then cargo install redoxfs redoxer; fi
161+
- redoxer install
162+
script:
163+
- bash redox/uncomment-cargo.sh
164+
- redoxer build --verbose
165+
- bash redox/comment-cargo.sh
166+
before_cache:
167+
- |
168+
if ! command -v cargo-sweep; then
169+
rustup install stable
170+
cargo +stable install cargo-sweep
171+
fi
172+
- cargo sweep -t 15
173+
- rm -rf ~/.cargo/registry/src
174+
env:
175+
- JOBCACHE=10
176+
- TRAVIS_RUST_VERSION=nightly
177+
178+
- name: Run CPython test suite
179+
language: rust
180+
os: linux
181+
rust: stable
182+
cache: cargo
183+
script:
184+
- cargo build --verbose --all
185+
- export RUSTPYTHONPATH=`pwd`/Lib
186+
- cargo run -- -m test -v
187+
env:
188+
# Prevention of cache corruption.
189+
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
190+
- JOBCACHE=12

0 commit comments

Comments
 (0)