# Full credit goes to https://github.com/conda/conda-recipes for providing this recipe.
# It has been subsequently adapted for automated building with conda-forge.

{% set version = "3.10.0" %}

package:
  name: matplotlib-suite
  version: {{ version }}

source:
  url: https://github.com/matplotlib/matplotlib/archive/v{{ version }}.tar.gz
  sha256: 825919da8957bbc19cec35caf8663b734d34af72a0b040c43b7d8c1b76fdcab7

build:
  number: 0

requirements:
  host:
    - python

outputs:
  - name: matplotlib-base
    script: build_base.bat  # [win]
    script: build_base.sh  # [not win]
    build:
      skip: true  # [py<310]
      missing_dso_whitelist:  # [s390x]
        - $RPATH/ld64.so.1    # [s390x]
    requirements:
      build:
        - {{ compiler('c') }}
        - {{ compiler('cxx') }}
        - pkg-config
      host:
        - python
        - pip
        - freetype {{ freetype }}
        - numpy 2.0         # [py<313]
        - numpy {{ numpy }}  # [py>=313]
        - setuptools_scm >=7
        - pybind11 >=2.13.2,!=2.13.3
        - meson-python >=0.13.1,<0.17.0
        - python-build
      run:
        - python
        - contourpy >=1.0.1
        - cycler >=0.10
        - fonttools >=4.22.0
        - kiwisolver >=1.3.1
        - numpy >=1.23,<3.0a0
        - packaging >=20.0
        - pillow >=8
        - pyparsing >=2.3.1
        - python-dateutil >=2.7
        - importlib_resources >=3.2.0  # [py<310]
        # bounds through run_exports
        - freetype
    test:
      imports:
        - matplotlib
        - matplotlib.pyplot
        - matplotlib._image
        - matplotlib._path
        - matplotlib._qhull
        - matplotlib._tri
        - matplotlib.backends._backend_agg
        - matplotlib.ft2font
        - matplotlib.backends._tkagg  # [not win]
        - mpl_toolkits
        - pylab
        - matplotlib.cbook
      requires:
        - pip
      commands:
        - pip check
        - python -c "import matplotlib; matplotlib.cbook.get_sample_data('msft.csv', asfileobj=False)"

  - name: matplotlib
    build:
      skip: true  # [py<310]
    requirements:
      host:
        - python
      run:
        - python
        - pyqt >=5  # [(linux64 or win) and python_impl == "cpython"]
        - tornado >=5
        - {{ pin_subpackage('matplotlib-base', max_pin="x.x.x") }}
    test:
      imports:
        - matplotlib

about:
  home: https://matplotlib.org/
  license: LicenseRef-PSF-based
  license_family: PSF
  license_file: LICENSE/LICENSE
  summary: Publication quality figures in Python
  description: |
    Matplotlib produces publication-quality figures in a variety of hardcopy formats
    and interactive environments across platforms. Matplotlib can be used in
    Python scripts, Python/IPython shells, web application servers,
    and various graphical user interface toolkits.
  dev_url: https://github.com/matplotlib/matplotlib/
  doc_url: https://matplotlib.org/

extra:
  recipe-maintainers:
    - mdboom
    - ocefpaf
    - pelson
    - tacaswell
    - dopplershift
