Skip to content

enhance PythonPackage and PythonBundle to support updating module footers for click autocompletion for specified binaries#4056

Merged
boegel merged 13 commits intoeasybuilders:developfrom
Crivella:feature-click_autocomplete
Feb 12, 2026
Merged

enhance PythonPackage and PythonBundle to support updating module footers for click autocompletion for specified binaries#4056
boegel merged 13 commits intoeasybuilders:developfrom
Crivella:feature-click_autocomplete

Conversation

@Crivella
Copy link
Copy Markdown
Contributor

@Crivella Crivella commented Feb 2, 2026

Currently, writing the module footers to automatically enable/disable click autocompletion on module load/unload is fairly cumbersome and can add significant chunks of repeated code to many easyconfigs.
See for example:

This PR adds a new configuration click_autocomplete_bins option to PythonPackage, to allow passing a list of strings (click script/binaries names) to specify which scripts should have autocompletion enabled.

The module footer required for autocompletion will be added both in the case of isolated PythonPackages or when PythonPackage is used through PythonBundle

NOTE

I am not running BINARY_NAME --help as a sanity check automatically as, even if it is the default for click the normal name can be altered (see https://click.palletsprojects.com/en/stable/documentation/#help-parameter-customization)

The _UPPERCASECOMMAND_COMPLETE=bash_source COMMAND instead should always produce a _UNDERSCORED_LOWERCASE_BINNAME_completion function for the bash completion (since we manually unset this when unloading the module).
This will also catch eventual changes in the behavior of click in the future

@Crivella Crivella force-pushed the feature-click_autocomplete branch from bbd5fef to 57597bc Compare February 2, 2026 14:25
Comment thread easybuild/easyblocks/generic/pythonpackage.py Outdated
@Crivella
Copy link
Copy Markdown
Contributor Author

@Crivella
Copy link
Copy Markdown
Contributor Author

re-build some random PythonPackage and PythonBundle ECs to test more.

In particular including IMAS-ParaView-2.1.0-foss-2023b.eb as it is the only one i could find besides the one in easybuilders/easybuild-easyconfigs#25198 that make use of modluatfooter or modtclfooter in a Python package

@boegelbot please test @ jsc-zen3
EB_ARGS="--installpath=/tmp/ebpr-4056 IMAS-ParaView-2.1.0-foss-2023b.eb xarray-2023.9.0-gfbf-2023a.eb VeloxChem-1.0-rc4-foss-2023a.eb hatchling-1.27.0-GCCcore-14.3.0.eb Python-bundle-PyPI-2025.07-GCCcore-14.3.0.eb meson-python-0.18.0-GCCcore-14.3.0.eb matplotlib-3.10.5-gfbf-2025b.eb GitPython-3.1.45-GCCcore-14.3.0.eb SciPy-bundle-2025.07-gfbf-2025b.eb trimesh-4.10.0-gfbf-2025b.eb h5py-3.14.0-foss-2025b.eb"

@boegelbot
Copy link
Copy Markdown

@Crivella: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de

PR test command 'if [[ develop != 'develop' ]]; then EB_BRANCH=develop ./easybuild_develop.sh 2> /dev/null 1>&2; EB_PREFIX=/home/boegelbot/easybuild/develop source init_env_easybuild_develop.sh; fi; EB_PR=4056 EB_ARGS="--installpath=/tmp/ebpr-4056 IMAS-ParaView-2.1.0-foss-2023b.eb xarray-2023.9.0-gfbf-2023a.eb VeloxChem-1.0-rc4-foss-2023a.eb hatchling-1.27.0-GCCcore-14.3.0.eb Python-bundle-PyPI-2025.07-GCCcore-14.3.0.eb meson-python-0.18.0-GCCcore-14.3.0.eb matplotlib-3.10.5-gfbf-2025b.eb GitPython-3.1.45-GCCcore-14.3.0.eb SciPy-bundle-2025.07-gfbf-2025b.eb trimesh-4.10.0-gfbf-2025b.eb h5py-3.14.0-foss-2025b.eb" EB_CONTAINER= EB_REPO=easybuild-easyblocks EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_4056 --ntasks=8 ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 9628

Test results coming soon (I hope)...

Details

- notification for comment with ID 3885281714 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@boegel boegel added this to the next release (5.2.1) milestone Feb 11, 2026
@Crivella
Copy link
Copy Markdown
Contributor Author

Crivella commented Feb 11, 2026

Test report by @Crivella

Overview of tested easyconfigs (in order)

  • SUCCESS IMAS-ParaView-2.1.0-foss-2023b.eb

  • SUCCESS xarray-2023.9.0-gfbf-2023a.eb

  • SUCCESS VeloxChem-1.0-rc4-foss-2023a.eb

  • SUCCESS hatchling-1.27.0-GCCcore-14.3.0.eb

  • SUCCESS Python-bundle-PyPI-2025.07-GCCcore-14.3.0.eb

  • SUCCESS meson-python-0.18.0-GCCcore-14.3.0.eb

  • SUCCESS GitPython-3.1.45-GCCcore-14.3.0.eb

  • SUCCESS SciPy-bundle-2025.07-gfbf-2025b.eb

  • SUCCESS trimesh-4.10.0-gfbf-2025b.eb

  • SUCCESS h5py-3.14.0-foss-2025b.eb

  • SUCCESS matplotlib-3.10.5-gfbf-2025b.eb

Build succeeded for 11 out of 11 (total: 1 hour 16 mins 21 secs) (11 easyconfigs in total)
crivella-desktop - Linux Ubuntu 22.04.5 LTS (Jammy Jellyfish), x86_64, 13th Gen Intel(R) Core(TM) i9-13900K (skylake), Python 3.11.14
See https://gist.github.com/Crivella/ede44488cc88ef1463b851959b7a6b96 for a full test report.

NOTE

the custom module footer for IMAS-ParaView -> conflict("GGD-VTK") is still properly present

FULL module show result

crivella@crivella-desktop:~$ ml show IMAS-ParaView/2.1.0-foss-2023b
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   /tmp/eb_tmpdir-l25G7L8i/modules/all/IMAS-ParaView/2.1.0-foss-2023b.lua:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
help([[
Description
===========
ParaView plugin to convert GGD structures to VTK


More information
================
 - Homepage: https://github.com/iterorganization/IMAS-ParaView
]])
whatis("Description: ParaView plugin to convert GGD structures to VTK")
whatis("Homepage: https://github.com/iterorganization/IMAS-ParaView")
whatis("URL: https://github.com/iterorganization/IMAS-ParaView")
conflict("IMAS-ParaView")
depends_on("foss/2023b")
depends_on("Python/3.11.5-GCCcore-13.2.0")
depends_on("SciPy-bundle/2023.11-gfbf-2023b")
depends_on("ParaView/5.12.0-foss-2023b")
depends_on("VTK/9.3.0-foss-2023b")
depends_on("IMAS-Python/2.0.0-foss-2023b")
prepend_path("CMAKE_PREFIX_PATH","/tmp/eb_tmpdir-l25G7L8i/software/IMAS-ParaView/2.1.0-foss-2023b")
prepend_path("PATH","/tmp/eb_tmpdir-l25G7L8i/software/IMAS-ParaView/2.1.0-foss-2023b/bin")
prepend_path("PV_PLUGIN_PATH","/tmp/eb_tmpdir-l25G7L8i/software/IMAS-ParaView/2.1.0-foss-2023b/lib/python3.11/site-packages/imas_paraview/plugins")
setenv("EBROOTIMASMINPARAVIEW","/tmp/eb_tmpdir-l25G7L8i/software/IMAS-ParaView/2.1.0-foss-2023b")
setenv("EBVERSIONIMASMINPARAVIEW","2.1.0")
setenv("EBDEVELIMASMINPARAVIEW","/tmp/eb_tmpdir-l25G7L8i/software/IMAS-ParaView/2.1.0-foss-2023b/easybuild/IMAS-ParaView-2.1.0-foss-2023b-easybuild-devel")
prepend_path("PYTHONPATH","/tmp/eb_tmpdir-l25G7L8i/software/IMAS-ParaView/2.1.0-foss-2023b/lib/python3.11/site-packages")
conflict("GGD-VTK")

crivella@crivella-desktop:~$ 

@boegelbot
Copy link
Copy Markdown

Test report by @boegelbot

Overview of tested easyconfigs (in order)

  • SUCCESS IMAS-ParaView-2.1.0-foss-2023b.eb

  • SUCCESS xarray-2023.9.0-gfbf-2023a.eb

  • SUCCESS VeloxChem-1.0-rc4-foss-2023a.eb

  • SUCCESS hatchling-1.27.0-GCCcore-14.3.0.eb

  • SUCCESS Python-bundle-PyPI-2025.07-GCCcore-14.3.0.eb

  • SUCCESS meson-python-0.18.0-GCCcore-14.3.0.eb

  • SUCCESS GitPython-3.1.45-GCCcore-14.3.0.eb

  • SUCCESS SciPy-bundle-2025.07-gfbf-2025b.eb

  • SUCCESS trimesh-4.10.0-gfbf-2025b.eb

  • SUCCESS h5py-3.14.0-foss-2025b.eb

  • SUCCESS matplotlib-3.10.5-gfbf-2025b.eb

Build succeeded for 11 out of 11 (total: 3 hours 41 mins 35 secs) (11 easyconfigs in total)
jsczen3c1.int.jsc-zen3.fz-juelich.de - Linux Rocky Linux 9.7, x86_64, AMD EPYC-Milan Processor (zen3), Python 3.9.23
See https://gist.github.com/boegelbot/246d704e72f40ec01a2438132fd45802 for a full test report.

Comment thread easybuild/easyblocks/generic/pythonbundle.py
Comment thread easybuild/easyblocks/generic/pythonpackage.py Outdated
Comment thread easybuild/easyblocks/generic/pythonpackage.py Outdated
Comment thread easybuild/easyblocks/generic/pythonpackage.py
Comment thread easybuild/easyblocks/generic/pythonpackage.py Outdated
Comment thread easybuild/easyblocks/generic/pythonbundle.py Outdated
@boegel
Copy link
Copy Markdown
Member

boegel commented Feb 12, 2026

Test report by @boegel

Overview of tested easyconfigs (in order)

  • SUCCESS libxml2-2.14.3-GCCcore-14.3.0.eb

  • SUCCESS matplotlib-3.9.2-gfbf-2024a.eb

Build succeeded for 2 out of 2 (total: 6 mins 6 secs) (2 easyconfigs in total)
node4205.shinx.os - Linux RHEL 9.6, x86_64, AMD EPYC 9654 96-Core Processor (zen4), Python 3.9.21
See https://gist.github.com/boegel/5b7b848bbcb8b39bd67d9e785248107e for a full test report.

Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm

@boegel boegel merged commit 0f75bae into easybuilders:develop Feb 12, 2026
22 checks passed
@Crivella Crivella deleted the feature-click_autocomplete branch February 12, 2026 11:44
@boegel boegel changed the title Automatically write module footers for click autocompletion for specified binaries enhance PythonPackage and PythonBundle to support updating module footers for click autocompletion for specified binaries Feb 19, 2026
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.

4 participants