Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: accept folding of decorator parameters in Python 3.9 #9

Merged
merged 2 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Static code analysis

on:
push:
branches:
- develop

pull_request:
branches:
- '*'

jobs:
build:
name: Static code analysis
runs-on: ubuntu-latest
env:
CI: 'true'
OS: 'linux'
timeout-minutes: 2
steps:
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: static-pip-${{ hashFiles('setup.py') }}
restore-keys: static-pip-
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
# TODO: check with Python 3, but need to fix the
# errors first
python-version: '2.7'
architecture: 'x64'
- run: python -m pip install --upgrade pip setuptools
- run: pip install -e .[pylint,pycodestyle,pyflakes]
- name: Pylint checks
run: pylint pyls test
- name: Code style checks
run: pycodestyle pyls test
- name: Pyflakes checks
run: pyflakes pyls test
13 changes: 2 additions & 11 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.8', '3.7', '3.6', '2.7']
PYTHON_VERSION: ['3.9', '3.8', '3.7', '3.6', '2.7']
timeout-minutes: 10
steps:
- uses: actions/cache@v1
Expand All @@ -40,13 +40,4 @@ jobs:
/tmp/pyenv/bin/python -m pip install loghub
- run: python -m pip install --upgrade pip setuptools
- run: pip install -e .[all,test]
- run: py.test -v test/
- name: Pylint checks
if: matrix.PYTHON_VERSION == '2.7'
run: pylint pyls test
- name: Code style checks
if: matrix.PYTHON_VERSION == '2.7'
run: pycodestyle pyls test
- name: Pyflakes checks
if: matrix.PYTHON_VERSION == '2.7'
run: pyflakes pyls test
- run: pytest -v test/
4 changes: 2 additions & 2 deletions .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.8', '3.7', '3.6', '2.7']
PYTHON_VERSION: ['3.9', '3.8', '3.7', '3.6', '2.7']
timeout-minutes: 10
steps:
- uses: actions/cache@v1
Expand All @@ -40,4 +40,4 @@ jobs:
/tmp/pyenv/bin/python -m pip install loghub
- run: python -m pip install --upgrade pip setuptools
- run: pip install -e .[all,test]
- run: py.test -v test/
- run: pytest -v test/
4 changes: 2 additions & 2 deletions .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.8', '3.7', '3.6', '2.7']
PYTHON_VERSION: ['3.9', '3.8', '3.7', '3.6', '2.7']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove Python 2.7 altogether here?

timeout-minutes: 10
steps:
- uses: actions/cache@v1
Expand All @@ -35,4 +35,4 @@ jobs:
architecture: 'x64'
- run: python -m pip install --upgrade pip setuptools
- run: pip install -e .[all,test]
- run: py.test -v test/
- run: pytest -v test/
8 changes: 6 additions & 2 deletions test/plugins/test_folding.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2019 Palantir Technologies, Inc.

import sys
from textwrap import dedent

from pyls import uris
from pyls.workspace import Document
from pyls.plugins.folding import pyls_folding_range

from pyls.workspace import Document

DOC_URI = uris.from_fs_path(__file__)
DOC = dedent("""
Expand Down Expand Up @@ -146,6 +146,10 @@ def test_folding(workspace):
{'startLine': 62, 'endLine': 63},
{'startLine': 64, 'endLine': 65},
{'startLine': 67, 'endLine': 68}]
if sys.version_info[:2] >= (3, 9):
# the argument list of the decorator is also folded in Python >= 3.9
expected.insert(4, {'startLine': 9, 'endLine': 10})

assert ranges == expected


Expand Down