Skip to content

Commit

Permalink
Merge branch 'master' into issue-1488/do-not-consider-files-without-e…
Browse files Browse the repository at this point in the history
…xtensions-python
  • Loading branch information
jayaddison committed May 9, 2024
2 parents 6fc52cb + d915667 commit c6a0f0c
Show file tree
Hide file tree
Showing 220 changed files with 19,649 additions and 14,896 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ trim_trailing_whitespace = true
[*.py]
max_line_length = 100

[*.pyi]
max_line_length = 100

[*.c]
max_line_length = 100

Expand All @@ -30,6 +33,12 @@ indent_size = 2
[*.rst]
max_line_length = 79

[*.tok]
trim_trailing_whitespace = false

[*_dos.tok]
end_of_line = crlf

[Makefile]
indent_style = tab
indent_size = 8
Expand Down
29 changes: 29 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Commits to ignore when doing git-blame.

# 2023-01-05 style: use good style for annotated defaults parameters
78444f4c06df6a634fa67dd99ee7c07b6b633d9e

# 2023-01-06 style(perf): blacken lab/benchmark.py
bf6c12f5da54db7c5c0cc47cbf22c70f686e8236

# 2023-03-22 style: use double-quotes
16abd82b6e87753184e8308c4b2606ff3979f8d3
b7be64538aa480fce641349d3053e9a84862d571

# 2023-04-01 style: use double-quotes in JavaScript
b03ab92bae24c54f1d5a98baa3af6b9a18de4d36

# 2023-11-04 style: ruff format igor.py, setup.py, __main__.py
acb80450d7c033a6ea6e06eb2e74d3590c268435

# 2023-11-20 style: fr"" is better than rf"", for real
d8daa08b347fe6b7099c437b09d926eb999d0803

# 2023-12-02 style: check_coverage close parens should be on their own line
5d0b5d4464b84adb6389c8894c207a323edb2b2b

# 2024-02-27 style: fix COM812 Trailing comma missing
e4e238a9ed8f2ad2b9060247591b4c057c2953bf

# 2024-02-27 style: modernize type hints, a few more f-strings
401a63bf08bdfd780b662f64d2dfe3603f2584dd
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ How can we reproduce the problem? Please *be specific*. Don't link to a failing
1. What version of coverage.py shows the problem? The output of `coverage debug sys` is helpful.
1. What versions of what packages do you have installed? The output of `pip freeze` is helpful.
1. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
1. What commands did you run?
1. What commands should we run to reproduce the problem? *Be specific*. Include everything, even `git clone`, `pip install`, and so on. Explain like we're five!

**Expected behavior**
A clear and concise description of what you expected to happen.
Expand Down
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ contact_links:
- name: Frequently Asked Questions
url: https://coverage.readthedocs.io/en/latest/faq.html
about: Some common problems are described here.
- name: Testing in Python mailing list
url: http://lists.idyll.org/listinfo/testing-in-python
about: Ask questions about using coverage.py here.
- name: Tidelift security contact
url: https://tidelift.com/security
about: Please report security vulnerabilities here.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Support request
about: Ask for help using coverage.py
title: ''
labels: support, needs triage
assignees: ''

---

**Have you asked elsewhere?**

There are other good places to ask for help using coverage.py. These places let
other people suggest solutions, are more likely places for people to find your
question:

- [Stack Overflow](https://stackoverflow.com/questions/tagged/coverage.py)
- [discuss.python.org](https://discuss.python.org/search?q=coverage.py)

**Describe your situation**

Wherever you ask your question, be sure to explain:

- What you did
- What happened
- How that was different than what you wanted to happen
- What kind of help you need
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -60,7 +60,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -74,4 +74,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
146 changes: 101 additions & 45 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ defaults:

env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
FORCE_COLOR: 1 # Get colored pytest output

permissions:
contents: read
Expand All @@ -28,53 +29,78 @@ concurrency:

jobs:
coverage:
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
name: "${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
env:
MATRIX_ID: "${{ matrix.python-version }}.${{ matrix.os }}"

strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
- ubuntu
- macos
- windows
python-version:
# When changing this list, be sure to check the [gh-actions] list in
# When changing this list, be sure to check the [gh] list in
# tox.ini so that tox will run properly. PYVERSIONS
# Available versions:
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "pypy-3.7"
- "3.12"
- "3.13"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
exclude:
# Windows PyPy doesn't seem to work?
- os: windows-latest
python-version: "pypy-3.7"
# Mac PyPy always takes the longest, and doesn't add anything.
- os: macos-latest
python-version: "pypy-3.7"
- os: macos
python-version: "pypy-3.8"
- os: macos
python-version: "pypy-3.9"
- os: macos
python-version: "pypy-3.10"
# Windows pypy 3.9 and 3.10 get stuck with PyPy 7.3.15. I hope to
# unstick them, but I don't want that to block all other progress, so
# skip them for now.
- os: windows
python-version: "pypy-3.9"
- os: windows
python-version: "pypy-3.10"
# If one job fails, stop the whole thing.
fail-fast: true

steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Set up Python"
uses: "actions/setup-python@v4"
uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
cache: pip
cache-dependency-path: 'requirements/*.pip'
allow-prereleases: true
# At a certain point, installing dependencies failed on pypy 3.9 and
# 3.10 on Windows. Commenting out the cache here fixed it. Someday
# try using the cache again.
#cache: pip
#cache-dependency-path: 'requirements/*.pip'

- name: "Show environment"
run: |
set -xe
python -VV
python -m site
env
- name: "Install dependencies"
run: |
echo matrix id: $MATRIX_ID
set -xe
python -VV
python -m site
python -m pip install --require-hashes -r requirements/tox.pip
python -m pip install -r requirements/tox.pip
- name: "Run tox coverage for ${{ matrix.python-version }}"
env:
Expand All @@ -84,10 +110,17 @@ jobs:
set -xe
python -m tox
- name: "Combine data"
env:
COVERAGE_RCFILE: "metacov.ini"
run: |
python -m coverage combine
mv .metacov .metacov.$MATRIX_ID
- name: "Upload coverage data"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: metacov
name: metacov-${{ env.MATRIX_ID }}
path: .metacov.*

combine:
Expand All @@ -101,27 +134,36 @@ jobs:

steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Set up Python"
uses: "actions/setup-python@v4"
uses: "actions/setup-python@v5"
with:
python-version: "3.7" # Minimum of PYVERSIONS
cache: pip
cache-dependency-path: 'requirements/*.pip'
python-version: "3.8" # Minimum of PYVERSIONS
# At a certain point, installing dependencies failed on pypy 3.9 and
# 3.10 on Windows. Commenting out the cache here fixed it. Someday
# try using the cache again.
#cache: pip
#cache-dependency-path: 'requirements/*.pip'

- name: "Install dependencies"
- name: "Show environment"
run: |
set -xe
python -VV
python -m site
env
- name: "Install dependencies"
run: |
set -xe
python -m pip install -e .
python igor.py zip_mods
- name: "Download coverage data"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: metacov
pattern: metacov-*
merge-multiple: true

- name: "Combine and report"
id: combine
Expand All @@ -132,7 +174,7 @@ jobs:
python igor.py combine_html
- name: "Upload HTML report"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html_report
path: htmlcov
Expand All @@ -148,21 +190,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: "Checkout reports repo"
- name: "Show environment"
run: |
set -xe
git clone --depth=1 --no-checkout https://${{ secrets.COVERAGE_REPORTS_TOKEN }}@github.com/nedbat/coverage-reports reports_repo
cd reports_repo
git sparse-checkout init --cone
git sparse-checkout set --skip-checks '/*' '!/reports'
git config user.name nedbat
git config user.email ned@nedbatchelder.com
git checkout main
env
- name: "Compute info for later steps"
id: info
run: |
set -xe
env
export SHA10=$(echo ${{ github.sha }} | cut -c 1-10)
export SLUG=$(date +'%Y%m%d')_$SHA10
export REPORT_DIR=reports/$SLUG/htmlcov
Expand All @@ -171,16 +208,36 @@ jobs:
echo "sha10=$SHA10" >> $GITHUB_ENV
echo "slug=$SLUG" >> $GITHUB_ENV
echo "report_dir=$REPORT_DIR" >> $GITHUB_ENV
echo "url=https://nedbat.github.io/coverage-reports/$REPORT_DIR" >> $GITHUB_ENV
echo "url=https://htmlpreview.github.io/?https://github.com/nedbat/coverage-reports/blob/main/reports/$SLUG/htmlcov/index.html" >> $GITHUB_ENV
echo "branch=${REF#refs/heads/}" >> $GITHUB_ENV
- name: "Summarize"
run: |
echo '### Total coverage: ${{ env.total }}%' >> $GITHUB_STEP_SUMMARY
- name: "Checkout reports repo"
if: ${{ github.ref == 'refs/heads/master' }}
run: |
set -xe
git clone --depth=1 --no-checkout https://${{ secrets.COVERAGE_REPORTS_TOKEN }}@github.com/nedbat/coverage-reports reports_repo
cd reports_repo
git sparse-checkout init --cone
git sparse-checkout set --skip-checks '/*' '!/reports'
git config user.name nedbat
git config user.email ned@nedbatchelder.com
git checkout main
- name: "Download coverage HTML report"
uses: actions/download-artifact@v3
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/download-artifact@v4
with:
name: html_report
path: reports_repo/${{ env.report_dir }}

- name: "Push to report repo"
if: |
github.repository_owner == 'nedbat'
&& github.ref == 'refs/heads/master'
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
Expand All @@ -201,10 +258,14 @@ jobs:
git add ${{ env.report_dir }} latest.html
git commit --file=../commit.txt
git push
echo '[${{ env.url }}](${{ env.url }})' >> $GITHUB_STEP_SUMMARY
- name: "Create badge"
if: |
github.repository_owner == 'nedbat'
&& github.ref == 'refs/heads/master'
# https://gist.githubusercontent.com/nedbat/8c6980f77988a327348f9b02bbaf67f5
uses: schneegans/dynamic-badges-action@5d424ad4060f866e4d1dab8f8da0456e6b1c4f56
uses: schneegans/dynamic-badges-action@e9a478b16159b4d31420099ba146cdc50f134483
with:
auth: ${{ secrets.METACOV_GIST_SECRET }}
gistID: 8c6980f77988a327348f9b02bbaf67f5
Expand All @@ -214,8 +275,3 @@ jobs:
minColorRange: 60
maxColorRange: 95
valColorRange: ${{ env.total }}

- name: "Create summary"
run: |
echo '### Total coverage: ${{ env.total }}%' >> $GITHUB_STEP_SUMMARY
echo '[${{ env.url }}](${{ env.url }})' >> $GITHUB_STEP_SUMMARY

0 comments on commit c6a0f0c

Please sign in to comment.