[Python-Dev] Re: Improvements to the sys.path initialization documentation
On Mon, 7 Mar 2022, 7:42 pm Victor Stinner, wrote: > On Fri, Mar 4, 2022 at 1:37 PM Eryk Sun wrote: > > I don't understand. The site packages directories, including virtual > > environments, are a site extension. > > I propose to change that. Move all code related to sys.path from the > site module to the Modules/getpath.py module. > Certain entries not being on sys.path when the site module isn't loaded is a feature (the "-S" CLI option), not a bug to be fixed. Those site entries haven't historically been the really confusing part of path inititialisation - it's been finding out where all the *other* default entries are coming from, so you can get a clearer picture of what's always there vs what's being added by the site module. Cheers, Nick. > Victor > -- > Night gathers, and now my watch begins. It shall not end until my death. > ___ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/HXD2JIDHBX7BFIU3FA7R3LWRFEXQMVYW/ > Code of Conduct: http://python.org/psf/codeofconduct/ > ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/ICOGZEUBU7BAL25OUMMTFSJ2VSVVYN43/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Improvements to the sys.path initialization documentation
On Fri, Mar 4, 2022 at 1:37 PM Eryk Sun wrote: > I don't understand. The site packages directories, including virtual > environments, are a site extension. I propose to change that. Move all code related to sys.path from the site module to the Modules/getpath.py module. Victor -- Night gathers, and now my watch begins. It shall not end until my death. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/HXD2JIDHBX7BFIU3FA7R3LWRFEXQMVYW/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Improvements to the sys.path initialization documentation
Hi, I will add a link to https://docs.python.org/dev/c-api/init_config.html#python-path-configuration as we're trying to at least mention every way sys.path can be initialised. I think the audience for the C API docs are likely to be more knowledgeable than those reading the Setup and Usage section, so I don't believe it will be possible to merge the information. Thanks, Russel On Thu, 3 Mar 2022 at 12:27, Victor Stinner wrote: > Hi, > > I tried to document inputs and outputs of Modules/getpath.py in the C > API Initialization API: > > https://docs.python.org/dev/c-api/init_config.html#python-path-configuration > > I don't know if it would be possible to merge most of these > information at a single place to avoid oudated documentation. > > Victor > > On Wed, Mar 2, 2022 at 5:40 PM Russel Webber > wrote: > > > > Hi All, > > > > Steve Dower, Eryk Sun and I have been working on improving the > documentation around how sys.path is initialised and therefore how Python > modules are found. > > > > We're moving the details from > https://docs.python.org/3.11/using/windows.html#finding-modules > > to a platform-agnostic new section in > https://docs.python.org/3.11/using/cmdline.html > > > > We're aiming to have one place in the documentation where all the ways > to customize sys.path (PYTHONPATH, ._pth, site, etc) are at least mentioned. > > > > We'd appreciate further community feedback on the changes before they > are merged. > > https://bugs.python.org/issue31582 > > https://github.com/python/cpython/pull/31082 > > > > Thank you, > > Russel > > > > ___ > > Python-Dev mailing list -- python-dev@python.org > > To unsubscribe send an email to python-dev-le...@python.org > > https://mail.python.org/mailman3/lists/python-dev.python.org/ > > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/5AZQZH45EUCYN26SVD5DO6O7XTPSTIB5/ > > Code of Conduct: http://python.org/psf/codeofconduct/ > > > > -- > Night gathers, and now my watch begins. It shall not end until my death. > ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/4PI4A3GQIFYOH5QCNKYMOOOHL5K6JD7D/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Improvements to the sys.path initialization documentation
On 3/4/22, Victor Stinner wrote: > it would be nice to move the last bits of the sys.path initialization > from the site module to the getpath module. It's unpleasant to > have a different sys.path depending if the site module is loaded > or not. I don't understand. The site packages directories, including virtual environments, are a site extension. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/5ZO73YHNL3BHXY4MHRITOGOECL2SZKPO/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Improvements to the sys.path initialization documentation
Unrelated to the doc, now that getpath has been rewritten in pure Python, thanks to Steve Dower!, it would be nice to move the last bits of the sys.path initialization from the site module to the getpath module. It's unpleasant to have a different sys.path depending if the site module is loaded or not. site handles venv, computes absolute paths and adds the user directory. Loading customization modules (sitecustomize and usercustomize) should stay in the site module. Victor ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/4GZZ5PRP5YLZUVE34NYQQNUF4KBNMNNV/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Improvements to the sys.path initialization documentation
Hi, I tried to document inputs and outputs of Modules/getpath.py in the C API Initialization API: https://docs.python.org/dev/c-api/init_config.html#python-path-configuration I don't know if it would be possible to merge most of these information at a single place to avoid oudated documentation. Victor On Wed, Mar 2, 2022 at 5:40 PM Russel Webber wrote: > > Hi All, > > Steve Dower, Eryk Sun and I have been working on improving the documentation > around how sys.path is initialised and therefore how Python modules are found. > > We're moving the details from > https://docs.python.org/3.11/using/windows.html#finding-modules > to a platform-agnostic new section in > https://docs.python.org/3.11/using/cmdline.html > > We're aiming to have one place in the documentation where all the ways to > customize sys.path (PYTHONPATH, ._pth, site, etc) are at least mentioned. > > We'd appreciate further community feedback on the changes before they are > merged. > https://bugs.python.org/issue31582 > https://github.com/python/cpython/pull/31082 > > Thank you, > Russel > > ___ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/5AZQZH45EUCYN26SVD5DO6O7XTPSTIB5/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Night gathers, and now my watch begins. It shall not end until my death. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/Q5VGOJPJE67JKCMZO2CZBH6UFM7EMXDY/ Code of Conduct: http://python.org/psf/codeofconduct/