Repository navigation
add PyEnv and CMake FindPython caveats to pyenv reference - #4559
Conversation
| - **CMake FindPython search order**: by default, `FindPython <https://cmake.org/cmake/help/latest/module/FindPython.html>`_ does not | ||
| just look for ``python`` or ``python3`` in the ``PATH``. It also looks for *versioned* executables (like ``python3.13``), |
There was a problem hiding this comment.
I would rephrase it and just mention that a python in PATH is not always prioritised, and leave details aside, and follow that FindPython may prefer a different python installation.
| Conan does not set the ``VIRTUAL_ENV`` environment variable when generating the ``PyEnv`` environment, because it is read by Python | ||
| itself and it could interfere with other Python executions. |
There was a problem hiding this comment.
same as my earlier comment, I'd leave "details" out
The relevant info:
FindPythondoes not prioritisepython/python3in PATH (which is what the PyEnv generator exposes)- we need to set
Python_ROOT_DIRand possiblyPython_FIND_VIRTUALENV
| tc.cache_variables["Python_FIND_VIRTUALENV"] = "STANDARD" | ||
| tc.cache_variables["Python_ROOT_DIR"] = pyenv.env_dir |
There was a problem hiding this comment.
quick one here, have we double check that Python_FIND_VIRTUALENV is required in the presence of the env var being defined? I'd have thought that Python_ROOT_DIR gave that one the highest priority?
or if Python_EXECUTABLE skips the search, I would just document that one and not mention this
| tc.cache_variables["Python_FIND_UNVERSIONED_NAMES"] = "FIRST" | ||
| tc.cache_variables["Python_FIND_STRATEGY"] = "LOCATION" | ||
| tc.cache_variables["Python_FIND_REGISTRY"] = "NEVER" |
There was a problem hiding this comment.
if the above are sufficient, I would leave these out too - the goal is to provide the quickest way to guarantee that FindPython finds the one we want, these seem redundant
No description provided.