bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503) · python/cpython@c5fc156

GitHub

File tree

.github/workflows

Doc/using

Grammar

Include

cpython

Lib/test

test_peg_generator

Misc/NEWS.d/next/Core and Builtins

Modules

PCbuild

PC

Parser/pegen

Programs

Python

Tools

peg_generator

data

peg_extension

pegen

scripts

scripts

Original file line numberDiff line numberDiff line change@@ -13,6 +13,7 @@ on:

1313 - '**/*.rst'

1414pull_request:

1515branches:

16+ - pegen

1617 - master

1718 - 3.8

1819 - 3.7

@@ -50,6 +51,22 @@ jobs:

5051build_macos:

5152name: 'macOS'

5253runs-on: macos-latest

54+env:

55+PYTHONOLDPARSER: old

56+steps:

57+ - uses: actions/checkout@v1

58+ - name: Configure CPython

59+run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev

60+ - name: Build CPython

61+run: make -j4

62+ - name: Display build info

63+run: make pythoninfo

64+ - name: Tests

65+run: make buildbottest TESTOPTS="-j4 -uall,-cpu"

66+67+build_macos_pegen:

68+name: 'macOS - Pegen'

69+runs-on: macos-latest

5370steps:

5471 - uses: actions/checkout@v1

5572 - name: Configure CPython

@@ -64,6 +81,34 @@ jobs:

6481build_ubuntu:

6582name: 'Ubuntu'

6683runs-on: ubuntu-latest

84+env:

85+OPENSSL_VER: 1.1.1f

86+PYTHONOLDPARSER: old

87+steps:

88+ - uses: actions/checkout@v1

89+ - name: Install Dependencies

90+run: sudo ./.github/workflows/posix-deps-apt.sh

91+ - name: 'Restore OpenSSL build'

92+id: cache-openssl

93+uses: actions/cache@v1

94+with:

95+path: ./multissl/openssl/${{ env.OPENSSL_VER }}

96+key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

97+ - name: Install OpenSSL

98+if: steps.cache-openssl.outputs.cache-hit != 'true'

99+run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux

100+ - name: Configure CPython

101+run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER

102+ - name: Build CPython

103+run: make -j4

104+ - name: Display build info

105+run: make pythoninfo

106+ - name: Tests

107+run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"

108+109+build_ubuntu_pegen:

110+name: 'Ubuntu - Pegen'

111+runs-on: ubuntu-latest

67112env:

68113OPENSSL_VER: 1.1.1f

69114steps:

Original file line numberDiff line numberDiff line change@@ -1,5 +1,5 @@

11language: c

2-dist: xenial

2+dist: bionic

3344# To cache doc-building dependencies and C compiler output.

55cache:

@@ -22,6 +22,7 @@ env:

2222branches:

2323only:

2424 - master

25+ - pegen

2526 - /^\d\.\d+$/

2627 - buildbot-custom

2728@@ -157,7 +158,9 @@ install:

157158before_script:

158159# -Og is much faster than -O0

159160 - CFLAGS="${CFLAGS} -Og" ./configure --with-pydebug

160- - make -j4 regen-all

161+ - eval "$(pyenv init -)"

162+ - pyenv global 3.8

163+ - PYTHON_FOR_REGEN=python3.8 make -j4 regen-all

161164 - changes=`git status --porcelain`

162165 - |

163166 # Check for changes in regenerated files

Original file line numberDiff line numberDiff line change@@ -426,6 +426,8 @@ Miscellaneous options

426426 defines the following possible values:

427427428428 * ``-X faulthandler`` to enable :mod:`faulthandler`;

429+ * ``-X oldparser``: enable the traditional LL(1) parser. See also

430+:envvar:`PYTHONOLDPARSER`.

429431 * ``-X showrefcount`` to output the total reference count and number of used

430432 memory blocks when the program finishes or after each statement in the

431433 interactive interpreter. This only works on debug builds.

@@ -574,6 +576,12 @@ conflict.

574576:option:`-d` multiple times.

575577576578579+.. envvar:: PYTHONOLDPARSER

580+581+ If this is set it is equivalent to specifying the :option:`-X`

582+ ``oldparser`` option.

583+584+577585.. envvar:: PYTHONINSPECT

578586579587 If this is set to a non-empty string it is equivalent to specifying the