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

Breaks with coverage 5.0 #73

Open
skwashd opened this issue Dec 17, 2019 · 10 comments
Open

Breaks with coverage 5.0 #73

skwashd opened this issue Dec 17, 2019 · 10 comments

Comments

@skwashd
Copy link

skwashd commented Dec 17, 2019

The 5.0 release of the coverage package contains backwards compatibility breaking changes. One of those changes was removing the Reporter class. This results in the following output in Travis CI:

$ coveralls
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.7.1/bin/coveralls", line 10, in <module>
    sys.exit(wear())
  File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/coveralls/__init__.py", line 78, in wear
    from coveralls.control import coveralls
  File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/coveralls/control.py", line 2, in <module>
    from coveralls.report import CoverallsReporter
  File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/coveralls/report.py", line 6, in <module>
    from coverage.report import Reporter
ImportError: cannot import name 'Reporter' from 'coverage.report' (/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/coverage/report.py)
@madmath03
Copy link

For info, I have this issue too with Frappe apps (frappe/frappe#9169), but after pinning coverage version to 4.5.4 I have a new error :

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 106: invalid start byte

The source code analyzed has not changed and, of course, I did not had this error before.
I saw #31 and #30 but the solution does not apply in my case. Maybe it's not related, but has anyone encountered this and found a solution ?

@hartwork
Copy link

Any news on supporting coverage>=5?

@Wolfe1
Copy link

Wolfe1 commented Jan 22, 2020

@hartwork unless there is something you specifically need here, this worked for me:
https://github.com/coveralls-clients/coveralls-python

gerardroche added a commit to gerardroche/sublime-phpunit that referenced this issue Jan 24, 2020
jaqx0r added a commit to google/nsscache that referenced this issue Jan 26, 2020
SwamyDev added a commit to SwamyDev/udacity-deep-rl-navigation that referenced this issue Feb 1, 2020
The new coverage version has some breaking changes and is not backwards
compatible. See z4r/python-coveralls#73
SwamyDev added a commit to SwamyDev/udacity-deep-rl-navigation that referenced this issue Feb 2, 2020
The new coverage version has some breaking changes and is not backwards
compatible. See z4r/python-coveralls#73
bmerry added a commit to jamesls/fakeredis that referenced this issue Feb 4, 2020
Python-coveralls doesn't work with the latest versions of coverage:
z4r/python-coveralls#73.
@Choi-Sung-Hoon
Copy link

If you are having a trouble with Travis CI, have a look at #74.

MSK61 added a commit to MSK61/processorsim that referenced this issue Feb 11, 2020
Because:
pypthon-coveralls doesn't support the lastest version of coverage 5.0 as
the latter has introduced some backwards compatibility breaking changes.

See z4r/python-coveralls#73 and
MozillaFoundation/foundation.mozilla.org#4170 for details.
shahzebsiddiqui added a commit to shahzebsiddiqui/easybuild-framework that referenced this issue Feb 20, 2020
Testing Travis  Build due to similar error reported with where it fails to import Reporter z4r/python-coveralls#73
jontingvold added a commit to jontingvold/pyrankvote that referenced this issue Mar 11, 2020
jontingvold added a commit to jontingvold/pyrankvote that referenced this issue Mar 11, 2020
jszopi added a commit to jszopi/repESP that referenced this issue Mar 16, 2020
jszopi added a commit to jszopi/repESP that referenced this issue Mar 16, 2020
Also use coveralls instead of python-coveralls as a workaround for z4r/python-coveralls#73
@drewdogg
Copy link

@madmath03 That error is due to the outputted .coverage file format is different for coverage 5.0+. The fix is to downgrade coverage and re-run your test suite, which will regenerate that file in the older format that can be read by the coveralls command.

makyen added a commit to makyen/Charcoal-SE-SmokeDetector that referenced this issue Jul 13, 2020
makyen added a commit to makyen/Charcoal-SE-SmokeDetector that referenced this issue Jul 13, 2020
andrewjw added a commit to andrewjw/zyxelprometheus that referenced this issue Aug 11, 2020
@amykyta3
Copy link

Commenting here since this thread shows up in Google searches often.

There's no need to pin to an older version of coveralls.
Instead, make sure you are not installing coverage or python-coveralls as they seem to cause some sort of conflict (See: #73).

This combination is working for me:

pip install -U pytest pytest-cov coveralls

@DevGlitch
Copy link

@amykyta3 I tried this as I had the same issue but it didn't solve it.

@wumpus
Copy link

wumpus commented Sep 6, 2020

I use coverage for coverage report -m, and I use coveralls for coveralls. Are you saying that it's no big deal that they are incompatible? I suppose I could carefully use only one or the other depending on the circumstances. Normally the tools I use aren't this finicky.

@DevGlitch
Copy link

I downgraded coverage to a version < 5 and it solved this issue.

@wumpus
Copy link

wumpus commented Sep 6, 2020

Yes, see the title of the bug and numerous comments above: the problem starts with coverage version 5.

Looking at setup.py for this package, it imports "coverage" without any version.

tyronerees added a commit to fitbenchmarking/fitbenchmarking that referenced this issue Sep 14, 2020
wathen added a commit to fitbenchmarking/fitbenchmarking that referenced this issue Sep 17, 2020
* GSL and RALFit work

* Add dockerfile for the basic dependencies

* First stab at a travis.yml file

* pull a specific version of the container

* update the docker command

* correct name of docker container

* change the docker run command

* Add full install dockerfile

* docker run the script

* remove multiline

* docker run --> docker exec

* update bash script location

* Fixing table tests

* Updating docker travis file

* run apt-get update first

* pull the extras container, and test defaults

* change location of block scalars

* swap tabs for spaces

* fix unit tests version

* Change location of break

* make one line

* change directory on entry

* change directory of fitbenchmarking

* add missing / to pip install

* Update dockerfile to build pygsl and update MASTSIF

* fix pycutest_cache directory

* Run other tests through docker

* update dockerfile so that PYTHONPATH is correct

* fix directory location

* pull the correct container

* fix some of the travis warnings

* fix the python version used

* move to fitbenchmarking repo, not personal one

* try and fix sending of data to coveralls

* run coveralls in docker

* pass environment variables to docker containers

* change order of env variables passed to travis

* try and run coveralls outside of docker

* start docker in fitbenchmarking folder

* allow for mantid segfault on first run

* full->extras

* fix or syntax

* split into two commands

* try to put segfault on before_install

* move segfault capturing into the unit_tests file

* install coveralls and change paths

* move install of coveralls after pass

* remove parallel option

* fix coveragerc error

* combine coverage reports to fix the directory structure

Following the hints here:
pytest-dev/pytest-cov#146

* try earlier version of coverage

see TheKevJames/coveralls-python#203

* be more specific in the version

* fix coverage version to that in the docker container

* remove python-coveralls from dockerfile

As suggested here:
z4r/python-coveralls#73

* remove installation of coverage

* pin coverage in dockerfile

* remove installation of coveralls (unneeded)

* fix syntax

* remove old dockerfile

* add documentation for the docker tests

* fix documentation styling

* fix examples format

* revert to fixed test directory

Co-authored-by: Michael Wathen <[email protected]>
wathen pushed a commit to fitbenchmarking/fitbenchmarking that referenced this issue Sep 17, 2020
* GSL and RALFit work

* Add dockerfile for the basic dependencies

* First stab at a travis.yml file

* pull a specific version of the container

* update the docker command

* correct name of docker container

* change the docker run command

* Add full install dockerfile

* docker run the script

* remove multiline

* docker run --> docker exec

* update bash script location

* Fixing table tests

* Updating docker travis file

* run apt-get update first

* pull the extras container, and test defaults

* change location of block scalars

* swap tabs for spaces

* fix unit tests version

* Change location of break

* make one line

* change directory on entry

* change directory of fitbenchmarking

* add missing / to pip install

* Update dockerfile to build pygsl and update MASTSIF

* fix pycutest_cache directory

* Run other tests through docker

* update dockerfile so that PYTHONPATH is correct

* fix directory location

* pull the correct container

* fix some of the travis warnings

* fix the python version used

* move to fitbenchmarking repo, not personal one

* try and fix sending of data to coveralls

* run coveralls in docker

* pass environment variables to docker containers

* change order of env variables passed to travis

* try and run coveralls outside of docker

* start docker in fitbenchmarking folder

* allow for mantid segfault on first run

* full->extras

* fix or syntax

* split into two commands

* try to put segfault on before_install

* move segfault capturing into the unit_tests file

* install coveralls and change paths

* move install of coveralls after pass

* remove parallel option

* fix coveragerc error

* combine coverage reports to fix the directory structure

Following the hints here:
pytest-dev/pytest-cov#146

* try earlier version of coverage

see TheKevJames/coveralls-python#203

* be more specific in the version

* fix coverage version to that in the docker container

* remove python-coveralls from dockerfile

As suggested here:
z4r/python-coveralls#73

* remove installation of coverage

* pin coverage in dockerfile

* remove installation of coveralls (unneeded)

* fix syntax

* remove old dockerfile

* add documentation for the docker tests

* fix documentation styling

* fix examples format

* revert to fixed test directory

Co-authored-by: Michael Wathen <[email protected]>
(cherry picked from commit e7bfb0d)
konstantinstadler added a commit to IndEcol/pymrio that referenced this issue Nov 6, 2021
Pierre-Sassoulas added a commit to Pierre-Sassoulas/contributors-txt that referenced this issue Nov 4, 2022
Pierre-Sassoulas added a commit to Pierre-Sassoulas/contributors-txt that referenced this issue Nov 4, 2022
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/PyCQA/autoflake: v1.7.6 → v1.7.7](PyCQA/autoflake@v1.7.6...v1.7.7)
- [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](asottile/pyupgrade@v3.1.0...v3.2.0)
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.2 → v3.0.0-alpha.4](pre-commit/mirrors-prettier@v3.0.0-alpha.2...v3.0.0-alpha.4)

* Remove python-coveralls and duplication

See z4r/python-coveralls#73

Co-authored-by: Pierre Sassoulas <[email protected]>
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

9 participants