Skip to content

py-matplotlib: add v3.6.0, new backends#32697

Merged
tldahlgren merged 4 commits intospack:developfrom
adamjstewart:packages/py-matplotlib
Oct 5, 2022
Merged

py-matplotlib: add v3.6.0, new backends#32697
tldahlgren merged 4 commits intospack:developfrom
adamjstewart:packages/py-matplotlib

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart commented Sep 17, 2022

https://github.com/matplotlib/matplotlib/releases/tag/v3.6.0

These backends are starting to get pretty unwieldy. I'm open to suggestions for how to best support this. The problem is that each backend has multiple possible dependencies. Currently, we're hard-coding to use a specific dependency, but it would be great if we didn't have to do this. There's also been a lot of changes in backend support over the years, and I'm not sure which we actually want to support.

conditional("gtk4cairo", when="@3.5:"),
# Qt
conditional("qtagg", when="@3.5:"),
conditional("qtcairo", when="@3.5:"),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

From what I can tell, the intention of having qtagg and qtcairo is to have a single backend for all Qt versions. The user then specifies the QT_API environment variable in order to specify which backend they want. See matplotlib/matplotlib#19255. However, we have separate packages for py-pyqt4/5/6 and py-pyside4/5/6, so there's no way to have a single dependency. Instead, I'm hardcoding to use py-pyqt6, but that's not really the intent of this backend.

@adamjstewart
Copy link
Copy Markdown
Member Author

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app Bot commented Sep 17, 2022

Let me see if I can fix that for you!

@spackbot-app
Copy link
Copy Markdown

spackbot-app Bot commented Sep 17, 2022

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: isort, mypy, black, flake8
==> Modified files
  var/spack/repos/builtin/packages/py-matplotlib/package.py
==> Running isort checks
  isort checks were clean
==> Running mypy checks
Success: no issues found in 558 source files
  mypy checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/py-matplotlib/package.py
All done! ✨ 🍰 ✨
1 file reformatted.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> spack style checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with isort fixes.

@adamjstewart
Copy link
Copy Markdown
Member Author

@pradyunsg I'm seeing the following error when building:

==> [2022-09-17-13:19:22.108970] '/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/python-3.9.13-cyczbvea6n3kev4tei2uohyy7bstmdlb/bin/python3.9' '-m' 'pip' '-vvv' '--no-input' '--no-cache-dir' '--disable-pip-version-check' 'install' '--no-deps' '--ignore-installed' '--no-build-isolation' '--no-warn-script-location' '--no-index' '--prefix=/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-matplotlib-3.6.0-odqpo3ad7nsxrwpfqnlizvf2gahwxvgl' '.'
Using pip 21.3.1 from /Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-pip-21.3.1-sqd3dh54va5tpxc64b34movubtbdd5lr/lib/python3.9/site-packages/pip (python 3.9)
Non-user install due to --prefix or --target option
Ignoring indexes: https://pypi.org/simple
Created temporary directory: /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-ephem-wheel-cache-t47etesg
Created temporary directory: /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-req-tracker-83vlq4py
Initialized build tracking at /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-req-tracker-83vlq4py
Created build tracker: /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-req-tracker-83vlq4py
Entered build tracker: /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-req-tracker-83vlq4py
Created temporary directory: /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-install-jplqpp3p
Processing /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/ajstewart/spack-stage/spack-stage-py-matplotlib-3.6.0-odqpo3ad7nsxrwpfqnlizvf2gahwxvgl/spack-src
  Added file:///private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/ajstewart/spack-stage/spack-stage-py-matplotlib-3.6.0-odqpo3ad7nsxrwpfqnlizvf2gahwxvgl/spack-src to build tracker '/private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-req-tracker-83vlq4py'
  Running setup.py (path:/private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/ajstewart/spack-stage/spack-stage-py-matplotlib-3.6.0-odqpo3ad7nsxrwpfqnlizvf2gahwxvgl/spack-src/setup.py) egg_info for package from file:///private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/ajstewart/spack-stage/spack-stage-py-matplotlib-3.6.0-odqpo3ad7nsxrwpfqnlizvf2gahwxvgl/spack-src
  Created temporary directory: /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/pip-pip-egg-info-wgnxdrwz
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  /Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-58.2.0-zmy6llhuwcrtcef37xm4pfhk7h4e6y3i/lib/python3.9/site-packages/setuptools/dist.py:812: UserWarning: Module setuptools_scm was already imported from /Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-scm-6.3.2-7yjjx7iwoeksbzms7vowuspukmf4dbxk/lib/python3.9/site-packages/setuptools_scm/__init__.py, but /private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/ajstewart/spack-stage/spack-stage-py-matplotlib-3.6.0-odqpo3ad7nsxrwpfqnlizvf2gahwxvgl/spack-src/.eggs/setuptools_scm-7.0.5-py3.9.egg is being added to sys.path
    pkg_resources.working_set.add(dist, replace=True)
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/j1/68dlgpr91vlgs26vty2c8xk80000gn/T/ajstewart/spack-stage/spack-stage-py-matplotlib-3.6.0-odqpo3ad7nsxrwpfqnlizvf2gahwxvgl/spack-src/setup.py", line 260, in <module>
      setup(  # Finally, pass this all along to setuptools to do the heavy lifting.
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-58.2.0-zmy6llhuwcrtcef37xm4pfhk7h4e6y3i/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/python-3.9.13-cyczbvea6n3kev4tei2uohyy7bstmdlb/lib/python3.9/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-58.2.0-zmy6llhuwcrtcef37xm4pfhk7h4e6y3i/lib/python3.9/site-packages/setuptools/dist.py", line 453, in __init__
      _Distribution.__init__(
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/python-3.9.13-cyczbvea6n3kev4tei2uohyy7bstmdlb/lib/python3.9/distutils/dist.py", line 292, in __init__
      self.finalize_options()
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-58.2.0-zmy6llhuwcrtcef37xm4pfhk7h4e6y3i/lib/python3.9/site-packages/setuptools/dist.py", line 831, in finalize_options
      ep(self)
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-58.2.0-zmy6llhuwcrtcef37xm4pfhk7h4e6y3i/lib/python3.9/site-packages/setuptools/dist.py", line 852, in _finalize_setup_keywords
      ep.load()(self, ep.name, value)
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-scm-6.3.2-7yjjx7iwoeksbzms7vowuspukmf4dbxk/lib/python3.9/site-packages/setuptools_scm/integration.py", line 65, in version_keyword
      dist.metadata.version = _get_version(config)
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-scm-6.3.2-7yjjx7iwoeksbzms7vowuspukmf4dbxk/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 177, in _get_version
      parsed_version = _do_parse(config)
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-scm-6.3.2-7yjjx7iwoeksbzms7vowuspukmf4dbxk/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 128, in _do_parse
      version = _version_from_entrypoints(config) or _version_from_entrypoints(
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/py-setuptools-scm-6.3.2-7yjjx7iwoeksbzms7vowuspukmf4dbxk/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 69, in _version_from_entrypoints
      version = _call_entrypoint_fn(root, config, ep.load())
    File "/Users/ajstewart/spack/opt/spack/darwin-monterey-m1/apple-clang-13.1.6/python-3.9.13-cyczbvea6n3kev4tei2uohyy7bstmdlb/lib/python3.9/importlib/metadata.py", line 88, in load
      return functools.reduce(getattr, attrs, module)
  AttributeError: module 'setuptools_scm.git' has no attribute 'parse_archival'

My best guess is that <matplotlib-src>/.eggs/setuptools_scm-7.0.5-py3.9.egg is a different version than the setuptools_scm I have installed, and a recently added attribute isn't being found in that older version. But where is this egg coming from? There is no such file in the matplotlib source code, not sure what is downloading it.

@adamjstewart
Copy link
Copy Markdown
Member Author

@scottwittenburg I'm trying to reproduce the CI build failure locally but it seems like the Python that gets pulled down from the binary cache is broken:

$ /home/software/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spa/linux-ubuntu18.04-x86_64/gcc-7.5.0/python-3.7.13-2rasf254brdwtgeudnsupharkvcceker/bin/python
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

Is this a known issue?

@pradyunsg
Copy link
Copy Markdown

But where is this egg coming from?

No idea. That's likely related to how matplotlib is being generated/built, and that's something I'm not particularly familiar with. I won't have more time to look into this until next week, since I'm currently swamped between talk prep and a couple of things I'd like to get into the next pip release.

@adamjstewart
Copy link
Copy Markdown
Member Author

Reported the build issue upstream: matplotlib/matplotlib#23997

@adamjstewart adamjstewart marked this pull request as draft September 24, 2022 22:04
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

LGTM. Confirmed both new sha256.

@tldahlgren tldahlgren merged commit 760294b into spack:develop Oct 5, 2022
@tldahlgren tldahlgren self-assigned this Oct 5, 2022
@adamjstewart adamjstewart deleted the packages/py-matplotlib branch October 5, 2022 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants