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

Fix/change deprecated function calls #473

Merged
merged 7 commits into from
Mar 21, 2017
Merged

Fix/change deprecated function calls #473

merged 7 commits into from
Mar 21, 2017

Conversation

MSeifert04
Copy link
Contributor

@MSeifert04 MSeifert04 commented Mar 16, 2017

This fixes all deprecations (including python 3.6 deprecations) encountered in the test suite.

However locally I get a lot of

________________ [doctest] docs/ccdproc/reduction_toolbox.rst _________________
_pytest.runner:149: in __init__
    ???
_pytest.runner:137: in <lambda>
    ???
_pytest.vendored_packages.pluggy:724: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
_pytest.vendored_packages.pluggy:338: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
_pytest.vendored_packages.pluggy:333: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
_pytest.vendored_packages.pluggy:595: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
_pytest.vendored_packages.pluggy:253: in _wrapped_call
    return call_outcome.get_result()
_pytest.vendored_packages.pluggy:278: in get_result
    raise ex[1].with_traceback(ex[2])
_pytest.vendored_packages.pluggy:264: in __init__
    self.result = func()
_pytest.vendored_packages.pluggy:596: in execute
    res = hook_impl.function(*args)
_pytest.runner:90: in pytest_runtest_call
    ???
C:\...\lib\site-packages\astropy-2.0.dev17912-py3.5-win-amd64.egg\astropy\tests\pytest_plugins.py:204: in runtest
    raise_on_error=True, verbose=False, encoding='utf-8')
C:\...\lib\doctest.py:2065: in testfile
    runner.run(test)
C:\...\lib\doctest.py:1830: in run
    r = DocTestRunner.run(self, test, compileflags, out, False)
C:\...\lib\doctest.py:1453: in run
    self.debugger = _OutputRedirectingPdb(save_stdout)
C:\...\lib\doctest.py:357: in __init__
    pdb.Pdb.__init__(self, stdout=out, nosigint=True)
C:\...\lib\pdb.py:153: in __init__
    import readline
C:\...\lib\site-packages\readline.py:34: in <module>
    rl = Readline()
C:\...\lib\site-packages\pyreadline\rlmain.py:422: in __init__
    BaseReadline.__init__(self)
C:\...\lib\site-packages\pyreadline\rlmain.py:65: in __init__
    self.read_inputrc()
C:\...\lib\site-packages\pyreadline\rlmain.py:404: in read_inputrc
    if os.path.isfile(inputrcpath):
C:\...\lib\genericpath.py:30: in isfile
    st = os.stat(path)
E   DeprecationWarning: The Windows bytes API has been deprecated, use Unicode filenames instead

So while it's (probably) good to fix the deprecations I personally wouldn't want that setting to be activated by default.

@MSeifert04 MSeifert04 added this to the 1.2.1 milestone Mar 16, 2017
@MSeifert04
Copy link
Contributor Author

MSeifert04 commented Mar 16, 2017

I undid the enable_deprecations_as_exceptions option again. It's really annoying to have all these failures locally. 😄 Is it possible to "activate" it on a test-basis rather than as config? Something like using python setup.py test --deprecations?

@MSeifert04 MSeifert04 changed the title [Do not merge] Enable deprecation-checks and fix them Fix/change deprecated function calls Mar 18, 2017
@mwcraig
Copy link
Member

mwcraig commented Mar 19, 2017

I don't know that there is a command line option for it...could see it being handy, though.

Ottherwise, the changes look good.

Copy link
Member

@mwcraig mwcraig left a comment

Choose a reason for hiding this comment

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

I think this is ready to go, feel free to merge at will. The only I haven't yet is to make sure there are not additional rebases required for some of the other open PRs.

@bsipocz
Copy link
Member

bsipocz commented Mar 21, 2017

@MSeifert04 - I'm sure you can propose something like --deprecations to the testing mechanism that will simply override the enable_deprecations_as_exceptions option from the config file.

@MSeifert04
Copy link
Contributor Author

@bsipocz Is that astropy, astropy-helpers or should that rather be a seperate pytest plugin package (as I understand there's some effort to split them out of astropy)?

@crawfordsm crawfordsm merged commit 5022226 into astropy:master Mar 21, 2017
@crawfordsm
Copy link
Member

Merging, and I'd suggest adding an issue int he appropriate place about the deprecations.

@MSeifert04 MSeifert04 deleted the test_for_deprecations branch March 21, 2017 18:33
@bsipocz
Copy link
Member

bsipocz commented Mar 21, 2017

@MSeifert04 - At the moment the testing lives in astropy core. You're right that there are plans to move everything out in a separate package, but that shouldn't be a show stopper for any enhancement, as it may or may not happen during the summer.

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.

4 participants