Skip to content

Conversation

@dopplershift
Copy link
Contributor

This works by using matplotlib's "experimental" support for switching
backends, and should only be used to switch between image backends.

baseline_remote = baseline_dir.startswith('http')

with plt.style.context(style):
with plt.style.context(style), switch_backend(backend):
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dopplershift looks like this is causing issues with Python 2.6. Does Matplotlib still support Python 2.6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only on the 1.4 series--so I guess the question is when does pytest-mpl drop 1.4?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Now 2.0 is out, I'd be fine with dropping 1.4 (I normally like keeping compatibility with the latest two versions)

@dopplershift
Copy link
Contributor Author

I've gone ahead and removed all traces of Python 2.6 and Matplotlib 1.4--I'm hoping that's what you were looking for.

Rebased on latest master.

@dopplershift dopplershift force-pushed the set-backend branch 2 times, most recently from cb9ff8e to f4a588e Compare February 1, 2017 00:35
@dopplershift
Copy link
Contributor Author

This isn't introducing any new test failures. Apparently, something's not quite right with testing against matplotlib 2.0.

@astrofrog
Copy link
Collaborator

@dopplershift - can you rebase on the latest master? (I've merged in changes that should fix Travis)

@dopplershift
Copy link
Contributor Author

Linux tests are failing because conda can't find packages for numpy 1.9 and matplotlib 1.5. Thoughts?

@dopplershift
Copy link
Contributor Author

Anything more you'd like to see here?

.travis.yml Outdated
- PYTHON_VERSION=3.3 MATPLOTLIB_VERSION=1.4 NUMPY_VERSION=1.9
- PYTHON_VERSION=3.4 MATPLOTLIB_VERSION=1.4 NUMPY_VERSION=1.9
- PYTHON_VERSION=3.3 MATPLOTLIB_VERSION=1.5 NUMPY_VERSION=1.9
- PYTHON_VERSION=3.4 MATPLOTLIB_VERSION=1.5 NUMPY_VERSION=1.9
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dopplershift - try not pinnng the Numpy version here

@dopplershift
Copy link
Contributor Author

No conda packages for Python 3.3 for matplotlib 1.5. Willing to drop Python 3.3? We'd still have the last 3 versions of the 3.x series.

@bsipocz
Copy link
Contributor

bsipocz commented Feb 22, 2017

@dopplershift - You can always move mpl from CONDA_DEPENDENCIES to PIP_DEPENDENCIES for the py3.3 run.

@dopplershift
Copy link
Contributor Author

True, but probably best to make a firm decision on 3.3 support, or at least testing for it.

@astrofrog
Copy link
Collaborator

Does Matplotlib support 3.3?

@dopplershift
Copy link
Contributor Author

As far back as 1.5, matplotlib is >= 3.4: http://matplotlib.org/1.5.3/users/installing.html

@astrofrog
Copy link
Collaborator

Ok then yes let's drop 3.3

@dopplershift
Copy link
Contributor Author

All testing passing now.

@dopplershift
Copy link
Contributor Author

Are we waiting on anything here?

@astrofrog
Copy link
Collaborator

(on vacation but will review/merge on my return!)

@jnothman
Copy link
Contributor

Since #47, plt and matplotlib are only available locally, so there's a logical merge conflict in this PR.

Since matplotlib is only imported locally now, the user at least has the option to import matplotlib globally and set the backend once as a fixture, prior to it being imported by pytest-mpl.

I also wonder if we can more generally allow the user to specify arguments for mpl.rc_context here... But I assume switch_backend is necessary regardless of rc in order for an already imported pyplot to behave.

@astrofrog
Copy link
Collaborator

@dopplershift - this looks good, but as @jnothman pointed out this won't work as-is due to #47, so could you rebase and make sure that the tests pass locally?

dopplershift and others added 6 commits March 16, 2017 12:40
This works by using matplotlib's "experimental" support for switching
backends, and should only be used to switch between image backends.
Matplotlib only has 1.4 wheels for that, which we're removing here.
Conda doesn't have packages for that combination.
Matplotlib >= 1.5 only supports Python >= 3.4, so given we've dropped
matplotlib 1.4, it doesn't make sense to support 3.3.
@dopplershift
Copy link
Contributor Author

Rebased and tests pass locally.

@dopplershift
Copy link
Contributor Author

Looks like we're good here.

@astrofrog astrofrog merged commit 73e55f6 into matplotlib:master Mar 17, 2017
@astrofrog
Copy link
Collaborator

Thanks @dopplershift!

@dopplershift dopplershift deleted the set-backend branch March 17, 2017 14:02
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