Skip to content

Commit b85e134

Browse files
authored
Merge pull request RustPython#4961 from youknowone/byte-offset
location to byte offset (TextSize)
2 parents d03c726 + 4064c84 commit b85e134

Some content is hidden

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

51 files changed

+3165
-925
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Lib/** linguist-vendored
22
Cargo.lock linguist-generated -merge
33
*.snap linguist-generated -merge
4-
ast/src/ast_gen.rs linguist-generated -merge
54
vm/src/stdlib/ast/gen.rs linguist-generated -merge
6-
compiler/parser/python.lalrpop text eol=LF
75
Lib/*.py text working-tree-encoding=UTF-8 eol=LF
86
**/*.rs text working-tree-encoding=UTF-8 eol=LF

.github/workflows/ci.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ concurrency:
1616

1717
env:
1818
CARGO_ARGS: --no-default-features --features stdlib,zlib,importlib,encodings,ssl,jit
19-
NON_WASM_PACKAGES: >-
20-
-p rustpython-common
21-
-p rustpython-compiler
22-
-p rustpython-codegen
23-
-p rustpython-vm
24-
-p rustpython-stdlib
25-
-p rustpython-jit
26-
-p rustpython-derive
27-
-p rustpython
2819
PLATFORM_INDEPENDENT_TESTS: >-
2920
test_argparse
3021
test_array
@@ -126,14 +117,14 @@ jobs:
126117
- uses: Swatinem/rust-cache@v2
127118

128119
- name: run clippy
129-
run: cargo clippy ${{ env.CARGO_ARGS }} ${{ env.NON_WASM_PACKAGES }} -- -Dwarnings
120+
run: cargo clippy ${{ env.CARGO_ARGS }} --workspace --exclude rustpython_wasm -- -Dwarnings
130121

131122
- name: run rust tests
132-
run: cargo test --workspace --exclude rustpython_wasm --verbose --features threading ${{ env.CARGO_ARGS }} ${{ env.NON_WASM_PACKAGES }}
123+
run: cargo test --workspace --exclude rustpython_wasm --verbose --features threading ${{ env.CARGO_ARGS }}
133124
if: runner.os != 'macOS'
134125
# temp skip ssl linking for Mac to avoid CI failure
135126
- name: run rust tests (MacOS no ssl)
136-
run: cargo test --workspace --exclude rustpython_wasm --verbose --no-default-features --features threading,stdlib,zlib,importlib,encodings,jit ${{ env.NON_WASM_PACKAGES }}
127+
run: cargo test --workspace --exclude rustpython_wasm --verbose --no-default-features --features threading,stdlib,zlib,importlib,encodings,jit
137128
if: runner.os == 'macOS'
138129

139130
- name: check compilation without threading

.github/workflows/cron-ci.yaml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,9 @@ env:
1111
jobs:
1212
codecov:
1313
name: Collect code coverage data
14-
needs: lalrpop
1514
runs-on: ubuntu-latest
1615
steps:
1716
- uses: actions/checkout@v3
18-
- name: Cache generated parser
19-
uses: actions/cache@v3
20-
with:
21-
path: compiler/parser/python.rs
22-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
2317
- uses: dtolnay/rust-toolchain@stable
2418
with:
2519
components: llvm-tools-preview
@@ -62,15 +56,9 @@ jobs:
6256

6357
testdata:
6458
name: Collect regression test data
65-
needs: lalrpop
6659
runs-on: ubuntu-latest
6760
steps:
6861
- uses: actions/checkout@v3
69-
- name: Cache generated parser
70-
uses: actions/cache@v3
71-
with:
72-
path: compiler/parser/python.rs
73-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
7462
- uses: dtolnay/rust-toolchain@stable
7563
- name: build rustpython
7664
run: cargo build --release --verbose
@@ -97,15 +85,9 @@ jobs:
9785
9886
whatsleft:
9987
name: Collect what is left data
100-
needs: lalrpop
10188
runs-on: ubuntu-latest
10289
steps:
10390
- uses: actions/checkout@v3
104-
- name: Cache generated parser
105-
uses: actions/cache@v3
106-
with:
107-
path: compiler/parser/python.rs
108-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
10991
- uses: dtolnay/rust-toolchain@stable
11092
- name: build rustpython
11193
run: cargo build --release --verbose
@@ -135,15 +117,9 @@ jobs:
135117
136118
benchmark:
137119
name: Collect benchmark data
138-
needs: lalrpop
139120
runs-on: ubuntu-latest
140121
steps:
141122
- uses: actions/checkout@v3
142-
- name: Cache generated parser
143-
uses: actions/cache@v3
144-
with:
145-
path: compiler/parser/python.rs
146-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
147123
- uses: dtolnay/rust-toolchain@stable
148124
- uses: actions/setup-python@v4
149125
with:
@@ -183,35 +159,3 @@ jobs:
183159
if git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update benchmark results"; then
184160
git push
185161
fi
186-
187-
lalrpop:
188-
name: Generate parser with lalrpop
189-
strategy:
190-
matrix:
191-
os: [ubuntu-latest, windows-latest]
192-
runs-on: ${{ matrix.os }}
193-
steps:
194-
- uses: actions/checkout@v3
195-
- name: Cache generated parser
196-
uses: actions/cache@v3
197-
with:
198-
path: compiler/parser/python.rs
199-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
200-
- name: Check if cached generated parser exists
201-
id: generated_parser
202-
uses: andstor/file-existence-action@v2
203-
with:
204-
files: "compiler/parser/python.rs"
205-
- if: runner.os == 'Windows'
206-
name: Force python.lalrpop to be lf # actions@checkout ignore .gitattributes
207-
run: |
208-
set file compiler/parser/python.lalrpop; ((Get-Content $file) -join "`n") + "`n" | Set-Content -NoNewline $file
209-
- name: Install lalrpop
210-
if: steps.generated_parser.outputs.files_exists == 'false'
211-
uses: baptiste0928/cargo-install@v2
212-
with:
213-
crate: lalrpop
214-
version: "0.19.9"
215-
- name: Run lalrpop
216-
if: steps.generated_parser.outputs.files_exists == 'false'
217-
run: lalrpop compiler/parser/python.lalrpop

0 commit comments

Comments
 (0)