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

Coverage 6.0 moved coverage.misc.NoSource to coverage.exceptions.NoSource #326

Closed
haakenlid opened this issue Oct 3, 2021 · 3 comments · Fixed by #330
Closed

Coverage 6.0 moved coverage.misc.NoSource to coverage.exceptions.NoSource #326

haakenlid opened this issue Oct 3, 2021 · 3 comments · Fixed by #330

Comments

@haakenlid
Copy link

haakenlid commented Oct 3, 2021

Looks like the latest stable version of coverage breaks the reporting from coveralls-python.

#!/bin/bash -eo pipefail
COVERALLS_REPO_TOKEN=Q58WdUuZOi89XHyDeDsGE2lxUGQ2IfqP3 coveralls
Traceback (most recent call last):
  File "/home/circleci/.local/bin/coveralls", line 5, in <module>
    from coveralls.cli import main
  File "/home/circleci/.local/lib/python3.8/site-packages/coveralls/__init__.py", line 1, in <module>
    from .api import Coveralls
  File "/home/circleci/.local/lib/python3.8/site-packages/coveralls/api.py", line 14, in <module>
    from .reporter import CoverallReporter
  File "/home/circleci/.local/lib/python3.8/site-packages/coveralls/reporter.py", line 5, in <module>
    from coverage.misc import NoSource
ImportError: cannot import name 'NoSource' from 'coverage.misc' (/home/circleci/.local/lib/python3.8/site-packages/coverage/misc.py)

Exited with code exit status 1
CircleCI received exit code 1

nedbat/coveragepy@6a3d3aa#diff-8489ba0fa1175208cbaa2e586bbf94c70fe721b8ebd8f022452e431fefd64168

@nedbat
Copy link

nedbat commented Oct 3, 2021

I took a look at reporter.py here: there are many internal elements being accessed. It would be better to work out a public API that does what you need.

@haakenlid
Copy link
Author

haakenlid commented Oct 3, 2021

Thanks for looking into it.

I did figure out a solution for my problem. Turns out the circleCI configuration of the github repo I was submitting a pull request to would install the latest stable version of both coveralls and coverage python packages.

steps:
  - checkout
  - run:
      command: pip install --user tox coverage coveralls
      name: "Install Tox & Coverage"

I changed this to let coveralls choose which version of coverage to use (not yet 6.0), and then it built with no error.

      command: pip install --user tox coveralls

I suspect that there are more projects out there with similar configuration (copy-pasted?) that will be affected by this change.

A quick search seems to confirm that suspicion.
https://github.com/search?l=YAML&q=%22tox+coverage+coveralls%22&type=Code

alisonrclarke added a commit to HEPData/hepdata-validator that referenced this issue Oct 6, 2021
arcivanov added a commit to arcivanov/coveralls-python that referenced this issue Oct 24, 2021
There aren't really any issues with the current version.
Verified by providing a smoke integration test
Updated tox and classifiers

fixes TheKevJames#326
@nedbat
Copy link

nedbat commented Oct 29, 2021

BTW, coverage.py 6.0.1 restored access to the exceptions from coverage.misc. Can you try to allow newer versions of coverage.py?

TheKevJames pushed a commit that referenced this issue Nov 3, 2021
No major issues in adding support, the bulpk of the work here is providing a smoke test for verification.

Also updated tox and classifiers with new compatible ranges.

Fixes #326
andy-maier pushed a commit to andy-maier/coveralls-python that referenced this issue Dec 23, 2022
No major issues in adding support, the bulpk of the work here is providing a smoke test for verification.

Also updated tox and classifiers with new compatible ranges.

Fixes TheKevJames#326
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

Successfully merging a pull request may close this issue.

2 participants