# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild
# Created: Pierre-Yves Barriat
#
# Run first: it will crash on sanity checking
# Then run again with "--module-only --skip-sanity-check"
#
easyblock = 'PythonBundle'

name = 'proplot'
version = '0.9.91'

homepage = 'https://github.com/cvanelteren/proplot'
description = """A succinct matplotlib wrapper for making beautiful, publication-quality graphics."""

toolchain = {'name': 'foss', 'version': '2024a'}

builddependencies = [
    ('hatchling', '1.24.2'),
]
dependencies = [
    ('Python', '3.12.3'),
    ('Python-bundle-PyPI', '2024.06'),
    ('Cython', '3.0.10'),
    ('SciPy-bundle', '2024.05'),
    ('matplotlib', '3.9.2'), #gfbf
    ('Cartopy', '0.24.1'),
    ('xarray', '2024.11.0'), #gfbf
    ('Seaborn', '0.13.2'), #gfbf
    ('IPython', '8.27.0'),
    ('jupyter-server', '2.14.2'),
    ('basemap', '1.4.1'),
]
  #- pyqt 5.15.11 
    #- git+https://github.com/cvanelteren/sphinx-rtd-light-dark.git@mplv3.9.1  0.1.2

use_pip = True
sanity_pip_check = False

exts_list = [
    ('jupytext', '1.16.4', {
        'checksums': ['28e33f46f2ce7a41fb9d677a4a2c95327285579b64ca104437c4b9eb1e4174e9'],
    }),
    ('pandoc', '2.4', {
        'checksums': ['ecd1f8cbb7f4180c6b5db4a17a7c1a74df519995f5f186ef81ce72a9cbd0dd9a'],
    }),
    ('pint', '0.24.3', {
        'checksums': ['d54771093e8b94c4e0a35ac638c2444ddf3ef685652bab7675ffecfa0c5c5cdf'],
    }),
    #('pyqt', '5.15.11', {
    #    'checksums': ['4caec82fd8dd096feba8217858068bacb2a3b5950f43c048c6dc32a3489d5af1'],
    #}),
    #
    ('sphinx_autoapi', '3.3.2', {
        'modulename': 'sphinx-autoapi',
        'checksums': ['ebf8b44b2ebab5c28f0263ec6c2f8acdd156e9b2d539a58eca39d2f368445173'],
    }),
    ('basemap_data_hires', '1.3.2', {
        'modulename': 'basemap-data-hires',
        'source_tmpl': '%(name)s-%(version)s.zip',
        'checksums': ['0982eb95b2066ccbe10b6580bcd9c597e3a4e25016bf25afb65e1a96f6e3e97d'],
        #'preinstallopts': r"""cd .. && git clone -b develop https://github.com/matplotlib/basemap.git && cd basemap/packages/basemap_data_hires && """
    }),
    ('sphinx_automodapi', '0.18.0', {
        'modulename': 'sphinx-automodapi',
        'checksums': ['7bf9d9a2cb67a5389c51071cfd86674ca3892ca5d5943f95de4553d6f35dddae'],
    }),
    ('nbsphinx', '0.9.5', {
        'checksums': ['736916e7b0dab28fc904f4a9ae3b53a9a50c29fccc6329c052fcc7485abcf2b7'],
    }),
    ('sphinx-copybutton', '0.5.2', {
        'checksums': ['4cf17c82fb9646d1bc9ca92ac280813a3b605d8c421225fd9913154103ee1fbd'],
    }),
    # sphinx-rtd-theme==2.1.0rc2
    ('sphinx_rtd_theme', '3.0.1', {
        'modulename': 'sphinx-rtd-theme',
        'checksums': ['a4c5745d1b06dfcb80b7704fe532eb765b44065a8fad9851e4258c8804140703'],
    }),
    #
    ('mdit_py_plugins', '0.4.2', {
        'modulename': 'mdit-py-plugins',
    }),
    ('plumbum', '1.8.3', {
        'modulename': 'plumbum',
    }),
    ('flexcache', '0.3', {
        'modulename': 'flexcache',
    }),
    ('flexparser', '0.3.1', {
        'modulename': 'flexparser',
    }),
    ('astroid', '3.3.5', {
        'modulename': 'astroid',
    }),
    ('sphinxcontrib-jquery', '4.1', {
        'modulename': 'sphinxcontrib-jquery',
    }),
    #
    (name, version, {
        'source_tmpl': 'mpl3.9.1.zip',
        'source_urls': ['https://github.com/cvanelteren/proplot/archive/refs/heads'],
        #'checksums': ['07ae8fe0f32f2adf96065e2ef137fa0fee11eb69a58b1892dc80534054a29d3b'],
        'preinstallopts': r"""cd .. && git clone -b mpl3.9.1 https://github.com/cvanelteren/proplot && cd proplot && """
    }),
]

sanity_check_commands = [
    "python -c 'import jupytext'",
    "python -c 'import pandoc'",
    "python -c 'import pint'",
    "python -c 'from mpl_toolkits.basemap import Basemap'",
    "python -c 'import nbsphinx'",
    "python -c 'import sphinx_copybutton'",
    "python -c 'import plumbum'",
    "python -c 'import flexcache'",
    "python -c 'import flexparser'",
    "python -c 'import astroid'",
]

sanity_check_paths = {
    'files': [],
    'dirs': ['lib/python%(pyshortver)s/site-packages'],
}

moduleclass = 'geo'
