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

[BUG] <AttributeError: 'Numbers' object has no attribute 'display_covered'> #163

Open
4 tasks done
Yegor-V opened this issue Apr 24, 2024 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working

Comments

@Yegor-V
Copy link

Yegor-V commented Apr 24, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

The GitHub pipeline started to fail with error AttributeError: 'Numbers' object has no attribute 'display_covered'

To Reproduce

  1. Setup GitHub action that runs tests with coverage
  2. Add the "coverage badge" step after:
    - name: Coverage Badge
      uses: tj-actions/coverage-badge-py@v2
  1. Action fails with error AttributeError: 'Numbers' object has no attribute 'display_covered'

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-22.04

Expected behavior?

The action run without error

Relevant log output

Run tj-actions/coverage-badge-py@v2
Run pip install -U coverage-badge
  
Collecting coverage-badge
  Downloading coverage_badge-1.1.0-py2.py3-none-any.whl.metadata (3.2 kB)
Requirement already satisfied: coverage in /opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages (from coverage-badge) (7.5.0)
Downloading coverage_badge-1.1.0-py2.py3-none-any.whl (6.4 kB)
Installing collected packages: coverage-badge
Successfully installed coverage-badge-1.1.0

Notice:  A new release of pip is available: 23.0.1 -> 24.0
Notice:  To update, run: pip install --upgrade pip
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.19/x64/bin/coverage-badge", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/coverage_badge/__main__.py", line 171, in main
    total = get_total()
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/coverage_badge/__main__.py", line 76, in get_total
    return coverage.results.Numbers(precision=cov.config.precision).display_covered(total)
AttributeError: 'Numbers' object has no attribute 'display_covered'
Error: Process completed with exit code 1.

Has all relevant logs been included?

  • I've included all relevant logs

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Yegor-V Yegor-V added the bug Something isn't working label Apr 24, 2024
@mcw92
Copy link

mcw92 commented Apr 24, 2024

I am encountering the very same problem in our repo when using this action in our test workflow like this:

            - name: Coverage Badge
              uses: tj-actions/coverage-badge-py@v2

I see the following error message:

Run tj-actions/coverage-badge-py@v2
Run pip install -U coverage-badge
Collecting coverage-badge
  Downloading coverage_badge-1.1.0-py2.py3-none-any.whl.metadata (3.2 kB)
Requirement already satisfied: coverage in /opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages (from coverage-badge) (7.5.0)
Downloading coverage_badge-1.1.0-py2.py3-none-any.whl (6.4 kB)
Installing collected packages: coverage-badge
Successfully installed coverage-badge-1.1.0
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.19/x64/bin/coverage-badge", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/coverage_badge/__main__.py", line 171, in main
    total = get_total()
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/coverage_badge/__main__.py", line 76, in get_total
    return coverage.results.Numbers(precision=cov.config.precision).display_covered(total)
AttributeError: 'Numbers' object has no attribute 'display_covered'
Error: Process completed with exit code 1.

This is the link to one of my workflow runs that failed because of this:
https://github.com/Helmholtz-AI-Energy/propulate/actions/runs/8815977738/job/24199070502?pr=116
Yesterday in the evening, I did not have any problems and the workflow ran through without any errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants