easybuilders / easybuild-easyblocks

Collection of easyblocks that implement support for building and installing software with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
106 stars 285 forks source link

PythonPackage doesn't allow version specific setting of EC variables like `use_pip` #3351

Open Flamefire opened 5 months ago

Flamefire commented 5 months ago

The init method of PythonPackage does a lot depending on EC params

For some Python packages with own easyblocks, such as numpy, we may want to use pip starting at a specific version, i.e. set use_pip = True. However the required self.version isn't available until __init__ of EasyBlock finishes, so the derived easyblock must call that first. This however results in PythonPackage setting a lot of member variables already, especially it changes EC variables. Some only work for pip or setup.py: https://github.com/easybuilders/easybuild-easyblocks/blob/9e1cdf245fdd6b4d803885562eb084b6df4e236b/easybuild/easyblocks/generic/pythonpackage.py#L449-L453

Hence when the derived EasyBlock wants to/can change use_pip the state has already been irreversibly modified.