From 2c9311614c283071327f7ed5dd0ffc85f52969d3 Mon Sep 17 00:00:00 2001 From: Simon Branford Date: Thu, 2 Jan 2025 11:36:46 +0000 Subject: [PATCH 1/5] switch default to `install_pip=True` in `python.py` --- easybuild/easyblocks/p/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/p/python.py b/easybuild/easyblocks/p/python.py index 824a44dd11..65d74e4889 100644 --- a/easybuild/easyblocks/p/python.py +++ b/easybuild/easyblocks/p/python.py @@ -124,7 +124,7 @@ def extra_options(): """Add extra config options specific to Python.""" extra_vars = { 'ebpythonprefixes': [True, "Create sitecustomize.py and allow use of $EBPYTHONPREFIXES", CUSTOM], - 'install_pip': [False, + 'install_pip': [True, "Use the ensurepip module (Python 2.7.9+, 3.4+) to install the bundled versions " "of pip and setuptools into Python. You _must_ then use pip for upgrading " "pip & setuptools by installing newer versions as extensions!", From 0f03eb2a51e2d05a796dc5f576191fa5a691aeb7 Mon Sep 17 00:00:00 2001 From: Simon Branford <4967+branfosj@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:47:33 +0000 Subject: [PATCH 2/5] tests --- test/easyblocks/init_easyblocks.py | 3 +++ test/easyblocks/module.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/easyblocks/init_easyblocks.py b/test/easyblocks/init_easyblocks.py index 97f1bccc4e..d54e4d35b1 100644 --- a/test/easyblocks/init_easyblocks.py +++ b/test/easyblocks/init_easyblocks.py @@ -244,6 +244,9 @@ def innertest(self): elif easyblock_fn == 'paraver.py': # custom easyblock for Paraver requires version >= 4.7 innertest = make_inner_test(easyblock, version='4.8') + elif easyblock_fn == 'python.py': + # custom easyblock for Python (ensurepip) requires version >= 3.4.0 + innertest = make_inner_test(easyblock, version='3.4.0') elif easyblock_fn == 'torchvision.py': # torchvision easyblock requires that PyTorch is listed as dependency innertest = make_inner_test(easyblock, name='torchvision', deps=[('PyTorch', '1.12.1')]) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index a4d2874305..f6bffd2c60 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -471,6 +471,9 @@ def innertest(self): elif eb_fn == 'paraver.py': # custom easyblock for Paraver requires version >= 4.7 innertest = make_inner_test(easyblock, name='Paraver', version='4.8') + elif easyblock_fn == 'python.py': + # custom easyblock for Python (ensurepip) requires version >= 3.4.0 + innertest = make_inner_test(easyblock, version='3.4.0') elif eb_fn == 'torchvision.py': # torchvision easyblock requires that PyTorch is listed as dependency extra_txt = "dependencies = [('PyTorch', '1.12.1')]" From ec121030c8abbe03186d4d90190bce87196ee79f Mon Sep 17 00:00:00 2001 From: Simon Branford <4967+branfosj@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:48:12 +0000 Subject: [PATCH 3/5] eb_fn --- test/easyblocks/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index f6bffd2c60..d403363b01 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -471,7 +471,7 @@ def innertest(self): elif eb_fn == 'paraver.py': # custom easyblock for Paraver requires version >= 4.7 innertest = make_inner_test(easyblock, name='Paraver', version='4.8') - elif easyblock_fn == 'python.py': + elif eb_fn == 'python.py': # custom easyblock for Python (ensurepip) requires version >= 3.4.0 innertest = make_inner_test(easyblock, version='3.4.0') elif eb_fn == 'torchvision.py': From c0ba76b948c44312ba89df999fcfeb4fd2838455 Mon Sep 17 00:00:00 2001 From: Simon Branford <4967+branfosj@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:09:21 +0000 Subject: [PATCH 4/5] and tkinter --- test/easyblocks/init_easyblocks.py | 2 +- test/easyblocks/module.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/easyblocks/init_easyblocks.py b/test/easyblocks/init_easyblocks.py index d54e4d35b1..9ed4b92a7c 100644 --- a/test/easyblocks/init_easyblocks.py +++ b/test/easyblocks/init_easyblocks.py @@ -244,7 +244,7 @@ def innertest(self): elif easyblock_fn == 'paraver.py': # custom easyblock for Paraver requires version >= 4.7 innertest = make_inner_test(easyblock, version='4.8') - elif easyblock_fn == 'python.py': + elif easyblock_fn in ['python.py', 'tkinter.py']: # custom easyblock for Python (ensurepip) requires version >= 3.4.0 innertest = make_inner_test(easyblock, version='3.4.0') elif easyblock_fn == 'torchvision.py': diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index d403363b01..b67bd47f0e 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -471,7 +471,7 @@ def innertest(self): elif eb_fn == 'paraver.py': # custom easyblock for Paraver requires version >= 4.7 innertest = make_inner_test(easyblock, name='Paraver', version='4.8') - elif eb_fn == 'python.py': + elif eb_fn in ['python.py', 'tkinter.py']: # custom easyblock for Python (ensurepip) requires version >= 3.4.0 innertest = make_inner_test(easyblock, version='3.4.0') elif eb_fn == 'torchvision.py': From bfe295f883d55e0afd95b36d8459359c3ef13643 Mon Sep 17 00:00:00 2001 From: Simon Branford <4967+branfosj@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:13:26 +0000 Subject: [PATCH 5/5] copy/paste fail --- test/easyblocks/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index b67bd47f0e..5ef7175a64 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -473,7 +473,7 @@ def innertest(self): innertest = make_inner_test(easyblock, name='Paraver', version='4.8') elif eb_fn in ['python.py', 'tkinter.py']: # custom easyblock for Python (ensurepip) requires version >= 3.4.0 - innertest = make_inner_test(easyblock, version='3.4.0') + innertest = make_inner_test(easyblock, name=eb_fn.replace('_', '-')[:-3], version='3.4.0') elif eb_fn == 'torchvision.py': # torchvision easyblock requires that PyTorch is listed as dependency extra_txt = "dependencies = [('PyTorch', '1.12.1')]"