PEP 582: Tweek sysconfig and path details, and add some minor clarifications#3036
PEP 582: Tweek sysconfig and path details, and add some minor clarifications#3036FFY00 wants to merge 6 commits into
sysconfig and path details, and add some minor clarifications#3036Conversation
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Filipe Laíns <lains@riseup.net>
CAM-Gerlach
left a comment
There was a problem hiding this comment.
A handful of editorial comments
| Specifically, both of the ``purelib`` and ``platlib`` directories must be | ||
| present, using the following code to determine the locations of those | ||
| directories:: | ||
| according to a new ``local_packages`` scheme in the sysconfig module. The scheme |
There was a problem hiding this comment.
While you're at it, would be good to either link sysconfig to the canonical current docs:
| according to a new ``local_packages`` scheme in the sysconfig module. The scheme | |
| according to a new ``local_packages`` scheme in the :mod:`sysconfig` module. The scheme |
or at least mark it as a literal, like you do elsewhere:
| according to a new ``local_packages`` scheme in the sysconfig module. The scheme | |
| according to a new ``local_packages`` scheme in the ``sysconfig`` module. The scheme |
|
|
||
| .. note:: There is a possible option of having a separate new API, it is documented at `issue #3013 <https://github.com/python/peps/issues/3013>`_. | ||
|
|
||
| An absolute version of these two locations will be added to ``sys.path``, other |
There was a problem hiding this comment.
| An absolute version of these two locations will be added to ``sys.path``, other | |
| An absolute version of these two locations will be added to ``sys.path``; other |
Fix grammar error (comma splice)
|
|
||
| An absolute version of these two locations will be added to ``sys.path``, other | ||
| directories or files in the ``__pypackages__`` directory will be silently | ||
| ignored. The paths will be based on Python versions. |
There was a problem hiding this comment.
Maybe I'm just dumb, but what does "based on Python versions" mean here, specifically? This seems rather vague for a specification.
| .. note:: | ||
|
|
||
| There is a possible option of having a separate new API, to avoid | ||
| `sysconfig` having to provide other scheme paths. It is documented in |
There was a problem hiding this comment.
| `sysconfig` having to provide other scheme paths. It is documented in | |
| ``sysconfig`` having to provide other scheme paths. It is documented in |
Fix reST syntax mistake (that sphinx-lint would catch, but that check wasn't enabled for some reason).
| The following shows an example project directory structure, and different ways | ||
| the Python executable and any script will behave. The example is for Unix-like | ||
| systems - on Windows the subdirectories will be different. | ||
| systems - on Windows the subdirectories can be different. |
There was a problem hiding this comment.
| systems - on Windows the subdirectories can be different. | |
| systems --- on Windows the subdirectories can be different. |
Minor typographical nit, but should be an em dash rather than a hyphen here
| systems - on Windows the subdirectories will be different. | ||
| systems - on Windows the subdirectories can be different. | ||
|
|
||
| :: |
There was a problem hiding this comment.
| :: | |
| .. code-block:: text |
Add the appropriate lexer name for non-Python code (or should this be treated as pseudo-shell?
|
Thanks for the review CAM! I just kept the current formatting, but am happy to go over the whole document and fix this everywhere if Kushal doesn't have any issue with that. |
|
Just to make sure we're on the same page, the first review comment (the formatting suggestion) was really just a tip/hint to let you know what was possible if you or @kushaldas want rather than requesting a specific change—that's totally up to you, of course, and you shouldn't feel pressured to go back and change it everywhere unless @kushaldas wants. The rest all fix syntax problems, grammar errors, and other minor issues as well as pointing out one added part I found unclear. As a standard reminder, N.B., the other suggestions can be batch-applied with |
|
@FFY00 I don't have permission to push to this branch, but you can try this to resolve the conflict: git checkout 582-sysconfig-minor-tweaks
git fetch upstream
git merge upstream/main
git push |
|
Since the PEP has been rejected since, and Filipe is busy, I'm closing this. |
|
Thanks. I should have done it earlier when the PEP was rejected. |
@kushaldas I have a couple changes here, mostly related to
sysconfig. Could you have a look?Changes:
sysconfigscheme fromlocalpackagestolocal_packageslocal_packagesis only required to provide thepurelibandplatlibpathssysconfigby the time PEP 582 is released__pypackages__directory from thebase/platbasedefinitions__pypackages__/3.10/site-packagessys.pathos.chdirwill change the location of the__pypackages__, bypassing the mechanisms described in the security considerations sectionsysconfigAPIsysconfigAPI proposal to Kushal's fork, where it was moved to__pypackages__in the current directory will be ignored when running a script, that we mean when running a script from a different path__pypackages__from the current directory📚 Documentation preview 📚: https://pep-previews--3036.org.readthedocs.build/