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

Fix python3 find package #394

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Fix python3 find package #394

merged 1 commit into from
Nov 26, 2024

Conversation

hjmjohnson
Copy link
Member

Update to remove deprecated find_package(PythonLib) and find_package(PythonInterp) and the associated variables.

Use find_package(Python3) and its associated variables.

@github-actions github-actions bot added area:Bridge Issues affecting the Bridge module area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Nonunit Issues affecting the Nonunit module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module language:C++ Changes to C++ examples type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots labels Aug 19, 2022
@hjmjohnson hjmjohnson force-pushed the fix-python3-find_package branch from 06edc67 to 035576e Compare August 19, 2022 19:55
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Mostly looks good.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
Superbuild/External-Python.cmake Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
@hjmjohnson hjmjohnson force-pushed the fix-python3-find_package branch from 035576e to 37fdc68 Compare August 19, 2022 20:29
@hjmjohnson
Copy link
Member Author

@dzenanz Thanks for the comment. I made this change, and also will be forcing ITK to 3.7 or greater soon.

@github-actions
Copy link

github-actions bot commented Aug 19, 2022

🎉 Published on https://examples.itk.org as production
🚀 Deployed on https://630001dd3a95cb430f50e569--itkexamples.netlify.app

@hjmjohnson hjmjohnson force-pushed the fix-python3-find_package branch from 37fdc68 to e79ccd9 Compare August 20, 2022 18:56
@thewtex
Copy link
Member

thewtex commented Dec 8, 2022

@hjmjohnson could this please be rebased on master?

@jhlegarreta
Copy link
Member

jhlegarreta commented Jan 12, 2023

@dzenanz Thanks for the comment. I made this change, and also will be forcing ITK to 3.7 or greater soon.

The CI workflow already uses 3.9,
https://github.com/InsightSoftwareConsortium/ITKSphinxExamples/blob/master/.github/workflows/build-test-publish.yml#L37

and Python 3.7 is 5 months from deprecation, so if a minimum version needs to be enforced, maybe it should be 3.8. At the same time:

  • We are 11 months away from 3.8 deprecation
  • I have also the feeling that many have jumped to 3.10 from 3.8, so not sure if 3.9 has been a widely adopted version.

@hjmjohnson hjmjohnson force-pushed the fix-python3-find_package branch from e79ccd9 to 22a225c Compare August 8, 2023 13:43
@hjmjohnson hjmjohnson force-pushed the fix-python3-find_package branch from 22a225c to 9bef98e Compare November 25, 2024 15:49
@hjmjohnson
Copy link
Member Author

FYI:

ccmake -GNinja -B  ~/Dashboard/src/SphinxExamples-bld -S ~/Dashboard/src/ITK/Modules/Remote/SphinxExamples; 
cd  ~/Dashboard/src/SphinxExamples-bld && ninja

This builds successfully.

@hjmjohnson hjmjohnson force-pushed the fix-python3-find_package branch 2 times, most recently from e40bf6e to 0ac20c0 Compare November 25, 2024 16:42
@hjmjohnson
Copy link
Member Author

This is also working:

 ccmake "-DCMAKE_BUILD_TYPE:STRING=Release" "-GNinja" -B SphinxExamples-bld -S ~/Dashboard/src/ITK/Modules/Remote/SphinxExamples/Superbuild
 cd SphinxExamples-bld
 ninja

Now that cmake FindPython3 can be universally
used, prefer to only use that set of variable
names for identifying the python executables.

Intial procesing with manual cleanup by:

ITK/Utilities/Maintenance/FindPython3_ModernizeCMake.sh

Finding the correct python version should always respect the
Python3_ROOT_DIR variable provided during building.
@hjmjohnson hjmjohnson force-pushed the fix-python3-find_package branch from 0ac20c0 to 54c4d29 Compare November 25, 2024 22:26
@github-actions github-actions bot removed the language:C++ Changes to C++ examples label Nov 25, 2024
@hjmjohnson hjmjohnson requested a review from dzenanz November 26, 2024 02:01
@hjmjohnson hjmjohnson requested a review from thewtex November 26, 2024 02:01
@hjmjohnson
Copy link
Member Author

This works locally, but the GitHub actions are all broken for all PRS.

@hjmjohnson hjmjohnson merged commit c84d33b into master Nov 26, 2024
6 of 24 checks passed
@hjmjohnson hjmjohnson deleted the fix-python3-find_package branch November 26, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Bridge Issues affecting the Bridge module area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Nonunit Issues affecting the Nonunit module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants