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

7.5.0 broke coverage-badge #1767

Closed
ErwinJunge opened this issue Apr 24, 2024 · 2 comments
Closed

7.5.0 broke coverage-badge #1767

ErwinJunge opened this issue Apr 24, 2024 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@ErwinJunge
Copy link

ErwinJunge commented Apr 24, 2024

Describe the bug
The recent release of 7.5.0 broke our usage of coverage-badge

To Reproduce

  1. What version of Python are you using? 3.12
  2. What version of coverage.py shows the problem? 7.5.0
  3. What versions of what packages do you have installed? coverage-7.5.0 coverage-badge-1.1.0
  4. What code shows the problem? dbrgn/coverage-badge@db8de11
  5. What commands should we run to reproduce the problem?
# first, run pytest with coverage enabled
python3 -m pip install coverage-badge # this pulls in coverage
coverage-badge -o badge.svg
Traceback (most recent call last):
  File "/usr/local/bin/coverage-badge", line 8, in <module>
    sys.exit(main())
             ^^^^^^

  File "/usr/local/lib/python3.12/site-packages/coverage_badge/__main__.py", line 171, in main
    total = get_total()
            ^^^^^^^^^^^

  File "/usr/local/lib/python3.12/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'

Expected behavior
Command generates coverage badge

Additional context
Issue likely caused by dropping of method in 4e50273#diff-9ecbfd6fa815c19afb2ab33c252cab155422453c975ed61f671617eb95ef840eL230

@ErwinJunge ErwinJunge added bug Something isn't working needs triage labels Apr 24, 2024
@ErwinJunge
Copy link
Author

This issue is potentially invalid, since coverage-badge updated to match coverage 7.5.0 in dbrgn/coverage-badge#28.

My remaining question is now just whether the dropping of Numbers.display_covered was intentional, or accidental. If it was intentional, this issue is definitely invalid and can be closed.

@nedbat
Copy link
Owner

nedbat commented May 2, 2024

The dropping was intentional, a refactoring of an internal interface. I'm happy to talk to people who need other supported interfaces.

@nedbat nedbat closed this as completed May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants