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

allow Python bundles and packages to specify a maximum Python version for the system toolchain #3431

Conversation

casparvl
Copy link
Contributor

@casparvl casparvl commented Sep 4, 2024

We implement support for specifying a maximum python version for EasyConfigs that use system python (through the max_py_majver, max_py_minver keywords). This is is required for easybuilders/easybuild-easyconfigs#21307 which has one EasyConfig that will only work on the python 3.6 - 3.11 range (3.12 will fail because the setuptools is too old, but newer setuptools do not support python3.6).

This PR is built on top of #3430 . That one should probably be reviewed & merged first, after which this PR should be synced with develop.

casparvl pushed a commit to casparvl/easybuild-easyconfigs that referenced this pull request Sep 4, 2024
@bedroge bedroge changed the title Allow specifying max python ver system toolchain allow Python bundles and packages to specify a maximum Python version for the system toolchain Sep 6, 2024
@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

  • SUCCESS pyBigWig-0.3.22-gfbf-2023a.eb
  • SUCCESS PyYAML-6.0-GCCcore-12.2.0.eb
  • SUCCESS sktime-0.25.0-gfbf-2023a.eb
  • SUCCESS NiBabel-4.0.2-foss-2022a.eb

Build succeeded for 4 out of 4 (4 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/3235d0ff53051a7f7472f287c85e5194 for a full test report.

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

Build succeeded for 0 out of 1 (1 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/c5bc91e9bf2dab40ee1d2eec64f6eba2 for a full test report.

Expected failure that confirms that the new functionality works. I used Python 3.12 for a ReFrame version (from easybuilders/easybuild-easyconfigs#21307) that only supports Python <= 3.11.

== FAILED: Installation ended unsuccessfully (build directory: /data/eb/build/ReFrame/4.6.2/system-system-Python-3.6): build failed (first 300 chars): Failed to pick Python command that satisfies requirements in the easyconfig (req_py_majver = 3, req_py_minver = 6, max_py_majver = 3, max_py_minver = 11) (took 0 secs)

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

  • SUCCESS ReFrame-4.6.2.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/0a9eb4ce1c0a45c11a91de2ef7e08122 for a full test report.

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

Build succeeded for 0 out of 1 (1 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/5459719d39a8ec3d367525b0a0eb14cc for a full test report.

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Redoing all test builds to make sure things still work.

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

  • SUCCESS pyBigWig-0.3.22-gfbf-2023a.eb
  • SUCCESS PyYAML-6.0-GCCcore-12.2.0.eb
  • SUCCESS sktime-0.25.0-gfbf-2023a.eb
  • SUCCESS NiBabel-4.0.2-foss-2022a.eb
  • SUCCESS ReFrame-4.6.2.eb

Build succeeded for 5 out of 5 (5 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/9e6d8b842a542e42333cb212c2c2b18b for a full test report.

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

Build succeeded for 0 out of 1 (1 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/62e41ef10b452bb177eeb4c9d67484c7 for a full test report.

Reworded the debug message a bit:

Python version (3.12.3) on the system is newer than the maximum supported Python version specified in the easyconfig (3.11)

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

  • SUCCESS ReFrame-4.6.2.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/1a18889f623416471276207030f5d75f for a full test report.

@bedroge
Copy link
Contributor

bedroge commented Sep 6, 2024

@casparvl I did a search for pick_python_cmd, and found that there are unit tests for this function. So it would be good to add some additional ones here https://github.com/easybuilders/easybuild-easyblocks/blob/develop/test/easyblocks/module.py#L227.

edit: added two tests in casparvl#4.

@boegel boegel added this to the 4.x milestone Sep 7, 2024
Add two tests for the max_py_* parameters
@casparvl
Copy link
Contributor Author

@bedroge I merged your unit test. Is there anything else that needs to be done for this PR to be merged? :)

Copy link
Contributor

@bedroge bedroge left a comment

Choose a reason for hiding this comment

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

Lgtm

@bedroge bedroge modified the milestones: 4.x, release after 4.9.3 Sep 17, 2024
@bedroge
Copy link
Contributor

bedroge commented Sep 17, 2024

Test report by @bedroge

Overview of tested easyconfigs (in order)

  • SUCCESS pyBigWig-0.3.22-gfbf-2023a.eb
  • SUCCESS PyYAML-6.0-GCCcore-12.2.0.eb
  • SUCCESS sktime-0.25.0-gfbf-2023a.eb
  • SUCCESS NiBabel-4.0.2-foss-2022a.eb
  • SUCCESS ReFrame-4.6.2.eb

Build succeeded for 5 out of 5 (5 easyconfigs in total)
bob-Latitude-5300 - Linux Ubuntu 24.04.1 LTS (Noble Numbat), x86_64, Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, Python 3.12.3
See https://gist.github.com/bedroge/e084b7ecccf94c2730b4362c9e8887d3 for a full test report.

@bedroge bedroge merged commit 1ca6dc3 into easybuilders:develop Sep 17, 2024
41 checks passed
@boegel boegel modified the milestones: release after 4.9.3, 4.9.4 Sep 19, 2024
@Flamefire
Copy link
Contributor

@casparvl What is the intended semantic for specifying only a major version? I would expect that max_py_majver = 3 would accept any Python 3 version. Or maybe more sensible: max_py_majver = 2 would only exclude Python 3. Currently the implementation seems to check for < max_py_majver, which means Python 3.1 and Python 2.1 respectively would be excluded.

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