Skip to content

Commit f2cfa5f

Browse files
committed
Split parser to new repository
RustPython/Parser@6b60f85
1 parent ff5076b commit f2cfa5f

File tree

152 files changed

+54
-39584
lines changed

Some content is hidden

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

152 files changed

+54
-39584
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ env:
1818
CARGO_ARGS: --no-default-features --features stdlib,zlib,importlib,encodings,ssl,jit
1919
NON_WASM_PACKAGES: >-
2020
-p rustpython-common
21-
-p rustpython-compiler-core
2221
-p rustpython-compiler
2322
-p rustpython-codegen
24-
-p rustpython-parser
2523
-p rustpython-vm
2624
-p rustpython-stdlib
2725
-p rustpython-jit
@@ -105,19 +103,13 @@ jobs:
105103
env:
106104
RUST_BACKTRACE: full
107105
name: Run rust tests
108-
needs: lalrpop
109106
runs-on: ${{ matrix.os }}
110107
strategy:
111108
matrix:
112109
os: [macos-latest, ubuntu-latest, windows-latest]
113110
fail-fast: false
114111
steps:
115112
- uses: actions/checkout@v3
116-
- name: Cache generated parser
117-
uses: actions/cache@v3
118-
with:
119-
path: compiler/parser/python.rs
120-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
121113
- uses: dtolnay/rust-toolchain@stable
122114
with:
123115
components: clippy
@@ -167,16 +159,9 @@ jobs:
167159
exotic_targets:
168160
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
169161
name: Ensure compilation on various targets
170-
needs: lalrpop
171162
runs-on: ubuntu-latest
172163
steps:
173164
- uses: actions/checkout@v3
174-
- name: Cache generated parser
175-
uses: actions/cache@v3
176-
with:
177-
path: compiler/parser/python.rs
178-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
179-
180165
- uses: dtolnay/rust-toolchain@stable
181166
with:
182167
target: i686-unknown-linux-gnu
@@ -239,7 +224,6 @@ jobs:
239224

240225
snippets_cpython:
241226
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
242-
needs: lalrpop
243227
env:
244228
RUST_BACKTRACE: full
245229
name: Run snippets and cpython tests
@@ -250,12 +234,6 @@ jobs:
250234
fail-fast: false
251235
steps:
252236
- uses: actions/checkout@v3
253-
- name: Cache generated parser
254-
uses: actions/cache@v3
255-
with:
256-
path: compiler/parser/python.rs
257-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
258-
259237
- uses: dtolnay/rust-toolchain@stable
260238
- uses: actions/setup-python@v4
261239
with:
@@ -316,50 +294,11 @@ jobs:
316294
- name: Check whats_left is not broken
317295
run: python -I whats_left.py
318296

319-
lalrpop:
320-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
321-
name: Generate parser with lalrpop
322-
strategy:
323-
matrix:
324-
os: [ubuntu-latest, windows-latest]
325-
runs-on: ${{ matrix.os }}
326-
steps:
327-
- uses: actions/checkout@v3
328-
- name: Cache generated parser
329-
uses: actions/cache@v3
330-
with:
331-
path: compiler/parser/python.rs
332-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
333-
- name: Check if cached generated parser exists
334-
id: generated_parser
335-
uses: andstor/file-existence-action@v2
336-
with:
337-
files: "compiler/parser/python.rs"
338-
- if: runner.os == 'Windows'
339-
name: Force python.lalrpop to be lf # actions@checkout ignore .gitattributes
340-
run: |
341-
set file compiler/parser/python.lalrpop; ((Get-Content $file) -join "`n") + "`n" | Set-Content -NoNewline $file
342-
- name: Install lalrpop
343-
if: steps.generated_parser.outputs.files_exists == 'false'
344-
uses: baptiste0928/cargo-install@v2
345-
with:
346-
crate: lalrpop
347-
version: "0.19.9"
348-
- name: Run lalrpop
349-
if: steps.generated_parser.outputs.files_exists == 'false'
350-
run: lalrpop compiler/parser/python.lalrpop
351-
352297
lint:
353298
name: Check Rust code with rustfmt and clippy
354-
needs: lalrpop
355299
runs-on: ubuntu-latest
356300
steps:
357301
- uses: actions/checkout@v3
358-
- name: Cache generated parser
359-
uses: actions/cache@v3
360-
with:
361-
path: compiler/parser/python.rs
362-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
363302
- uses: dtolnay/rust-toolchain@stable
364303
with:
365304
components: rustfmt, clippy
@@ -372,28 +311,22 @@ jobs:
372311
python-version: "3.11"
373312
- name: install ruff
374313
run: python -m pip install ruff
375-
- name: run lint
376-
run: ruff extra_tests wasm examples compiler/ast --exclude='./.*',./Lib,./vm/Lib,./benches/ --select=E9,F63,F7,F82 --show-source
314+
- name: run python lint
315+
run: ruff extra_tests wasm examples --exclude='./.*',./Lib,./vm/Lib,./benches/ --select=E9,F63,F7,F82 --show-source
377316
- name: install prettier
378317
run: yarn global add prettier && echo "$(yarn global bin)" >>$GITHUB_PATH
379318
- name: check wasm code with prettier
380319
# prettier doesn't handle ignore files very well: https://github.com/prettier/prettier/issues/8506
381320
run: cd wasm && git ls-files -z | xargs -0 prettier --check -u
382-
- name: Check update_asdl.sh consistency
383-
run: bash scripts/update_asdl.sh && git diff --exit-code
321+
# - name: Check update_asdl.sh consistency
322+
# run: bash scripts/update_asdl.sh && git diff --exit-code
384323

385324
miri:
386325
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
387326
name: Run tests under miri
388-
needs: lalrpop
389327
runs-on: ubuntu-latest
390328
steps:
391329
- uses: actions/checkout@v3
392-
- name: Cache generated parser
393-
uses: actions/cache@v3
394-
with:
395-
path: compiler/parser/python.rs
396-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
397330
- uses: dtolnay/rust-toolchain@master
398331
with:
399332
toolchain: nightly
@@ -408,15 +341,9 @@ jobs:
408341
wasm:
409342
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
410343
name: Check the WASM package and demo
411-
needs: lalrpop
412344
runs-on: ubuntu-latest
413345
steps:
414346
- uses: actions/checkout@v3
415-
- name: Cache generated parser
416-
uses: actions/cache@v3
417-
with:
418-
path: compiler/parser/python.rs
419-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
420347
- uses: dtolnay/rust-toolchain@stable
421348

422349
- uses: Swatinem/rust-cache@v2
@@ -462,15 +389,9 @@ jobs:
462389
wasm-wasi:
463390
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
464391
name: Run snippets and cpython tests on wasm-wasi
465-
needs: lalrpop
466392
runs-on: ubuntu-latest
467393
steps:
468394
- uses: actions/checkout@v3
469-
- name: Cache generated parser
470-
uses: actions/cache@v3
471-
with:
472-
path: compiler/parser/python.rs
473-
key: lalrpop-${{ hashFiles('compiler/parser/python.lalrpop') }}
474395
- uses: dtolnay/rust-toolchain@stable
475396
with:
476397
target: wasm32-wasi

Cargo.lock

Lines changed: 16 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,24 @@ include = ["LICENSE", "Cargo.toml", "src/**/*.rs"]
1212
[workspace]
1313
resolver = "2"
1414
members = [
15-
"compiler", "compiler/ast", "compiler/core", "compiler/literal", "compiler/codegen", "compiler/parser",
15+
"compiler", "compiler/codegen",
1616
".", "common", "derive", "jit", "vm", "pylib", "stdlib", "wasm/lib", "derive-impl",
1717
]
1818

1919
[workspace.dependencies]
20+
rustpython-literal = { git = "https://github.com/RustPython/Parser.git", rev = "6b60f85cc4ca248af9b787697c41be2adb7a3ec8" }
21+
rustpython-compiler-core = { git = "https://github.com/RustPython/Parser.git", rev = "6b60f85cc4ca248af9b787697c41be2adb7a3ec8" }
22+
rustpython-parser = { git = "https://github.com/RustPython/Parser.git", rev = "6b60f85cc4ca248af9b787697c41be2adb7a3ec8" }
23+
rustpython-ast = { git = "https://github.com/RustPython/Parser.git", rev = "6b60f85cc4ca248af9b787697c41be2adb7a3ec8" }
24+
# rustpython-literal = { path = "../RustPython-parser/literal" }
25+
# rustpython-compiler-core = { path = "../RustPython-parser/core" }
26+
# rustpython-parser = { path = "../RustPython-parser/parser" }
27+
# rustpython-ast = { path = "../RustPython-parser/ast" }
28+
2029
ahash = "0.7.6"
2130
anyhow = "1.0.45"
2231
ascii = "1.0"
2332
atty = "0.2.14"
24-
bincode = "1.3.3"
2533
bitflags = "1.3.2"
2634
bstr = "0.2.17"
2735
cfg-if = "1.0"
@@ -72,11 +80,12 @@ ssl-vendor = ["rustpython-stdlib/ssl-vendor"]
7280

7381
[dependencies]
7482
rustpython-compiler = { path = "compiler", version = "0.2.0" }
75-
rustpython-parser = { path = "compiler/parser", version = "0.2.0" }
7683
rustpython-pylib = { path = "pylib", optional = true, default-features = false }
7784
rustpython-stdlib = { path = "stdlib", optional = true, default-features = false }
7885
rustpython-vm = { path = "vm", version = "0.2.0", default-features = false, features = ["compiler"] }
7986

87+
rustpython-parser = { workspace = true }
88+
8089
atty = { workspace = true }
8190
cfg-if = { workspace = true }
8291
log = { workspace = true }

common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "MIT"
1111
threading = ["parking_lot"]
1212

1313
[dependencies]
14-
rustpython-literal = { path = "../compiler/literal" }
14+
rustpython-literal = { workspace = true }
1515

1616
ascii = { workspace = true }
1717
bitflags = { workspace = true }

compiler/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ authors = ["RustPython Team"]
66
edition = "2021"
77

88
[dependencies]
9-
rustpython-compiler-core = { path = "core" }
109
rustpython-codegen = { path = "codegen" }
11-
rustpython-parser = { path = "parser" }
10+
rustpython-compiler-core = { workspace = true }
11+
rustpython-parser = { workspace = true }

compiler/ast/Cargo.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)