[Matplotlib-devel] mpl_cairo manylinux wheel available

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[Matplotlib-devel] mpl_cairo manylinux wheel available

anntzer.lee
Hi all,
A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is now available (under GitHub releases).  mpl_cairo is a new, cairo-based backend for Matplotlib, that offers several improvements over the current default, Agg-based backend.  See the README on GitHub for more details :-)
I would be interested in hearing your feedback.
Antony

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

Matthew Brett
On Sat, Sep 16, 2017 at 10:10 AM, Antony Lee <[hidden email]> wrote:
> Hi all,
> A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is
> now available (under GitHub releases).  mpl_cairo is a new, cairo-based
> backend for Matplotlib, that offers several improvements over the current
> default, Agg-based backend.  See the README on GitHub for more details :-)
> I would be interested in hearing your feedback.

Nice!  Any plans for an OSX build?  Or are they hard?

Cheers,

Matthew
_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

anntzer.lee
I don't think that would be particularly hard (there isn't anything really specific to Linux in the code, AFAICT), but I don't have access to an OSX machine with a C++ compiler capable of compiling C++17.  <wink>
Antony

2017-09-16 2:43 GMT-07:00 Matthew Brett <[hidden email]>:
On Sat, Sep 16, 2017 at 10:10 AM, Antony Lee <[hidden email]> wrote:
> Hi all,
> A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is
> now available (under GitHub releases).  mpl_cairo is a new, cairo-based
> backend for Matplotlib, that offers several improvements over the current
> default, Agg-based backend.  See the README on GitHub for more details :-)
> I would be interested in hearing your feedback.

Nice!  Any plans for an OSX build?  Or are they hard?

Cheers,

Matthew


_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

Neal Becker
In reply to this post by Matthew Brett
Matthew Brett wrote:

> On Sat, Sep 16, 2017 at 10:10 AM, Antony Lee
> <[hidden email]> wrote:
>> Hi all,
>> A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is
>> now available (under GitHub releases).  mpl_cairo is a new, cairo-based
>> backend for Matplotlib, that offers several improvements over the current
>> default, Agg-based backend.  See the README on GitHub for more details
>> :-) I would be interested in hearing your feedback.
>
> Nice!  Any plans for an OSX build?  Or are they hard?
>
> Cheers,
>
> Matthew
I'm interested in trying this on Fedora linux - but I don't want to use
anaconda.  Any suggestions?

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

Antony Lee
Yes, you can use this without conda (I usually don't use conda, it's just an easy way for me to make sure people can install pycairo...).

There are two possibilites: compile the package yourself, or use the wheel available under github releases.  In either case you need to install Matplotlib with PR#8771 (so I'd suggest doing this in a venv); there are (fairly standard) instructions for this in the README or in Matplotlib's devdocs.  Assuming that you have installed the patched Matplotlib, you can now do one of the following:

1. Compile the package yourself

According to pkgs.org,
  - g++ 7.1 is available in Fedora 26.
  - pycairo>=1.12 ("python3-cairo") is only available in Fedora Rawhide (Fedora 26 has pycairo 1.10).

If you can install these dependencies, you should be able to just do the standard `pip install .` or `pip install -e .` (in the same environment as the patched Matplotlib) and you're good to go.

If you're stuck on Fedora 26, it looks like that version has cairo 1.14 (which is what we *really* care about).  So you should be able to get away with installing the latest pycairo and cairo (1.14), and manually removing the dependency on pycairo>=1.12 in mpl_cairo's setup.py.

2. Use the compiled wheel.

Basically everything under the "Installation (Linux only)" example still applies -- just replace the invocation of conda with your dnf (and the appropriate package names).  However in that case you will not be able to edit the dependency in the wheel (which, again, requires pycairo>=1.12).  Let me know if this is the case, if so then I will build a wheel with a lower dependency bound.

Antony

2017-09-17 8:26 GMT-07:00 Neal Becker <[hidden email]>:
Matthew Brett wrote:

> On Sat, Sep 16, 2017 at 10:10 AM, Antony Lee
> <[hidden email]> wrote:
>> Hi all,
>> A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is
>> now available (under GitHub releases).  mpl_cairo is a new, cairo-based
>> backend for Matplotlib, that offers several improvements over the current
>> default, Agg-based backend.  See the README on GitHub for more details
>> :-) I would be interested in hearing your feedback.
>
> Nice!  Any plans for an OSX build?  Or are they hard?
>
> Cheers,
>
> Matthew
I'm interested in trying this on Fedora linux - but I don't want to use
anaconda.  Any suggestions?

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel


_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

Antony Lee
(or actually, in the last case, you can just install with pip install --no-deps, which will also bypass the version check).
Antony

2017-09-17 13:20 GMT-07:00 Antony Lee <[hidden email]>:
Yes, you can use this without conda (I usually don't use conda, it's just an easy way for me to make sure people can install pycairo...).

There are two possibilites: compile the package yourself, or use the wheel available under github releases.  In either case you need to install Matplotlib with PR#8771 (so I'd suggest doing this in a venv); there are (fairly standard) instructions for this in the README or in Matplotlib's devdocs.  Assuming that you have installed the patched Matplotlib, you can now do one of the following:

1. Compile the package yourself

According to pkgs.org,
  - g++ 7.1 is available in Fedora 26.
  - pycairo>=1.12 ("python3-cairo") is only available in Fedora Rawhide (Fedora 26 has pycairo 1.10).

If you can install these dependencies, you should be able to just do the standard `pip install .` or `pip install -e .` (in the same environment as the patched Matplotlib) and you're good to go.

If you're stuck on Fedora 26, it looks like that version has cairo 1.14 (which is what we *really* care about).  So you should be able to get away with installing the latest pycairo and cairo (1.14), and manually removing the dependency on pycairo>=1.12 in mpl_cairo's setup.py.

2. Use the compiled wheel.

Basically everything under the "Installation (Linux only)" example still applies -- just replace the invocation of conda with your dnf (and the appropriate package names).  However in that case you will not be able to edit the dependency in the wheel (which, again, requires pycairo>=1.12).  Let me know if this is the case, if so then I will build a wheel with a lower dependency bound.

Antony

2017-09-17 8:26 GMT-07:00 Neal Becker <[hidden email]>:
Matthew Brett wrote:

> On Sat, Sep 16, 2017 at 10:10 AM, Antony Lee
> <[hidden email]> wrote:
>> Hi all,
>> A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is
>> now available (under GitHub releases).  mpl_cairo is a new, cairo-based
>> backend for Matplotlib, that offers several improvements over the current
>> default, Agg-based backend.  See the README on GitHub for more details
>> :-) I would be interested in hearing your feedback.
>
> Nice!  Any plans for an OSX build?  Or are they hard?
>
> Cheers,
>
> Matthew
I'm interested in trying this on Fedora linux - but I don't want to use
anaconda.  Any suggestions?

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel



_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

Francesco Faccenda
In reply to this post by anntzer.lee
This is a good news, thank you. I have two main doubts now:
  1. Would it be hard to have a Windows version of it? Since I am quite new to this, I'm not sure how to do it myself. Is there a good tutorial you would suggest?
  2. Would it work with matplotlib embedded on a wxpython stage or I'm going to run in some issue if I use this backend?

Regards,
Francesco Faccenda


2017-09-16 11:10 GMT+02:00 Antony Lee <[hidden email]>:
Hi all,
A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is now available (under GitHub releases).  mpl_cairo is a new, cairo-based backend for Matplotlib, that offers several improvements over the current default, Agg-based backend.  See the README on GitHub for more details :-)
I would be interested in hearing your feedback.
Antony

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel



_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

anntzer.lee
Hi,

I looked into compiling on Windows yesterday and it appears that MSVC does not support yet all the required C++17 features (at least, guaranteed copy elision and template argument deduction for class templates -- see https://blogs.msdn.microsoft.com/vcblog/2017/08/11/c17-features-and-stl-fixes-in-vs-2017-15-3/).  From some quick googling, it is apparently expected that full support will happen "soon" (before the end of 2017) so I may decide to just wait for it rather than downgrade the code (depending on how much time I want to spend on this...) but as a consequence, tinkering with mplcairo on Windows would right now require not only good familiarity with how to compile extension modules on Windows, but also with C++ to understand how to downgrade the code, so overall it may be quite tricky for you.

Wx support would require refactoring the wx backend code so that the rendering part gets strictly decoupled from the windowing part -- this is e.g. the purpose of PR#8771 that does the same for Qt.  Actually, given that Wx already supports both "native" Wx rendering and Agg rendering, I expect this to be "relatively" easy, as the separation already mostly exists (basically we need to replace mentions of Agg by cairo in backend_wxagg.py).  As always, PRs would be welcome.

Antony

2017-09-18 2:06 GMT-07:00 Francesco Faccenda <[hidden email]>:
This is a good news, thank you. I have two main doubts now:
  1. Would it be hard to have a Windows version of it? Since I am quite new to this, I'm not sure how to do it myself. Is there a good tutorial you would suggest?
  2. Would it work with matplotlib embedded on a wxpython stage or I'm going to run in some issue if I use this backend?

Regards,
Francesco Faccenda


2017-09-16 11:10 GMT+02:00 Antony Lee <[hidden email]>:
Hi all,
A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is now available (under GitHub releases).  mpl_cairo is a new, cairo-based backend for Matplotlib, that offers several improvements over the current default, Agg-based backend.  See the README on GitHub for more details :-)
I would be interested in hearing your feedback.
Antony

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel




_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

anntzer.lee
{ https://github.com/matplotlib/matplotlib/pull/9202 + mplcairo master } now implement a wx-cairo backend.
Antony

2017-09-18 8:46 GMT-07:00 Antony Lee <[hidden email]>:
Hi,

I looked into compiling on Windows yesterday and it appears that MSVC does not support yet all the required C++17 features (at least, guaranteed copy elision and template argument deduction for class templates -- see https://blogs.msdn.microsoft.com/vcblog/2017/08/11/c17-features-and-stl-fixes-in-vs-2017-15-3/).  From some quick googling, it is apparently expected that full support will happen "soon" (before the end of 2017) so I may decide to just wait for it rather than downgrade the code (depending on how much time I want to spend on this...) but as a consequence, tinkering with mplcairo on Windows would right now require not only good familiarity with how to compile extension modules on Windows, but also with C++ to understand how to downgrade the code, so overall it may be quite tricky for you.

Wx support would require refactoring the wx backend code so that the rendering part gets strictly decoupled from the windowing part -- this is e.g. the purpose of PR#8771 that does the same for Qt.  Actually, given that Wx already supports both "native" Wx rendering and Agg rendering, I expect this to be "relatively" easy, as the separation already mostly exists (basically we need to replace mentions of Agg by cairo in backend_wxagg.py).  As always, PRs would be welcome.

Antony

2017-09-18 2:06 GMT-07:00 Francesco Faccenda <[hidden email]>:
This is a good news, thank you. I have two main doubts now:
  1. Would it be hard to have a Windows version of it? Since I am quite new to this, I'm not sure how to do it myself. Is there a good tutorial you would suggest?
  2. Would it work with matplotlib embedded on a wxpython stage or I'm going to run in some issue if I use this backend?

Regards,
Francesco Faccenda


2017-09-16 11:10 GMT+02:00 Antony Lee <[hidden email]>:
Hi all,
A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is now available (under GitHub releases).  mpl_cairo is a new, cairo-based backend for Matplotlib, that offers several improvements over the current default, Agg-based backend.  See the README on GitHub for more details :-)
I would be interested in hearing your feedback.
Antony

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel





_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

Francesco Faccenda
Thank you Antony for your effort and for such good news. I'm looking forward to the MSVC full support. In the meanwhile I'll take a look on the wx-cairo implementation.
Please, let us know any update about this subject, it would be very appreciable.

Best regards,
Francesco Faccenda

2017-09-19 6:26 GMT+02:00 Antony Lee <[hidden email]>:
{ https://github.com/matplotlib/matplotlib/pull/9202 + mplcairo master } now implement a wx-cairo backend.
Antony

2017-09-18 8:46 GMT-07:00 Antony Lee <[hidden email]>:
Hi,

I looked into compiling on Windows yesterday and it appears that MSVC does not support yet all the required C++17 features (at least, guaranteed copy elision and template argument deduction for class templates -- see https://blogs.msdn.microsoft.com/vcblog/2017/08/11/c17-features-and-stl-fixes-in-vs-2017-15-3/).  From some quick googling, it is apparently expected that full support will happen "soon" (before the end of 2017) so I may decide to just wait for it rather than downgrade the code (depending on how much time I want to spend on this...) but as a consequence, tinkering with mplcairo on Windows would right now require not only good familiarity with how to compile extension modules on Windows, but also with C++ to understand how to downgrade the code, so overall it may be quite tricky for you.

Wx support would require refactoring the wx backend code so that the rendering part gets strictly decoupled from the windowing part -- this is e.g. the purpose of PR#8771 that does the same for Qt.  Actually, given that Wx already supports both "native" Wx rendering and Agg rendering, I expect this to be "relatively" easy, as the separation already mostly exists (basically we need to replace mentions of Agg by cairo in backend_wxagg.py).  As always, PRs would be welcome.

Antony

2017-09-18 2:06 GMT-07:00 Francesco Faccenda <[hidden email]>:
This is a good news, thank you. I have two main doubts now:
  1. Would it be hard to have a Windows version of it? Since I am quite new to this, I'm not sure how to do it myself. Is there a good tutorial you would suggest?
  2. Would it work with matplotlib embedded on a wxpython stage or I'm going to run in some issue if I use this backend?

Regards,
Francesco Faccenda


2017-09-16 11:10 GMT+02:00 Antony Lee <[hidden email]>:
Hi all,
A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is now available (under GitHub releases).  mpl_cairo is a new, cairo-based backend for Matplotlib, that offers several improvements over the current default, Agg-based backend.  See the README on GitHub for more details :-)
I would be interested in hearing your feedback.
Antony

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel






_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

Chris Barker - NOAA Federal
In reply to this post by Francesco Faccenda
On Mon, Sep 18, 2017 at 2:06 AM, Francesco Faccenda <[hidden email]> wrote:

  1. Would it work with matplotlib embedded on a wxpython stage or I'm going to run in some issue if I use this backend?\
This from the README:

The backend can be selected by setting the MPLBACKEND environment variable to one of

  • module://mplcairo.qt (Qt5 widget, copying data from a cairo image surface),
  • module://mplcairo.wx (wx widget, copying data from a cairo image surface),
  • module://mplcairo.gtk3_native (GTK3 widget, directly drawn onto as a native surface),
  • module://mplcairo.base (No GUI, but can output to EPS, PDF, PS, SVG, and SVGZ using cairo's implementation, rather than Matplotlib's).
looks like wx is covered :-)

-CHB


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: mpl_cairo manylinux wheel available

anntzer.lee
In reply to this post by Matthew Brett
A friend kindly lent me their MacBook (thank you!) and I managed to build a wheel there too -- it is now uploaded (under Github releases as well), and the setup.py and instructions have been updated accordingly (TL;DR: clang 5 from homebrew works).
I only did limited testing though, and know very little about compatibility across OSX versions (all I know is that the wheel installed correctly on that laptop), so no guarantees.
Antony

2017-09-16 2:43 GMT-07:00 Matthew Brett <[hidden email]>:
On Sat, Sep 16, 2017 at 10:10 AM, Antony Lee <[hidden email]> wrote:
> Hi all,
> A manylinux wheel for mpl_cairo (https://github.com/anntzer/mpl_cairo) is
> now available (under GitHub releases).  mpl_cairo is a new, cairo-based
> backend for Matplotlib, that offers several improvements over the current
> default, Agg-based backend.  See the README on GitHub for more details :-)
> I would be interested in hearing your feedback.

Nice!  Any plans for an OSX build?  Or are they hard?

Cheers,

Matthew


_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-devel