Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Flamefire opened this issue Jun 6, 2024 · 0 comments

Comments

@Flamefire
Copy link
Contributor

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:

self.cfg.update('installopts', '--egg')
pip_no_index = self.cfg.get('pip_no_index', None)
if pip_no_index or (pip_no_index is None and self.cfg.get('download_dep_fail')):
self.cfg.update('installopts', '--no-index')

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant