Skip to content

Commit

Permalink
Cis: use newer actions (setup-python, checkout, cache) (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuDartiailh committed Jul 16, 2022
1 parent 36854c6 commit 9a83bc9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install pypa/build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
matrix:
python-version: ['3.8','3.9','3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand Down
9 changes: 3 additions & 6 deletions tests/python_parser/test_syntax_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,14 @@ def parse_invalid_syntax(

# Check Python message but do not expect message to match for earlier Python versions
if sys.version_info >= min_python_version:
# NOTE ugly hack for 1 CPython bug
if exc_cls is SyntaxError and e.type is IndentationError:
assert message.replace("'", "") in py_exc.args[0]
else:
assert message in py_exc.args[0]
# This fails for Python < 3.10.5 but keeping the fix for a patch version is not
# worth it
assert message in py_exc.args[0]

print(str(e.exconly()))
assert message in str(e.exconly())

# Check start/end line/column on Python 3.10

for parser, exc in ([("Python", py_exc)] if sys.version_info >= min_python_version else []) + [
("pegen", e.value)
]:
Expand Down

0 comments on commit 9a83bc9

Please sign in to comment.