#10 [DON'T MERGE] Split python2-matplotlib from python-matplotlib
Closed 5 years ago by churchyard. Opened 5 years ago by churchyard.
rpms/ churchyard/python-matplotlib py2only  into  master

@@ -17,7 +17,7 @@ 

   

       _file = _decode_filesystem_path(__file__)

       path = os.sep.join([os.path.dirname(_file), 'mpl-data'])

- +    path = '/usr/share/matplotlib/mpl-data'

+ +    path = '/usr/share/python2-matplotlib/mpl-data'

       if os.path.isdir(path):

           return path

   
@@ -32,7 +32,7 @@ 

   

  -    - Lastly, it looks in `$MATPLOTLIBDATA/matplotlibrc` for a

  -      system-defined copy.

- +    - Lastly, it looks in `/etc/matplotlibrc` for a system-defined copy.

+ +    - Lastly, it looks in `/etc/python2-matplotlibrc` for a system-defined copy.

       """

   

       def gen_candidates():
@@ -41,7 +41,7 @@ 

               yield os.path.join(matplotlibrc, 'matplotlibrc')

           yield os.path.join(_get_configdir(), 'matplotlibrc')

  -        yield os.path.join(get_data_path(), 'matplotlibrc')

- +        yield '/etc/matplotlibrc'

+ +        yield '/etc/python2-matplotlibrc'

   

       for fname in gen_candidates():

           if os.path.exists(fname):
@@ -60,10 +60,10 @@ 

  +    if 'MATPLOTLIBDATA' in os.environ:

  +        # ... in buildroot.

  +        return os.path.join(os.environ['MATPLOTLIBDATA'],

- +                            '../../../../etc/matplotlibrc')

+ +                            '../../../../etc/python2-matplotlibrc')

  +    else:

  +        # ... on installed systems.

- +        return '/etc/matplotlibrc'

+ +        return '/etc/python2-matplotlibrc'

  +

  +

  +def test_if_rctemplate_is_up_to_date(mplrc):

python2-matplotlib.spec python-matplotlib.spec
file renamed
+41 -230
@@ -39,9 +39,9 @@ 

  %global ftver 2.8

  %endif

  

- Name:           python-matplotlib

+ Name:           python2-matplotlib

  Version:        2.2.3

- Release:        1%{?rctag:.%{rctag}}%{?dist}

+ Release:        2%{?rctag:.%{rctag}}%{?dist}

  Summary:        Python 2D plotting library

  # qt4_editor backend is MIT

  License:        Python and MIT
@@ -58,7 +58,7 @@ 

  # https://github.com/QuLogic/matplotlib/tree/fedora-patches-non-x86

  # Updated test images for new FreeType.

  Source1000:     https://github.com/QuLogic/mpl-images/archive/v%{version}-with-freetype-%{ftver}/matplotlib-%{version}-with-freetype-%{ftver}.tar.gz

- # Search in /etc/matplotlibrc:

+ # Search in /etc/python2-matplotlibrc:

  Patch1001:      0001-matplotlibrc-path-search-fix.patch

  # Image tolerances for anything but x86_64:

  Patch1002:      0002-Increase-tolerances-for-non-x86_64-arches.patch
@@ -74,19 +74,6 @@ 

  BuildRequires:  xorg-x11-server-Xvfb

  BuildRequires:  zlib-devel

  

- %description

- Matplotlib is a python 2D plotting library which produces publication

- quality figures in a variety of hardcopy formats and interactive

- environments across platforms. matplotlib can be used in python

- scripts, the python and ipython shell, web application servers, and

- six graphical user interface toolkits.

- 

- Matplotlib tries to make easy things easy and hard things possible.

- You can generate plots, histograms, power spectra, bar charts,

- errorcharts, scatterplots, etc, with just a few lines of code.

- 

- %package -n python2-matplotlib

- Summary:        Python 2D plotting library

  BuildRequires:  python2-numpy

  BuildRequires:  python2-pyparsing

  BuildRequires:  python2-dateutil
@@ -124,7 +111,7 @@ 

  Requires:       python2-dateutil

  Requires:       python2-kiwisolver

  Requires:       python2-backports-functools_lru_cache

- Requires:       python-matplotlib-data = %{version}-%{release}

+ Requires:       python2-matplotlib-data = %{version}-%{release}

  %{?backend_subpackage:Requires: python2-matplotlib-%{backend_subpackage}%{?_isa} = %{version}-%{release}}

  Recommends:     python2-pillow

  Requires:       python2-six
@@ -142,7 +129,7 @@ 

  Provides:       bundled(js-jquery1-ui) = 1.11.4

  Provides:       bundled(texlive-helvetic)

  

- %description -n python2-matplotlib

+ %description

  Matplotlib is a python 2D plotting library which produces publication

  quality figures in a variety of hardcopy formats and interactive

  environments across platforms. matplotlib can be used in python
@@ -153,8 +140,9 @@ 

  You can generate plots, histograms, power spectra, bar charts,

  errorcharts, scatterplots, etc, with just a few lines of code.

  

+ 

  %package -n python2-matplotlib-qt4

- Summary:        Qt4 backend for python-matplotlib

+ Summary:        Qt4 backend for python2-matplotlib

  BuildRequires:  PyQt4-devel

  Requires:       python2-PyQt4

  Requires:       python2-matplotlib%{?_isa} = %{version}-%{release}
@@ -165,7 +153,7 @@ 

  %{summary}

  

  %package -n python2-matplotlib-qt5

- Summary:        Qt5 backend for python-matplotlib

+ Summary:        Qt5 backend for python2-matplotlib

  BuildRequires:  python2-qt5

  Requires:       python2-qt5

  Requires:       python2-matplotlib%{?_isa} = %{version}-%{release}
@@ -175,7 +163,7 @@ 

  %{summary}

  

  %package -n python2-matplotlib-gtk

- Summary:        GTK backend for python-matplotlib

+ Summary:        GTK backend for python2-matplotlib

  BuildRequires:  gtk2-devel

  BuildRequires:  pycairo-devel

  BuildRequires:  pygtk2-devel
@@ -188,7 +176,7 @@ 

  %{summary}

  

  %package -n python2-matplotlib-gtk3

- Summary:        GTK3 backend for python-matplotlib

+ Summary:        GTK3 backend for python2-matplotlib

  # This should be converted to typelib(Gtk) when supported

  BuildRequires:  gtk3

  BuildRequires:  pygobject3-base
@@ -201,7 +189,7 @@ 

  %{summary}

  

  %package -n python2-matplotlib-tk

- Summary:        Tk backend for python-matplotlib

+ Summary:        Tk backend for python2-matplotlib

  BuildRequires:  tcl-devel

  BuildRequires:  tkinter

  BuildRequires:  tk-devel
@@ -213,7 +201,7 @@ 

  %{summary}

  

  %package -n python2-matplotlib-wx

- Summary:        wxPython backend for python-matplotlib

+ Summary:        wxPython backend for python2-matplotlib

  BuildRequires:  wxPython-devel

  Requires:       python2-matplotlib%{?_isa} = %{version}-%{release}

  Requires:       python2-wxpython
@@ -231,7 +219,7 @@ 

  %{summary}

  

  %package -n python2-matplotlib-doc

- Summary:        Documentation files for python-matplotlib

+ Summary:        Documentation files for python2-matplotlib

  %if %{with_html}

  BuildRequires:  dvipng

  BuildRequires:  graphviz
@@ -245,132 +233,31 @@ 

  %description -n python2-matplotlib-doc

  %{summary}

  

- %package -n python-matplotlib-data

- Summary:        Data used by python-matplotlib

+ %package -n python2-matplotlib-data

+ Summary:        Data used by python2-matplotlib

  BuildArch:      noarch

  %if %{with_bundled_fonts}

- Requires:       python-matplotlib-data-fonts = %{version}-%{release}

+ Requires:       python2-matplotlib-data-fonts = %{version}-%{release}

  %endif

- %{?python_provide:%python_provide python-matplotlib-data}

+ %{?python_provide:%python_provide python2-matplotlib-data}

  

- %description -n python-matplotlib-data

+ %description -n python2-matplotlib-data

  %{summary}

  

  %if %{with_bundled_fonts}

- %package -n python-matplotlib-data-fonts

- Summary:        Fonts used by python-matplotlib

+ %package -n python2-matplotlib-data-fonts

+ Summary:        Fonts used by python2-matplotlib

+ # STIX and Computer Modern is OFL

+ # DejaVu is Bitstream Vera and Public Domain

+ License:        OFL and Bitstream Vera and Public Domain

  BuildArch:      noarch

- Requires:       python-matplotlib-data = %{version}-%{release}

- %{?python_provide:%python_provide python-matplotlib-data-fonts}

+ Requires:       python2-matplotlib-data = %{version}-%{release}

+ %{?python_provide:%python_provide python2-matplotlib-data-fonts}

  

- %description -n python-matplotlib-data-fonts

+ %description -n python2-matplotlib-data-fonts

  %{summary}

  %endif

  

- %package -n     python3-matplotlib

- Summary:        Python 2D plotting library

- BuildRequires:  python3-cairo

- BuildRequires:  python3-cycler >= 0.10.0

- BuildRequires:  python3-dateutil

- BuildRequires:  python3-devel

- BuildRequires:  python3-setuptools

- BuildRequires:  python3-gobject

- BuildRequires:  python3-kiwisolver

- BuildRequires:  python3-numpy

- BuildRequires:  python3-pillow

- BuildRequires:  python3-pyparsing

- BuildRequires:  python3-pytz

- BuildRequires:  python3-six

- BuildRequires:  python3-sphinx

- Requires:       dejavu-sans-fonts

- Requires:       dvipng

- Requires:       python-matplotlib-data = %{version}-%{release}

- Requires:       python3-cairo

- Requires:       python3-cycler >= 0.10.0

- Requires:       python3-dateutil

- Requires:       python3-kiwisolver

- Requires:       python3-matplotlib-%{?backend_subpackage}%{!?backend_subpackage:tk}%{?_isa} = %{version}-%{release}

- %if %{run_tests}

- BuildRequires:  python3-pytest

- BuildRequires:  python3-pytest-xdist

- %endif

- Requires:       python3-numpy

- Recommends:     python3-pillow

- Requires:       python3-pyparsing

- Requires:       python3-pytz

- Requires:       python3-six

- %if !%{with_bundled_fonts}

- Requires:       stix-math-fonts

- %else

- Provides:       bundled(stix-math-fonts)

- %endif

- %{?python_provide:%python_provide python3-matplotlib}

- 

- %description -n python3-matplotlib

- Matplotlib is a python 2D plotting library which produces publication

- quality figures in a variety of hardcopy formats and interactive

- environments across platforms. matplotlib can be used in python

- scripts, the python and ipython shell, web application servers, and

- six graphical user interface toolkits.

- 

- Matplotlib tries to make easy things easy and hard things possible.

- You can generate plots, histograms, power spectra, bar charts,

- errorcharts, scatterplots, etc, with just a few lines of code.

- 

- %package -n     python3-matplotlib-qt4

- Summary:        Qt4 backend for python3-matplotlib

- BuildRequires:  python3-PyQt4-devel

- Requires:       python3-matplotlib%{?_isa} = %{version}-%{release}

- Requires:       python3-matplotlib-qt5

- Requires:       python3-PyQt4

- %{?python_provide:%python_provide python3-matplotlib-qt4}

- 

- %description -n python3-matplotlib-qt4

- %{summary}

- 

- %package -n     python3-matplotlib-qt5

- Summary:        Qt5 backend for python3-matplotlib

- BuildRequires:  python3-qt5

- Requires:       python3-matplotlib%{?_isa} = %{version}-%{release}

- Requires:       python3-qt5

- %{?python_provide:%python_provide python3-matplotlib-qt5}

- 

- %description -n python3-matplotlib-qt5

- %{summary}

- 

- # gtk2 never worked in Python 3 afaict, so no need for -gtk subpackage

- %package -n     python3-matplotlib-gtk3

- Summary:        GTK3 backend for python3-matplotlib

- # This should be converted to typelib(Gtk) when supported

- BuildRequires:  gtk3

- BuildRequires:  python3-gobject

- Requires:       gtk3%{?_isa}

- Requires:       python3-gobject%{?_isa}

- Requires:       python3-matplotlib%{?_isa} = %{version}-%{release}

- %{?python_provide:%python_provide python3-matplotlib-gtk3}

- 

- %description -n python3-matplotlib-gtk3

- %{summary}

- 

- %package -n     python3-matplotlib-tk

- Summary:        Tk backend for python3-matplotlib

- BuildRequires:  python3-tkinter

- Requires:       python3-matplotlib%{?_isa} = %{version}-%{release}

- Requires:       python3-tkinter

- %{?python_provide:%python_provide python3-matplotlib-tk}

- 

- %description -n python3-matplotlib-tk

- %{summary}

- 

- %package -n python3-matplotlib-test-data

- Summary:        Test data for python3-matplotlib

- Requires:       python3-matplotlib%{?_isa} = %{version}-%{release}

- %{?python_provide:%python_provide python3-matplotlib-test-data}

- 

- %description -n python3-matplotlib-test-data

- %{summary}

- 

- 

  %prep

  %autosetup -n matplotlib-%{version}%{?rctag} -N

  %patch0001 -p1
@@ -425,33 +312,21 @@ 

  # package doesn't drag in dependencies

  find examples -name '*.py' -exec chmod a-x '{}' \;

  

- MPLCONFIGDIR=$PWD \

- MATPLOTLIBDATA=$PWD/lib/matplotlib/mpl-data \

-   xvfb-run %{__python3} setup.py build

- # documentation cannot be built with python3 due to syntax errors

- # https://github.com/matplotlib/matplotlib/issues/5805

- 

  %install

  export http_proxy=http://127.0.0.1/

  MPLCONFIGDIR=$PWD \

  MATPLOTLIBDATA=$PWD/lib/matplotlib/mpl-data/ \

    %{__python2} setup.py install -O1 --skip-build --root=%{buildroot}

  chmod +x %{buildroot}%{python2_sitearch}/matplotlib/dates.py

- mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_datadir}/matplotlib

+ mkdir -p %{buildroot}%{_sysconfdir} %{buildroot}%{_datadir}/python2-matplotlib

  mv %{buildroot}%{python2_sitearch}/matplotlib/mpl-data/matplotlibrc \

-    %{buildroot}%{_sysconfdir}

+    %{buildroot}%{_sysconfdir}/python2-matplotlibrc

  mv %{buildroot}%{python2_sitearch}/matplotlib/mpl-data \

-    %{buildroot}%{_datadir}/matplotlib

+    %{buildroot}%{_datadir}/python2-matplotlib

  %if !%{with_bundled_fonts}

- rm -rf %{buildroot}%{_datadir}/matplotlib/mpl-data/fonts

+ rm -rf %{buildroot}%{_datadir}/python2-matplotlib/mpl-data/fonts

  %endif

  

- MPLCONFIGDIR=$PWD \

- MATPLOTLIBDATA=$PWD/lib/matplotlib/mpl-data/ \

-     %{__python3} setup.py install -O1 --skip-build --root=%{buildroot}

- chmod +x %{buildroot}%{python3_sitearch}/matplotlib/dates.py

- rm -fr %{buildroot}%{python3_sitearch}/matplotlib/mpl-data

- 

  %if %{run_tests}

  %check

  # These files confuse pytest, and we want to test the installed copy.
@@ -469,7 +344,7 @@ 

  #  * test_invisible_Line_rendering: Checks for "slowness" that often fails on a

  #    heavily-loaded builder.

  MPLCONFIGDIR=$PWD \

- MATPLOTLIBDATA=%{buildroot}%{_datadir}/matplotlib/mpl-data \

+ MATPLOTLIBDATA=%{buildroot}%{_datadir}/python2-matplotlib/mpl-data \

  PYTHONPATH=%{buildroot}%{python2_sitearch} \

  PYTHONDONTWRITEBYTECODE=1 \

       xvfb-run -a -s "-screen 0 640x480x24" \
@@ -477,42 +352,26 @@ 

               -m 'not network' \

               -k 'not test_invisible_Line_rendering and not test_parasite and not test_polycollection_close and not test_nose_image_comparison'

  

- MPLCONFIGDIR=$PWD \

- MATPLOTLIBDATA=%{buildroot}%{_datadir}/matplotlib/mpl-data \

- PYTHONPATH=%{buildroot}%{python3_sitearch} \

- PYTHONDONTWRITEBYTECODE=1 \

-      xvfb-run -a -s "-screen 0 640x480x24" \

-          %{__python3} tests.py -ra -n $(getconf _NPROCESSORS_ONLN) \

-              -m 'not network' \

-              -k 'not test_invisible_Line_rendering and not test_nose_image_comparison'

- 

  # We run these separately because they have issues when run in parallel.

  MPLCONFIGDIR=$PWD \

- MATPLOTLIBDATA=%{buildroot}%{_datadir}/matplotlib/mpl-data \

+ MATPLOTLIBDATA=%{buildroot}%{_datadir}/python2-matplotlib/mpl-data \

  PYTHONPATH=%{buildroot}%{python2_sitearch} \

  PYTHONDONTWRITEBYTECODE=1 \

       xvfb-run -a -s "-screen 0 640x480x24" \

           %{__python2} -m pytest --pyargs matplotlib -ra \

               -k 'test_nose_image_comparison'

- MPLCONFIGDIR=$PWD \

- MATPLOTLIBDATA=%{buildroot}%{_datadir}/matplotlib/mpl-data \

- PYTHONPATH=%{buildroot}%{python3_sitearch} \

- PYTHONDONTWRITEBYTECODE=1 \

-      xvfb-run -a -s "-screen 0 640x480x24" \

-          %{__python3} tests.py -ra \

-              -k 'test_nose_image_comparison'

  %endif # run_tests

  

- %files -n python-matplotlib-data

- %{_sysconfdir}/matplotlibrc

- %{_datadir}/matplotlib/mpl-data/

+ %files -n python2-matplotlib-data

+ %{_sysconfdir}/python2-matplotlibrc

+ %{_datadir}/python2-matplotlib/mpl-data/

  %if %{with_bundled_fonts}

- %exclude %{_datadir}/matplotlib/mpl-data/fonts/

+ %exclude %{_datadir}/python2-matplotlib/mpl-data/fonts/

  %endif

  

  %if %{with_bundled_fonts}

- %files -n python-matplotlib-data-fonts

- %{_datadir}/matplotlib/mpl-data/fonts/

+ %files -n python2-matplotlib-data-fonts

+ %{_datadir}/python2-matplotlib/mpl-data/fonts/

  %endif

  

  %files -n python2-matplotlib
@@ -573,59 +432,11 @@ 

  %doc doc/build/html/*

  %endif

  

- %files -n python3-matplotlib

- %license LICENSE/

- %doc README.rst

- %{python3_sitearch}/*egg-info

- %{python3_sitearch}/matplotlib-*-nspkg.pth

- %{python3_sitearch}/matplotlib/

- %exclude %{python3_sitearch}/matplotlib/tests/baseline_images/*

- %{python3_sitearch}/mpl_toolkits/

- %exclude %{python3_sitearch}/mpl_toolkits/tests/baseline_images/*

- %{python3_sitearch}/pylab.py*

- %{python3_sitearch}/__pycache__/*

- %exclude %{python3_sitearch}/matplotlib/backends/backend_qt4*

- %exclude %{python3_sitearch}/matplotlib/backends/__pycache__/backend_qt4*

- %exclude %{python3_sitearch}/matplotlib/backends/backend_qt5*

- %exclude %{python3_sitearch}/matplotlib/backends/__pycache__/backend_qt5*

- %exclude %{python3_sitearch}/matplotlib/backends/backend_gtk*

- %exclude %{python3_sitearch}/matplotlib/backends/__pycache__/backend_gtk*

- %exclude %{python3_sitearch}/matplotlib/backends/backend_tkagg.*

- %exclude %{python3_sitearch}/matplotlib/backends/__pycache__/backend_tkagg.*

- %exclude %{python3_sitearch}/matplotlib/backends/tkagg.*

- %exclude %{python3_sitearch}/matplotlib/backends/__pycache__/tkagg.*

- %exclude %{python3_sitearch}/matplotlib/backends/_tkagg.*

- %exclude %{_pkgdocdir}/*/

- 

- %files -n python3-matplotlib-test-data

- %{python3_sitearch}/matplotlib/tests/baseline_images/

- %{python3_sitearch}/mpl_toolkits/tests/baseline_images/

- 

- %files -n python3-matplotlib-qt4

- %{python3_sitearch}/matplotlib/backends/backend_qt4.*

- %{python3_sitearch}/matplotlib/backends/__pycache__/backend_qt4.*

- %{python3_sitearch}/matplotlib/backends/backend_qt4agg.*

- %{python3_sitearch}/matplotlib/backends/__pycache__/backend_qt4agg.*

- 

- %files -n python3-matplotlib-qt5

- %{python3_sitearch}/matplotlib/backends/backend_qt5.*

- %{python3_sitearch}/matplotlib/backends/__pycache__/backend_qt5.*

- %{python3_sitearch}/matplotlib/backends/backend_qt5agg.*

- %{python3_sitearch}/matplotlib/backends/__pycache__/backend_qt5agg.*

- 

- %files -n python3-matplotlib-gtk3

- %{python3_sitearch}/matplotlib/backends/backend_gtk*

- %{python3_sitearch}/matplotlib/backends/__pycache__/backend_gtk*

- 

- %files -n python3-matplotlib-tk

- %{python3_sitearch}/matplotlib/backends/backend_tkagg.py*

- %{python3_sitearch}/matplotlib/backends/__pycache__/backend_tkagg.*

- %{python3_sitearch}/matplotlib/backends/tkagg.*

- %{python3_sitearch}/matplotlib/backends/__pycache__/tkagg.*

- %{python3_sitearch}/matplotlib/backends/_tkagg.*

- 

  

  %changelog

+ * Wed Sep 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-2

+ - Split python2-matplotlib from python-matplotlib

+ 

  * Mon Aug 13 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.3-1

  - Update to latest version

  

This will be a different package. Here just for review.

rebased onto d1529ee

5 years ago

I'd say that python2-matplotlib-data* would conflict with python(3)-matplotlib-data* and it needs to be namespaced (on the filesystem).

1 new commit added

  • Namespace the dirs in the data packages
5 years ago

1 new commit added

  • Font licenses
5 years ago

Please make sure to update the fedora-patches*v2.2.x branches on the Fedora matplotlib fork on GitHub.

Will do once we are all set to go.

Pull-Request has been closed by churchyard

5 years ago