diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 76027af..b3f5d91 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,12 +15,15 @@ on: branches: [ trunk ] +permissions: + contents: read + + defaults: run: shell: bash - jobs: testing: runs-on: ubuntu-20.04 @@ -34,13 +37,14 @@ jobs: # When updating the minimum Python version here, also update the # `python_requires` from `setup.cfg`. # Run on latest minor release of each major python version. - python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12'] tox-env: ['tests'] include: # Run non-python version specific jobs. - python-version: 3.9 tox-env: mypy,apidocs + skip-coverage: true steps: - uses: actions/checkout@v2 @@ -77,10 +81,68 @@ jobs: commit_message: Publish docs for ${{ github.sha }} publish_dir: ./website - - uses: codecov/codecov-action@v1 - if: always() && matrix.tox-env == 'tests' + - name: Prepare coverage results + if: ${{ !cancelled() && !matrix.skip-coverage }} + run: | + # Assign the coverage file a name unique to this job so that the + # uploads don't collide. + mv .coverage ".coverage-job-${{ matrix.python-version }}-${{ matrix.job-name }}" + + - name: Store coverage file + if: ${{ !cancelled() && !matrix.skip-coverage }} + uses: actions/upload-artifact@v3 + with: + name: coverage + path: .coverage-job-* + + coverage-report: + name: Coverage report + runs-on: ubuntu-latest + # We want to always run the coverage, even when the + # tests failed. + if: always() + needs: + - testing # Wait for test jobs. + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade coverage[toml] diff_cover + + - name: Download coverage reports + uses: actions/download-artifact@v3 + with: + name: coverage + path: . + + - name: Prepare coverage + run: | + coverage combine .coverage-job-* + # XML is needed for the diff-cover. + coverage xml + + - name: Report coverage + run: | + # Report for the job log. + coverage report --skip-covered --skip-empty >> $GITHUB_STEP_SUMMARY + diff-cover --markdown-report coverage-report.md --compare-branch origin/trunk coverage.xml + + - name: Enforce diff coverage + run: | + diff-cover --fail-under=100 --compare-branch origin/trunk coverage.xml + + - name: Generate HTML report on failure + if: ${{ failure() }} + run: | + coverage html --skip-covered --skip-empty + + - name: Upload HTML report on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v3 with: - files: coverage.xml - name: lnx-${{ matrix.python-version }}-${{ matrix.tox-env }} - fail_ci_if_error: true - functionalities: gcov,search + name: html-report + path: htmlcov diff --git a/codecov.yaml b/codecov.yaml deleted file mode 100644 index 0d16c8d..0000000 --- a/codecov.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# -# For documentation: https://docs.codecov.io/docs/codecovyml-reference -# Incremental settings: https://codecov.io/gh/twisted/incremental/settings/yaml -# -# We want 100% coverage for new patches to make sure we are always increasing -# the coverage. -# -codecov: - require_ci_to_pass: yes - notify: - wait_for_ci: yes - -coverage: - precision: 2 - round: down - status: - patch: - default: - # New code should have 100% CI coverage as the minimum - # quality assurance measurement. - # If there is a good reason for new code not to have coverage, - # add inline pragma comments. - target: 100% - project: - default: - # Temporary allow for a bit of slack in overall code coverage due to - # swinging coverage that is not triggered by changes in a PR. - # See: https://twistedmatrix.com/trac/ticket/10170 - threshold: 0.02% - tests: - # Make sure we run each test at least once. - # If we don't have 100% coverage for tests, it meant that some - # tests are always skipped. - target: 100% - paths: - - "src/incremental/tests/*" - - "tests/*" - - -# See https://docs.codecov.io/docs/pull-request-comments -comment: - layout: "header, diff, files" - behavior: default - require_changes: true # if true: only post the comment if coverage changes - - -# See https://docs.codecov.io/docs/github-checks -github_checks: - # We want codecov to send inline PR comments for missing coverage. - annotations: true diff --git a/setup.cfg b/setup.cfg index e6ffe51..b0de040 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,8 +7,6 @@ url = https://github.com/twisted/incremental classifiers = Intended Audience :: Developers License :: OSI Approved :: MIT License - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 @@ -16,6 +14,9 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 license = MIT description = "A small library that versions your Python projects." long_description = file: README.rst @@ -47,9 +48,6 @@ mypy = %(scripts)s mypy==0.812 -[bdist_wheel] -universal = 1 - [flake8] max-line-length = 88 extend-ignore = diff --git a/src/incremental/86.removal b/src/incremental/86.removal new file mode 100644 index 0000000..48cdf75 --- /dev/null +++ b/src/incremental/86.removal @@ -0,0 +1 @@ +Support for Python 2.7 has been dropped for lack of test infrastructure. We no longer provide universal wheels. diff --git a/tox.ini b/tox.ini index 97ae02a..81f968e 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ minversion = 3.23.0 requires = virtualenv >= 20.4.3 + tox < 4.0.0 tox-wheel >= 0.6.0 isolated_build = true envlist = @@ -38,6 +39,7 @@ commands = tests: coverage report tests: coverage html tests: coverage xml + mypy: mypy src