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

__init__() missing 1 required positional argument: 'name' with coverage ~= 6.1 #333

Closed
DanielNoord opened this issue Nov 4, 2021 · 7 comments · Fixed by #337
Closed

Comments

@DanielNoord
Copy link

After updating to coveralls ~= 3.3 and trying to run the CI of pylint with coverage ~= 6.1 we are running into an error. Based on the traceback I'm reporting it here. Running with coverage ~= 5.5 does not fail.

2021-11-04T11:04:44.0937803Z Submitting coverage to coveralls.io...
2021-11-04T11:04:44.1569408Z Traceback (most recent call last):
2021-11-04T11:04:44.1572295Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/reporter.py", line 122, in report
2021-11-04T11:04:44.1573884Z     from coverage.report import Reporter  # pylint: disable=import-outside-toplevel
2021-11-04T11:04:44.1575607Z ImportError: cannot import name 'Reporter' from 'coverage.report' (/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coverage/report.py)
2021-11-04T11:04:44.1576500Z 
2021-11-04T11:04:44.1577134Z During handling of the above exception, another exception occurred:
2021-11-04T11:04:44.1577658Z 
2021-11-04T11:04:44.1578094Z Traceback (most recent call last):
2021-11-04T11:04:44.1578880Z   File "/home/runner/work/pylint/pylint/venv/bin/coveralls", line 8, in <module>
2021-11-04T11:04:44.1579559Z     sys.exit(main())
2021-11-04T11:04:44.1580635Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/cli.py", line 95, in main
2021-11-04T11:04:44.1581485Z     result = coverallz.wear()
2021-11-04T11:04:44.1582616Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/api.py", line 252, in wear
2021-11-04T11:04:44.1583503Z     json_string = self.create_report()
2021-11-04T11:04:44.1585067Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/api.py", line 330, in create_report
2021-11-04T11:04:44.1585940Z     data = self.create_data()
2021-11-04T11:04:44.1587096Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/api.py", line 384, in create_data
2021-11-04T11:04:44.1588222Z     self._data = {'source_files': self.get_coverage()}
2021-11-04T11:04:44.1589453Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/api.py", line 404, in get_coverage
2021-11-04T11:04:44.1590540Z     return CoverallReporter(workman, workman.config, base_dir,
2021-11-04T11:04:44.1592115Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/reporter.py", line 23, in __init__
2021-11-04T11:04:44.1593006Z     self.report(cov, conf)
2021-11-04T11:04:44.1594179Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/reporter.py", line 125, in report
2021-11-04T11:04:44.1595096Z     return self.report5(cov)
2021-11-04T11:04:44.1596276Z   File "/home/runner/work/pylint/pylint/venv/lib/python3.8/site-packages/coveralls/reporter.py", line 71, in report5
2021-11-04T11:04:44.1597368Z     matcher = FnmatchMatcher(prep_patterns(config.report_include))
2021-11-04T11:04:44.1598457Z TypeError: __init__() missing 1 required positional argument: 'name'

Run of the CI can be found here https://github.com/PyCQA/pylint/runs/4104109552?check_suite_focus=true

Perhaps #330 only adds support for 6.0 and not 6.1?

Happy to provide any other details or data necessary to fix this!

@cdce8p
Copy link
Contributor

cdce8p commented Nov 4, 2021

It might be easier to address in coveragepy. I opened nedbat/coveragepy#1273 for it.

@emcek
Copy link

emcek commented Nov 6, 2021

I have similar problem running coveralls in GitHub Action

  coveralls
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.0/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.0/x64/lib
    GITHUB_TOKEN: ***
    COVERALLS_SERVICE_NAME: github
Submitting coverage to coveralls.io...
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/reporter.py", line 122, in report
    from coverage.report import Reporter  # pylint: disable=import-outside-toplevel
ImportError: cannot import name 'Reporter' from 'coverage.report' (/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coverage/report.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.0/x64/bin/coveralls", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/cli.py", line 95, in main
    result = coverallz.wear()
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/api.py", line 252, in wear
    json_string = self.create_report()
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/api.py", line 330, in create_report
    data = self.create_data()
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/api.py", line 384, in create_data
    self._data = {'source_files': self.get_coverage()}
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/api.py", line 404, in get_coverage
    return CoverallReporter(workman, workman.config, base_dir,
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/reporter.py", line 23, in __init__
    self.report(cov, conf)
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/reporter.py", line 125, in report
    return self.report5(cov)
  File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/coveralls/reporter.py", line 76, in report5
    matcher = FnmatchMatcher(prep_patterns(config.report_omit))
TypeError: FnmatchMatcher.__init__() missing 1 required positional argument: 'name'
Error: Process completed with exit code 1.

@DanielNoord
Copy link
Author

@TheKevJames Will need to pin the version to the next release of coverage as this will be fixed in that version.

@DanielNoord
Copy link
Author

@TheKevJames Please pin coverage to 6.1.2 😄

@cdce8p
Copy link
Contributor

cdce8p commented Nov 11, 2021

Please pin coverage to 6.1.2

@DanielNoord I wouldn't suggest pinning coverage. It's much better to exclude incompatible versions in this case. -> #337

@DanielNoord
Copy link
Author

Yeah, that's what I meant. Thanks for opening the PR 🎉

@TheKevJames
Copy link
Owner

Hey folks, thanks for investigating this and special thanks to @cdce8p for the fix. I've just released coveralls v3.3.1 with the included restriction.

Separately, I'll investigate further our use of internal APIs from coverage-py as mentioned in nedbat/coveragepy#1273 . I really thought we'd managed to fix that issue...

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.

4 participants