Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#67885 closed defect (fixed)

py310-matplotlib requires pyparsing < 3.1, but py310-parsing provides 3.1.0

Reported by: bernstei Owned by: reneeotten (Renee Otten)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: py-matplotlib, py-pyparsing

Description

With the latest macports (2.8.1) on macOS 11.7, py310-matplotlib requires pyparsing < 3.1

$ grep parsing /opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib-3.7.2-py3.10.egg-info/requires.txt
pyparsing<3.1,>=2.3.1

But py310-parsing provides 3.1.0

$ python3 -c "import pyparsing; print(pyparsing.__file__, pyparsing.__version__)"
/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyparsing/__init__.py 3.1.0

I don't really know where this gets fixed, or if it's just something in pypi, but it means that if you install something that depends on matplotlib to your local directory (i.e. ~/Library) it also installs an older pyparsing.

These are the installed versions, which appear to be the latest (i.e. port upgrade outdated doesn't update them)

bernstei@cadmium davtk % port info py310-matplotlib py310-parsing
py310-matplotlib @3.7.2_1 (python, graphics, math)
Variants:             [+]cairo, dvipng, ghostscript, gtk3, latex, pdftops, pyside, qt5, tkinter, universal, [+]webagg

Description:          Matplotlib strives to produce publication quality 2D graphics for interactive graphing, scientific publishing, user interface development and web
                      application servers targeting multiple user interfaces and hardcopy output formats. There is a 'pylab' mode which emulates matlab graphics. The library uses
                      numpy for handling large data sets and supports a variety of output backends. This port provides variants for the different GUIs (gtk2, gtk3, tkinter, qt4,
                      qt5, cairo, latex).
Homepage:             https://matplotlib.org/

Build Dependencies:   pkgconfig, py310-certifi, py310-pybind11, py310-setuptools, py310-setuptools_scm
Library Dependencies: freetype, qhull, py310-contourpy, py310-cycler, py310-dateutil, py310-fonttools, py310-kiwisolver, py310-numpy, py310-parsing, py310-packaging,
                      py310-Pillow, py310-cairo, python310
Platforms:            darwin
License:              (PSF or BSD)
Maintainers:          Email: reneeotten@macports.org, GitHub: reneeotten
                      Policy: openmaintainer
--
py310-parsing @3.1.0 (python, lang)

Description:          The parsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular
                      expressions. The parsing module provides a library of classes that client code uses to construct the grammar directly in Python code.
Homepage:             https://github.com/pyparsing/pyparsing/

Build Dependencies:   py310-build, py310-installer, py310-flit_core
Library Dependencies: python310
Platforms:            darwin any
License:              MIT
Maintainers:          Email: reneeotten@macports.org, GitHub: reneeotten
                      Policy: openmaintainer

Change History (6)

comment:1 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to reneeotten
Port: py-matplotlib py-pyparsing added
Status: newassigned

comment:2 Changed 9 months ago by reneeotten (Renee Otten)

You're correct that matplotlib sets a version cap on pyparsing but that has been removed in the git repository and it appears to only affects a few tests. So I am not really worried about that and have removed the version cap as well. So that should fix your issue.

As a side note: I am not sure what you mean by "but it means that if you install something that depends on matplotlib to your local directory (i.e. ~/Library) it also installs an older pyparsing." You should not be doing that; if you want to use MacPorts use it for all Python packages that you want to use. If you start mixing installing things using pip or something else than you're bound to run into trouble at some point.

comment:3 Changed 9 months ago by reneeotten (Renee Otten)

Resolution: fixed
Status: assignedclosed

In 0c3033f46ff8950cd238ef1db247e16fd3dc5019/macports-ports (master):

py-matplotlib: remove version cap for pyparsing

Closes: #67885

comment:4 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

Are you sure this requires a revision increase?

comment:5 Changed 9 months ago by bernstei

Thanks for the quick fix.

if you want to use MacPorts use it for all Python packages that you want to use. If you start mixing installing things using pip or something else than you're bound to run into trouble at some point.

So I have observed empirically that you can spend a lot of time using some things from macports combined with lots of things (mostly numerical/scientific packages) installed via pip and it works fine in practice.

I also don't understand how one can ever get this to work if one ever wants any python package from outside of macports (which will pretty much always be packaged for pip, whether or not it comes from pypi), since inevitably macports installs lots of python packages (presumably because they are dependencies for other things). I guess maybe with stringent use of virtual envs to get it to ignore all the macports-installed packages?

comment:6 in reply to:  4 Changed 9 months ago by reneeotten (Renee Otten)

Replying to ryandesign:

Are you sure this requires a revision increase?

well... "sure" is perhaps a too strong statement. But often Python packages do check at runtime whether dependencies are fulfilled, so things could fail if the installed files from the buildbot list ""pyparsing>=2.3.1,<3.1"," and then a newer version is installed. So the safest way is to increase the revision.

Note: See TracTickets for help on using tickets.