Skip to content

Commit 193fab4

Browse files
authored
Switch default parser implementation to native (Instagram#929)
The old parser is now only available using LIBCST_PARSER_TYPE=pure
1 parent 8216b8a commit 193fab4

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
working-directory: native
4141
- name: Build LibCST
4242
run: hatch env create
43-
- name: Pure Tests
43+
- name: Tests
4444
run: hatch run test
45-
- name: Native Tests
45+
- name: Pure Parser Tests
4646
env:
47-
LIBCST_PARSER_TYPE: ${{ matrix.parser }}
47+
LIBCST_PARSER_TYPE: pure
4848
run: hatch run test
4949

5050
# Run linters

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 1.0.0 - 2023-05-25
2+
3+
The first major release of LibCST is essentially the same as 0.4.10, but using the
4+
newer, Rust-based parser implementation by default. The old, pure Python parser is
5+
scheduled for removal in the next (non-patch) release. Until then, it is available with
6+
the `LIBCST_PARSER_TYPE` environment variable set to `pure`.
7+
8+
## Updated
9+
10+
* Switch the default parser implementation to native by @zsol in https://github.com/Instagram/LibCST/pull/929
11+
112
# 0.4.10 - 2023-05-23
213

314
## New Contributors

libcst/_parser/entrypoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
def is_native() -> bool:
2929
typ = os.environ.get("LIBCST_PARSER_TYPE")
30-
return typ == "native"
30+
return typ != "pure"
3131

3232

3333
def _parse(

native/libcst/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
A native extension to enable parsing of new Python grammar in LibCST.
44

55
The extension is written in Rust, and exposed to Python using [PyO3](https://pyo3.rs/).
6-
This is packaged together with libcst, and can be imported from `libcst.native`. When
7-
the `LIBCST_PARSER_TYPE` environment variable is set to `native`, the LibCST APIs use
8-
this module for all parsing.
6+
This is packaged together with libcst, and can be imported from `libcst.native`. By default
7+
the LibCST APIs use this module for all parsing.
98

109
Later on, the parser library might be packaged separately as
1110
[a Rust crate](https://crates.io). Pull requests towards this are much appreciated.

0 commit comments

Comments
 (0)