Skip to content

Cleanups. #11566

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

Merged
merged 1 commit into from
Jul 4, 2018
Merged

Cleanups. #11566

merged 1 commit into from
Jul 4, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 3, 2018

  • faulthandler is present in all versions of Python we support; no need
    for try... except ImportError anymore.
  • LooseVersions can directly be compared to strings (it casts the other
    argument to a LooseVersion).
  • Move the gi+cairocffi incompatibility check (duplicated between
    backend_gtk3agg and backend_gtk3cairo) to the common _gtk3_compat.
  • Replace HAS_CAIRO_CFFI with checking cairo.__name__, which is
    consistent with e.g. the check on gi.__name__.
  • Inline the (single-used, internal) pilread (I think the new version is
    also more readable as we don't need to handle None as special value).
  • Replace HAS_NATGRID by pytest.importorskip.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@@ -1417,19 +1417,15 @@ def tk_window_focus():


def _init_tests():
try:
# CPython's faulthandler since v3.6 handles exceptions on Windows
Copy link
Member

Choose a reason for hiding this comment

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

I'm not fully grokking this, but I thought we were supporting 3.5 for the next release...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but why does the comment make reference to "since v3.6"?

Copy link
Member

Choose a reason for hiding this comment

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

It exists on all version (so we don't need the import check), but still need the version check to know if we want to use it on windows or not.

Copy link
Contributor

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

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

Pending CI.

@tacaswell tacaswell added this to the v3.0 milestone Jul 4, 2018
- faulthandler is present in all versions of Python we support; no need
  for `try... except ImportError` anymore.
- LooseVersions can directly be compared to strings (it casts the other
  argument to a LooseVersion).
- Move the gi+cairocffi incompatibility check (duplicated between
  backend_gtk3agg and backend_gtk3cairo) to the common _gtk3_compat.
- Replace HAS_CAIRO_CFFI with checking `cairo.__name__`, which is
  consistent with e.g. the check on `gi.__name__`.
- Inline the (single-used, internal) pilread (I think the new version is
  also more readable as we don't need to handle None as special value).
- Replace HAS_NATGRID by pytest.importorskip.
@jklymak jklymak merged commit 40b51d5 into matplotlib:master Jul 4, 2018
@anntzer anntzer deleted the morecleanups branch February 19, 2022 20:03
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

Successfully merging this pull request may close these issues.

4 participants