View previous topic :: View next topic |
Author |
Message |
SDD701 n00b
Joined: 18 Feb 2023 Posts: 20
|
Posted: Tue Jul 23, 2024 2:01 pm Post subject: Understanding multiple targets USE Expand |
|
|
Hi. Can anyone explain what exacly is PYTHON_TARGETS actually mean? As far as I get it I can launch a program using marked versions. For example if I emerge qtile with -python3_10 python3_11 python3_12 I can start it using python 11 and 12 but not 10. Is that correct? How can I switch versions? |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1908
|
Posted: Tue Jul 23, 2024 2:19 pm Post subject: |
|
|
Any executable python script installed with PYTHON_TARGETS set will be put behind python-exec2 (from dev-lang/python-exec) which figures out what version to call.
python-exec2 determines what version to run through a few factors in this order:
- First, if the EPYTHON environment variable is set, use that to determine which version to start.
- Next, if /etc/python-exec/$command.conf exists (where $command is what is called in the shell), use that file to determine which version to start.
- Finally, use the generic settings of /etc/python-exec/python-exec.conf defaults to determine what version to start. (In modern times, this should be controlled by dev-lang/python-exec-conf unless there's a good reason)
All of the above is considered for validity of supported version strings and availability by what the script was installed with. Each step falls through until a valid configuration is found or just flat out fails.
Using the example provided, EPYTHON="python3.11" qtile would be run under python 3.11 exclusively.
Packages which provide libraries for other python modules often need PYTHON_TARGETS to ensure multiple versions are available.
For simple scripts, it is more advantageous to consider using PYTHON_SINGLE_TARGET instead particularly for leaf packages. This only allows for a single version and is installed directly with its bangpath fixed. |
|
Back to top |
|
|
SDD701 n00b
Joined: 18 Feb 2023 Posts: 20
|
Posted: Tue Jul 23, 2024 4:16 pm Post subject: |
|
|
Thank you, now I understand the concept |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2397
|
|
Back to top |
|
|
|