Skip to content

Conversation

@astrofrog
Copy link
Member

Fixes paths in .coverage file in Python 3 like we do in Python 2, otherwise coverage reporting to e.g. coveralls does not work in Python 3. This will not work in Python 3 for packages that still use 2to3, but this never worked anyway since the temporary files got deleted before.

This should fix astropy/package-template#151

…e coverage reporting does not work in Python 3. This will not work in Python 3 for packages that still use 2to3, but this never worked anyway since the temporary files got deleted before.
@astrofrog
Copy link
Member Author

I'm also enabling coverage testing on Python 3 in the .travis.yml file to make sure that things work correctly (this is still back-portable to 1.0.x)

@astrofrog astrofrog force-pushed the fix-coverage-py3 branch from 0dad9ec to 52731e9 Compare May 1, 2016 15:59
@astrofrog
Copy link
Member Author

@astropy/astropy-core-maintainers - this is now ready for review. However, the Travis build on which I enabled Python 3 coverage testing goes from 8 minutes to 24 minutes. I've opened an issue to remind us to investigate why running with coverage testing is so much slower on Python 3 (#4826).

If people are opposed to the increase in testing time, I can disable the Python 3 coverage testing again? (at least we know it works now)

@mhvk
Copy link
Contributor

mhvk commented May 1, 2016

@astrofrog - great that it now works well on python3! I think we should definitely opt for either python2 or python3 for coverage, not do both. My sense would be to stick to python2 until we figure out why python3 takes so much longer, i.e., I would suggest not to make the change to .travis.yml.

@astrofrog
Copy link
Member Author

@mhvk - sounds good - I just wanted to make the change as part of this PR to make sure it works, but happy to remove it.

@pllim
Copy link
Member

pllim commented May 2, 2016

Hmm. Does it also take 24 minutes locally? If so, maybe profiling can pinpoint where it is so slow.

.travis.yml Outdated
CFLAGS='-ftest-coverage -fprofile-arcs -fno-inline-functions -O0'
- os: linux
env: PYTHON_VERSION=3.4 SETUP_CMD='test'
env: PYTHON_VERSION=3.4 SETUP_CMD='test --coverage'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not 3.5?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just left it as-is for now, I think that should be changed in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also wondering if it is also slow in Python 3.5 or just 3.4.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see what you mean - it's slow on Python 3.5 too (I see it locally)

@astrofrog
Copy link
Member Author

@pllim - yes, it also takes a while locally, for me at least. I'm not sure on the best way to profile the tests because it seems to be an issue that occurs only when the coverage testing is working, so it's not just about profiling individual astropy functions or operations. I don't really have time to look into it now, but we should discuss it in #4826

@astrofrog astrofrog force-pushed the fix-coverage-py3 branch from 52731e9 to 1776889 Compare May 2, 2016 17:44
astrofrog added 2 commits May 2, 2016 18:44
…thon 3 we run into issues, since we are modifying the dictionary on-the-fly, and this causes some of the keys to not be iterated over. For Python 2, this means taking an unnecessary copy, but this is not a performance-critical loop.
@astrofrog
Copy link
Member Author

astrofrog commented May 2, 2016

I've now removed the commit that changed the .travis.yml file, so this can be merged once people are happy with it, and we can enable the coverage testing in future once we've solved #4826.

@mhvk
Copy link
Contributor

mhvk commented May 2, 2016

@astrofrog - OK, let's move over to trying to figure out why coverage is so much slower on python3. Merging this aspect so that testing can be done on master!

@mhvk mhvk self-assigned this May 2, 2016
@mhvk mhvk merged commit 06544d4 into astropy:master May 2, 2016
astrofrog pushed a commit that referenced this pull request May 16, 2016
Fix paths in .coverage file in Python 3
astrofrog pushed a commit that referenced this pull request May 16, 2016
Fix paths in .coverage file in Python 3
astrofrog pushed a commit that referenced this pull request May 16, 2016
Fix paths in .coverage file in Python 3
@astrofrog astrofrog deleted the fix-coverage-py3 branch July 5, 2016 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup.py test --coverage fails to find source files on python 3 if run on Travis ...

3 participants