From 5689ad7af34fe77a737d43f42e891944ea3187af Mon Sep 17 00:00:00 2001 From: Richard Si <63936253+ichard26@users.noreply.github.com> Date: Mon, 3 May 2021 17:33:12 -0400 Subject: [PATCH] Drop Travis CI and migrate Coveralls Travis CI for Open Source is shutting down in a few weeks so the queue for jobs is insane due to lower resources. I'm 99.99% sure we don't need it as our Test, Lint, Docs, Upload / Package, Primer, and Fuzz workflows are all on GitHub Actions. So even though we *can* migrate to the .com version with its 1000 free Linux minutes(?), I don't think we need to. more information here: - https://blog.travis-ci.com/oss-announcement - https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing - https://docs.travis-ci.com/user/migrate/open-source-repository-migration This commit does the following: - delete the Travis CI configuration - add to the GHA test workflows so coverage continues to be recorded - tweaked coverage configuration so this wouldn't break - also moved over the coverage configuration to pyproject.toml to reduce root clutter - remove any references to Travis CI in the docs (i.e. readme + sphinx docs) Regarding the Travis CI to GitHub Actions Coveralls transition, the official action doesn't support the coverage files produced by coverage.py unfornately. Also no, I don't really know what I am doing so don't @ me if this breaks :p --- .coveragerc | 5 ----- .github/workflows/test.yml | 42 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 31 ---------------------------- README.md | 1 - docs/conf.py | 1 - pyproject.toml | 8 ++++++-- 6 files changed, 48 insertions(+), 40 deletions(-) delete mode 100644 .coveragerc delete mode 100644 .travis.yml diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 32a8da521ba..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,5 +0,0 @@ -[report] -omit = - src/blib2to3/* - tests/data/* - */site-packages/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bec769064c2..2b6ac502456 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,3 +34,45 @@ jobs: - name: Unit tests run: | tox -e py + + - name: Publish coverage to Coveralls + # If pushed / is a pull request against main repo AND + # we're running on Linux (this action only supports Linux) + if: + ((github.event_name == 'push' && github.event.push.repository.full_name == + 'psf/black') || github.event.pull_request.base.repo.full_name == 'psf/black') + && matrix.os == 'ubuntu-latest' + + uses: AndreMiras/coveralls-python-action@v20201129 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel: true + flag-name: py${{ matrix.python-version }}-${{ matrix.os }} + debug: true + + coveralls-finish: + needs: build + permissions: + actions: write + checks: write + contents: none + deployments: none + issues: none + packages: none + pull-requests: write + repository-projects: none + security-events: none + statuses: write + # If pushed / is a pull request against main repo + if: + (github.event_name == 'push' && github.event.push.repository.full_name == + 'psf/black') || github.event.pull_request.base.repo.full_name == 'psf/black' + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Coveralls finished + uses: AndreMiras/coveralls-python-action@v20201129 + with: + parallel-finished: true + debug: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e782272e813..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: python -cache: - pip: true - directories: - - $HOME/.cache/pre-commit -env: - - TEST_CMD="tox -e py" -install: - - pip install coverage coveralls pre-commit tox - - pip install -e '.[d]' -script: - - $TEST_CMD -after_success: - - coveralls -notifications: - on_success: change - on_failure: always -matrix: - include: - - name: "lint" - python: 3.7 - env: - - TEST_CMD="pre-commit run --all-files --show-diff-on-failure" - - name: "3.6" - python: 3.6 - - name: "3.7" - python: 3.7 - - name: "3.8" - python: 3.8 - - name: "3.9" - python: 3.9 diff --git a/README.md b/README.md index 41cea761df5..696bfa7e064 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@

The Uncompromising Code Formatter

-Build Status Actions Status Actions Status Documentation Status diff --git a/docs/conf.py b/docs/conf.py index ec6aad9a27b..9e03d05e937 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -314,7 +314,6 @@ def process_sections( "show_powered_by": True, "fixed_sidebar": True, "logo": "logo2.png", - "travis_button": True, } diff --git a/pyproject.toml b/pyproject.toml index 7f632f2839d..3cab0336ddd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,9 +18,13 @@ extend-exclude = ''' )/ ''' +# NOTE: You don't need the following in your own Black configuration. -# Build system information below. -# NOTE: You don't need this in your own Black configuration. +[tools.coverage.run] +relative_files = true + +[tools.coverage.report] +omit = ['src/blib2to3/*', 'tests/data/*', '*/site-packages/*'] [build-system] requires = ["setuptools>=41.0", "setuptools-scm", "wheel"]