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

Incompatible with coverage 7.5.0 #29

Closed
jessica-dyer opened this issue Apr 24, 2024 · 6 comments
Closed

Incompatible with coverage 7.5.0 #29

jessica-dyer opened this issue Apr 24, 2024 · 6 comments

Comments

@jessica-dyer
Copy link

jessica-dyer commented Apr 24, 2024

I upgraded the package coverage from 7.4.4 to 7.5.0 and coverage-badge began to error.

When running poetry run coverage-badge -o coverage.svg, I get the following error:

Traceback (most recent call last):

File "/Users/Repositories/repo/.venv/bin/coverage-badge", line 8, in <module>
  sys.exit(main())
File "/Users/Repositories/repo/.venv/lib/python3.10/site-packages/coverage_badge/__main__.py", line 171, in main
  total = get_total()
File "/Users/Repositories/repo/.venv/lib/python3.10/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'

I believe this is a bug in coverage-badge in relation to the newest version of coverage.

@jessica-dyer jessica-dyer changed the title Error with upgrade to package coverage Incompatible with coverage 7.5.0 Apr 24, 2024
@mrgambal
Copy link

Can confirm: downgrading to coverage==7.4.4 fixes the problem.

@jessica-dyer
Copy link
Author

Thanks @mrgambal. I ended up reading the README and seeing that this package is in maintenance mode so this issue may not get fixed. Switched to genbadge as a replacement.

@mrgambal
Copy link

mrgambal commented Apr 24, 2024

Yup, discovered the fact the same way :) Also I see there is a PR created that should fix this issue, yet it is still waiting for approval from @dbrgn.
One way or another, switching to genbadge sounds like a good idea.

p.s. Kudos to @dbrgn for the project anyway :)

@jessica-dyer
Copy link
Author

Oh great! Thanks for linking that PR.

Yes, cool project @dbrgn! Thank you!

@dbrgn
Copy link
Owner

dbrgn commented Apr 24, 2024

Thanks a lot @mrgambal and @jessica-dyer, that's appreciated!

dbrgn pushed a commit that referenced this issue Apr 24, 2024
In Coverage 7.5, the `display_covered` method of Numbers was turned into a standalone function, so the `get_total()` method stopped working.

Fixes #29.
@dbrgn
Copy link
Owner

dbrgn commented Apr 24, 2024

Fix released in version 1.1.1. Nevertheless, migrating to another project like genbadge is likely a good idea 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants