From 60ec8804226c51e5dca46165ba5ecc681f92f5c4 Mon Sep 17 00:00:00 2001 From: gousaiyang Date: Wed, 7 Apr 2021 12:58:41 -0700 Subject: [PATCH 1/5] Travis CI -> GitHub Actions --- .github/workflows/build.yml | 68 +++++++++++++++++++++++++++++++++++++ .travis.yml | 31 ----------------- README.rst | 6 ++-- docs/docs/development.rst | 4 +-- docs/index.rst | 2 +- 5 files changed, 74 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..60cebdd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,68 @@ +name: Build + +on: [push, pull_request] + +env: + PYTEST_ADDOPTS: --color=yes + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install .[qa] + - name: Run Flake8 + # Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong. + run: flake8 --extend-ignore F401 parso test/*.py setup.py scripts/ + - name: Run Mypy + run: mypy parso + test: + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: false + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9'] + experimental: [false] + include: + - python-version: '3.10-dev' + experimental: true + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install .[testing] + - name: Run pytest + run: pytest + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install .[testing] coverage + - name: Run pytest with coverage + run: | + coverage run -m pytest + coverage report + - name: Upload coverage report + run: | + pip install --quiet coveralls + coveralls diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c79c1c9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -dist: xenial -language: python -python: - - 3.6 - - 3.7 - - 3.8.2 - - nightly -matrix: - allow_failures: - - python: nightly - include: - - python: 3.8 - install: - - 'pip install .[qa]' - script: - # Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong. - - 'flake8 --extend-ignore F401 parso test/*.py setup.py scripts/' - - mypy parso - - python: 3.8.2 - script: - - 'pip install coverage' - - 'coverage run -m pytest' - - 'coverage report' - after_script: - - | - pip install --quiet coveralls - coveralls -install: - - pip install .[testing] -script: - - pytest diff --git a/README.rst b/README.rst index 6a048e6..98abc73 100644 --- a/README.rst +++ b/README.rst @@ -3,9 +3,9 @@ parso - A Python Parser ################################################################### -.. image:: https://travis-ci.org/davidhalter/parso.svg?branch=master - :target: https://travis-ci.org/davidhalter/parso - :alt: Travis CI build status +.. image:: https://github.com/davidhalter/parso/workflows/Build/badge.svg?branch=master + :target: https://github.com/davidhalter/parso/actions + :alt: GitHub Actions build status .. image:: https://coveralls.io/repos/github/davidhalter/parso/badge.svg?branch=master :target: https://coveralls.io/github/davidhalter/parso?branch=master diff --git a/docs/docs/development.rst b/docs/docs/development.rst index 1332c66..e14a1e4 100644 --- a/docs/docs/development.rst +++ b/docs/docs/development.rst @@ -34,5 +34,5 @@ easy as:: python3.9 -m pytest -Tests are also run automatically on `Travis CI -`_. +Tests are also run automatically on `GitHub Actions +`_. diff --git a/docs/index.rst b/docs/index.rst index 50fb0a8..b390db3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,5 +27,5 @@ Resources --------- - `Source Code on Github `_ -- `Travis Testing `_ +- `GitHub Actions Testing `_ - `Python Package Index `_ From b5429ccbdcdcff192ce3d543880f864933699f2b Mon Sep 17 00:00:00 2001 From: gousaiyang Date: Wed, 7 Apr 2021 13:14:47 -0700 Subject: [PATCH 2/5] Use Coveralls GitHub Action with GITHUB_TOKEN --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60cebdd..096fa10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: run: | coverage run -m pytest coverage report - - name: Upload coverage report - run: | - pip install --quiet coveralls - coveralls + - name: Upload coverage report to Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From 885f623c4b148efbaa441ac3d0af34df38b5ed24 Mon Sep 17 00:00:00 2001 From: gousaiyang Date: Wed, 7 Apr 2021 13:25:05 -0700 Subject: [PATCH 3/5] Still use the coveralls package --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 096fa10..200e779 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,8 @@ jobs: coverage run -m pytest coverage report - name: Upload coverage report to Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install --quiet coveralls + coveralls From d76c890667390be12afdb5e99ac0e16b45a5bd79 Mon Sep 17 00:00:00 2001 From: gousaiyang Date: Wed, 7 Apr 2021 15:51:13 -0700 Subject: [PATCH 4/5] Try `coveralls --service=github` --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 200e779..b5bab61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip setuptools wheel - pip install .[testing] coverage + pip install .[testing] coverage coveralls - name: Run pytest with coverage run: | coverage run -m pytest @@ -65,6 +65,4 @@ jobs: - name: Upload coverage report to Coveralls env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - pip install --quiet coveralls - coveralls + run: coveralls --service=github From b42135fb1adc677c0c87b89574ad259889273aa1 Mon Sep 17 00:00:00 2001 From: gousaiyang Date: Wed, 7 Apr 2021 16:16:49 -0700 Subject: [PATCH 5/5] Disable 3.10 build for now --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5bab61..0de073e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,9 +31,9 @@ jobs: matrix: python-version: ['3.6', '3.7', '3.8', '3.9'] experimental: [false] - include: - - python-version: '3.10-dev' - experimental: true + # include: + # - python-version: '3.10-dev' + # experimental: true steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }}