-
Notifications
You must be signed in to change notification settings - Fork 74
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
Using for Python code and coverage.py #4
Comments
Hi @aodj, could you try the steps described here: e.g.: coveralls --output=coverage.json
coveralls-lcov -v -n coverage.info > coverage.json Then use "./coverage.json" as the Let me know how it goes, thanks! |
I'll give it a try, but is installing and running a Ruby gem the only option here? I've previously used a workflow on Travis that simply invokes the |
I think I'm missing something; the |
Any more thoughts on using the action with Python? |
Just to keep this ticket up-to-date I gave up with this action, and just used the |
@aodj dead simple approach solves the issue. Which raises an important question; how come the official version from the company itself, does not work? |
However, running just |
This probably should be re-opened or at-least put instructions for Python integration upfront in README. |
Running just
@hakonanes, There's also |
if nickmerwin/node-coveralls#243 gets merged - i have a simple pr to add pytest and coverage.py support |
We cannot easily use the official GitHub Action from https://github.com/marketplace/actions/coveralls-github-action because it expects its input to be in LCOV format, which is not what coverage.py emits. See coverallsapp/github-action#4 for more discussion about this. If coverallsapp/github-action#25 were merged to support the Cobertura XML format, then `coverage xml` could be used to generate that format. Since it's not, it's simplest to just install the Python client for coveralls from PyPI.
We cannot easily use the official GitHub Action from https://github.com/marketplace/actions/coveralls-github-action because it expects its input to be in LCOV format, which is not what coverage.py emits. See coverallsapp/github-action#4 for more discussion about this. If coverallsapp/github-action#25 were merged to support the Cobertura XML format, then `coverage xml` could be used to generate that format. Since it's not, it's simplest to just install the Python client for coveralls from PyPI.
We cannot easily use the official GitHub Action from https://github.com/marketplace/actions/coveralls-github-action because it expects its input to be in LCOV format, which is not what coverage.py emits. See coverallsapp/github-action#4 for more discussion about this. If coverallsapp/github-action#25 were merged to support the Cobertura XML format, then `coverage xml` could be used to generate that format. Since it's not, it's simplest to just install the Python client for coveralls from PyPI.
We cannot easily use the official GitHub Action from https://github.com/marketplace/actions/coveralls-github-action because it expects its input to be in LCOV format, which is not what coverage.py emits. See coverallsapp/github-action#4 for more discussion about this. If coverallsapp/github-action#25 were merged to support the Cobertura XML format, then `coverage xml` could be used to generate that format. Since it's not, it's simplest to just install the Python client for coveralls from PyPI.
We cannot easily use the official GitHub Action from https://github.com/marketplace/actions/coveralls-github-action because it expects its input to be in LCOV format, which is not what coverage.py emits. See coverallsapp/github-action#4 for more discussion about this. If coverallsapp/github-action#25 were merged to support the Cobertura XML format, then `coverage xml` could be used to generate that format. Since it's not, it's simplest to just install the Python client for coveralls from PyPI.
For anyone following this issue, I was able to get parallel builds to work with See my workflow modification here: praw-dev/prawtools@bb0e00b Note getting this to work does depend on the changes here: https://github.com/coveralls-clients/coveralls-python/pull/216/files Edit: thanks for the correction @agonholm |
Just to un-confused others reading this: @bboe did not actually use python-coveralls (which is a separate client for coveralls.io), but a modified version of coveralls-python (available as coveralls on the PyPI). This combination worked for me too. Let's hope the PR gets merged. |
* add test workflow * fix lint workflow triggered twice * fix env file not found * pytest output in colors * custom matrix builds * add xarray-dev and attrs-dev to test matrix * add coveralls * fix if line * try fix coverage data sent to coveralls * use python-coveralls instead of the github action see coverallsapp/github-action#4 (comment) * run coveralls only for py37 environment * build only docs on travis * install pytest-cov and converalls using conda * try fix coveralls command not found * add doc workflow * switch to codecov * add codecov config * codecov comment still shown? * use codecov action * update badges * update release notes * remove travis yaml * gitignore mypy cache
@bboe has your PR actually been merged? I tried with coveralls 2.0.0 and, unlike your version, it didn't work without using the coveralls token instead of the github token due to the 422 Unprocessable Entity error which is mentioned in the docs. And then, trying to use the official action to finish the parallel build, it fails due to an error like |
I'm getting the same error even with the exact same version I used to use before, so I'm guessing something has changed upstream. Now I have absolutely no clue how to get this to work. |
looks like https://github.com/AndreMiras/coveralls-python-action is a viable replacement for |
per coverallsapp/github-action#4 (comment) The PyPI CLI doesn't work. Python 2 with coveralls 1.11 just produces a 422 error. Python 3 with 2.2 produces an error on a retry after a 422. File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/coveralls/cli.py", line 85, in main result = coverallz.wear() File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/coveralls/api.py", line 225, in wear self.config['service_job_id'], random.randint(0, sys.maxsize)) KeyError: 'service_job_id'
TODO: Needs more troubleshooting: - Official coveralls action does not seem to work well for Python coverallsapp/github-action#4 coverallsapp/github-action#30 - Official coveralls cli triggers 500 on coveralls.io - Inofficial coveralls action seems to correctly talk to the API but has issues finding the coverage data in the tests folder, or the corresponding code. https://github.com/AndreMiras/coveralls-python-action
TODO: Needs more troubleshooting: - Official coveralls action does not seem to work well for Python coverallsapp/github-action#4 coverallsapp/github-action#30 - Official coveralls cli triggers 500 on coveralls.io - Inofficial coveralls action seems to correctly talk to the API but has issues finding the coverage data in the tests folder, or the corresponding code. https://github.com/AndreMiras/coveralls-python-action
TODO: Needs more troubleshooting: - Official coveralls action does not seem to work well for Python coverallsapp/github-action#4 coverallsapp/github-action#30 - Official coveralls cli triggers 500 on coveralls.io - Inofficial coveralls action seems to correctly talk to the API but has issues finding the coverage data in the tests folder, or the corresponding code. https://github.com/AndreMiras/coveralls-python-action
Does not work yet! TODO: Troubleshoot - Official coveralls action does not seem to work well for Python coverallsapp/github-action#4 coverallsapp/github-action#30 - Inofficial coveralls action seems to correctly talk to the API but has issues finding the coverage data in the tests folder, or rather the corresponding code. https://github.com/AndreMiras/coveralls-python-action - Official coveralls cli tool (see travis) triggers 500 on coveralls.io
Re-add coverage publishing on coveralls.io, formerly performed by Travis CI (prior to theupdateframework#1242), using the coveralls cli tool according to the documentation: https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-gotcha **Considered alternatives:** - Official coveralls GitHub action, which does not seem to work well for Python: coverallsapp/github-action#4 coverallsapp/github-action#30 - Inofficial fork of that action, which seems to work better but had issues finding the coverage data in the tests folder, or the covered code respectively. https://github.com/AndreMiras/coveralls-python-action Besides aforementioned issues of these actions the use of cli tools from curated package managers seems slightly preferable over actions from the GitHub Marketplace (see theupdateframework#1246). Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
According to coverallsapp/github-action#4 (comment), this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action.
According to coverallsapp/github-action#4 (comment), this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action.
According to coverallsapp/github-action#4 (comment), this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action.
According to coverallsapp/github-action#4 (comment), this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action.
According to coverallsapp/github-action#4 (comment), this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action.
According to coverallsapp/github-action#4 (comment), this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action.
* creating test.yml still need to add test changes for this to work * testing addition of coveralls * add coveralls token * edit token * edit token 2 * migrate to GitHub Actions secrets * remove duplicate testing on push and PR * Test new Coveralls set up Using similar set up as to [here](https://github.com/marketplace/actions/coveralls-github-action) * removing `flag-name` input * Remove .coveralls.yml * GA: Remove Python 3.6 from the build matrix Otherwise, scipy returns this error during installation: RuntimeError: Python version >= 3.7 required. * GA: Use nose to run the tests * Use AndreMiras' version of Coveralls action According to coverallsapp/github-action#4 (comment), this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action. * Remove .travis.yml * Add relative_files = True in .coveragerc * GA: Ignore Python 3.7 on Windows * Remove unused coveralls lib * Remove pytest * Add comment for running performance test Co-authored-by: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Co-authored-by: Matt McKay <mamckay@gmail.com>
Re-add coverage publishing on coveralls.io, formerly performed by Travis CI (prior to theupdateframework#1242), using the coveralls cli tool according to the documentation: https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-gotcha **Considered alternatives:** - Official coveralls GitHub action, which does not seem to work well for Python: coverallsapp/github-action#4 coverallsapp/github-action#30 - Inofficial fork of that action, which seems to work better but had issues finding the coverage data in the tests folder, or the covered code respectively. https://github.com/AndreMiras/coveralls-python-action Besides aforementioned issues of these actions the use of cli tools from curated package managers seems slightly preferable over actions from the GitHub Marketplace (see theupdateframework#1246). Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Did something change recently? This workflow was working with coveralls as of 12/14/2020 (build), yet now it does not?
|
Re-add coverage publishing on coveralls.io, formerly performed by Travis CI (prior to theupdateframework#1242), using the coveralls cli tool according to the documentation: https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-gotcha **Considered alternatives:** - Official coveralls GitHub action, which does not seem to work well for Python: coverallsapp/github-action#4 coverallsapp/github-action#30 - Inofficial fork of that action, which seems to work better but had issues finding the coverage data in the tests folder, or the covered code respectively. https://github.com/AndreMiras/coveralls-python-action Besides aforementioned issues of these actions the use of cli tools from curated package managers seems slightly preferable over actions from the GitHub Marketplace (see theupdateframework#1246). Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
… not work for Python (see coverallsapp/github-action#4).
* add test workflow * fix lint workflow triggered twice * fix env file not found * pytest output in colors * custom matrix builds * add xarray-dev and attrs-dev to test matrix * add coveralls * fix if line * try fix coverage data sent to coveralls * use python-coveralls instead of the github action see coverallsapp/github-action#4 (comment) * run coveralls only for py37 environment * build only docs on travis * install pytest-cov and converalls using conda * try fix coveralls command not found * add doc workflow * switch to codecov * add codecov config * codecov comment still shown? * use codecov action * update badges * update release notes * remove travis yaml * gitignore mypy cache
removed generated lib folder
This works for me:
|
Hi @scottgigante. Just FYI for anyone else reading: You are correct about those environment variables. Due to the nature of GitHub App authentication, the Coveralls GitHub Action is the only Coveralls integration that must use the repo's GitHub token, rather than its Coveralls-assigned repo token, to identify the repo to the Coveralls API. The way to "trick" GitHub Actions into doing the same for other integrations is to pass In other words, the Coveralls API thinks you're using the Coveralls GitHub Action and uses the GitHub token to ID your repo. Note that |
I was just looking into this for use in the GitHub actions beta, and covering my Python code, but it looks like the coverage tooling for Python doesn't support
lcov
output (ie runningcoverage.py
viapytest-cov
onpytest
unittests).I know that the
coveralls
Python library can interface with the coveralls.io API, so I'm curious what the suggested solution might be.Any ideas?
The text was updated successfully, but these errors were encountered: