brettcannon / python-launcher

Python launcher for Unix

Home Page:https://python-launcher.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No configurations support (or undocumentd) aka py.ini

ssbarnea opened this issue · comments

While official Python documentation mentions where py.ini can be loaded from and what you can configure inside, the unix python-launcher does not see to have any support for it, or lacks documentation.

I reached this while trying to configure py on macos to prefer using the latest release of python instead of using the latest pre-release (which obviously does not work with most tools).

py --list
 3.12 │ /usr/local/bin/python3.12    
 3.11 │ /opt/homebrew/bin/python3.11 
 3.10 │ /opt/homebrew/bin/python3.10 
 3.9  │ /opt/homebrew/bin/python3.9  
 3.8  │ /opt/homebrew/bin/python3.8  

I created a py.ini in user home with expected config but it was not loaded. Should I assume that python-launcher already knowns to use XDG standard. (XDG_CONFIG_HOME) and look for confing in ~/.config/py.ini or similar? I tried to run with verbose mode but apparently --list does not even accept that argument.

$ py --list -vv      
The `--list` flag must be specified on its own; see `py --help` for details
FAIL: 64

Later I found that export PYLAUNCH_DEBUG=1 added some extra debugging info and I attempted to trick py to default to another version of python using the documented environment variables:

export PY_PYTHON=3.11
export PY_PYTHON3=3.11

While this works, I still think that lack of config file support is a bug, probably the missing -v too.