Skip to content

Python 3.6 compatibility - #717

Merged
aphearin merged 10 commits into
astropy:masterfrom
aphearin:python_36
Mar 28, 2017
Merged

aphearin merged 10 commits into
astropy:masterfrom
aphearin:python_36

Conversation

@aphearin

Copy link
Copy Markdown
Contributor

There is only one change I am aware of that will be necessary to gain python 3.6 compatibility: math-mode docstrings need to be changed so that \\ is replaced by \, and all docstrings with such appearances need to be raw strings. I think, but I am not sure, that these changes will address all failures shared by @eteq with me in a recent bug report on v0.5rc1.

CC @bsipocz - this PR replaces your #648. Since the empirical_models.phase_space_models sub-package received such a massive overhaul with #709, I found it easier to just start over rather than rebase.

Currently I am sparing Travis some computation load by having commented out most environments while I'm working on python 3.6. These will be reinstated prior to merging this PR.

@aphearin aphearin added this to the v0.5 milestone Mar 27, 2017
@aphearin aphearin self-assigned this Mar 27, 2017
@aphearin

Copy link
Copy Markdown
Contributor Author

@bsipocz - I think I'm getting close to python 3.6 compatibility. I've reached a new error that it looks like you solved in an AstroQuery Issue,

DeprecationWarning: generator 'pytest_pycollect_makeitem' raised StopIteration

but in that Issue you say something I don't understand, "The best and easiest way to deal with it in astroquery to change this test to be pure pytest.". Can you elaborate how I should address this?

@bsipocz

bsipocz commented Mar 28, 2017

Copy link
Copy Markdown
Member

@aphearin - #648 got rebased, but is still far behind this one and less consistent with the raw strings.

The unittest issue is not yet solved in astroquery, but I'm fairly certain that it is due to some upstream pytest incompatibility with unittest on py3.6 that raises that deprecation warning.
In astroquery we will solve this by getting rid of the few tests that are using unittest by rewriting them to use pytest only (it only affects two recently added module which were mostly copied over from existing ESA software). However for halotools you may want to keep using unittest, so then you need to dig deeper and try to find the real underlying issue within pytest.

A third short term workaround would be to disable deprecation warnings that come from pytest to be raised as exceptions.

Andrew Hearin added 2 commits March 28, 2017 07:35
…redundant NUMPY_VERSION=prerelease test with python 3.5. This commit should resolve both
@aphearin

Copy link
Copy Markdown
Contributor Author

@bsipocz - I tried to mirror exactly your previous work on the .travis.yml config file in Halotools in order to set 3.6 as an "Allowed Failure". However, when I look at the Travis run displayed in https://travis-ci.org/astropy/halotools/builds/215933438, it seems that my attempt to run python 3.6 with SETUP_CMD='test' is not executing at all - there is no "Allowed Failure" section that appears in the CI build matrix. Would you mind taking a look to see where I made a mistake in writing the .travis.yml?

Comment thread .travis.yml
env: NUMPY_VERSION=prerelease SETUP_CMD='test'
# Python 3.6 currently has a DeprecationWarning related to pytest
# that we don't understand at the moment.
- python: 3.6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you need to repeat the matrix entry both in the main matrix part and using the exact setup under allow_failures.

@aphearin
aphearin merged commit c97b42c into astropy:master Mar 28, 2017
@aphearin
aphearin deleted the python_36 branch March 28, 2017 14:34
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.

2 participants