From 46a4f7d85b843803626b80c6e0ad28407a01dc03 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 14 May 2026 10:27:38 -0700 Subject: [PATCH 1/7] CFEP: Unixy layout for python on windows --- cfep-xx.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 cfep-xx.md diff --git a/cfep-xx.md b/cfep-xx.md new file mode 100644 index 0000000..29c5207 --- /dev/null +++ b/cfep-xx.md @@ -0,0 +1,99 @@ + + + + + + + + +
Title A more unixy layout for cpython on windows
Status Proposed
Author(s) Isuru Fernando <ifernando@openteams.comgt;
Created May 14, 2026
Updated May 14, 2026
Discussion https://github.com/conda-forge/python-feedstock/issues/860
Implementation NA
+ +## Abstract + +A more unixy layout for cpython package and downstreams on windows +is proposed changing the places where python headers, libraries, +site-packages and stdlib are placed. This proposal is for upcoming +python 3.15 release and is not intended to be backported to older +python releases. + +## Motivation + +Currently, the package layout for all conda packages +are dictated by the python package. All C/C++ libraries, header +files end up in /Library because is +reserved for python because of its pecularities on windows. +This CFEP proposes changing this so that other libraries can use +/lib, /include if they choose to. + +## Specification + +| Component | Current | Proposed | Unix reference | +| -------------------- | ----------------- | ------------------------ | ------------------------------ | +| purelib/platlib | Lib/site-packages | lib/python/site-packages | lib/python3.14t/site-packages | +| scripts | Scripts | Scripts | bin | +| stdlib/platstdlib | Lib | lib/python | lib/python3.14t | +| include/platinclude | include | include/python | include/python3.14t | +| platlibdir | DLLs | DLLs | lib (not used) | + +## Implementation + +### python package support + +We propse implementing this CFEP for python 3.15 and up. +This can be implemented by adding a `nt_conda` install scheme to [sysconfig]( +https://github.com/python/cpython/blob/v3.15.0b1/Lib/sysconfig/__init__.py#L28-L60) +and then making it the default. + +See [debian patch](https://salsa.debian.org/cpython-team/python3/-/blob/python3.14/debian/patches/sysconfig-debian-schemes.diff?ref_type=heads) to see how they override the scheme to +make the distinction between `dist-packages` (apt installed python packages) +and `site-packages` (pip installed python packages). + +### conda support + +conda does not care where `stdlib/platstdlib`, `platlibdir` and +`include/platinclude` are in the directory structure. conda does care about +the other two components. + +1. purelib/platlib + + For this case we have `python_site_packages_path` and therefore all conda + clients support this. + +2. scripts + + We are intentionally not changing the layout here because there's no way to + tell conda to install things here for `noarch: python` packages. + I propose adding a `python_scripts_path` as a CEP and use that in a future + release, but is out of scope for this CFEP. + +## Rationale for locations + +1. purelib/platlib + + This matches unix, but removes the version and ABI flags. This is done to + have a version neutral location like it is in current windows layout. + Note: the author would also like to change the unix reference to match + the proposed windows layout, but is out-of-scope for this CFEP. + +2. scripts + + No change because of conda limitation. See the previous section + +3. stdlib/platstdlib + + Same rationale as purelib/platlib + +4. include/platinclude + + Same rationale as purelib/platlib + +5. platlibdir + + These are internal places where `.pyd` and `py.ico` are installed and is + internal to cpython package. The dir `DLLs` does not interfere with any + other package, so we propose to defer the decision to conda-forge/python + maintainers. + +## Copyright + +All CFEPs are explicitly [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/). From 543977c564fa8a7bbf3eb777a99822eecdff7312 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 14 May 2026 11:32:53 -0700 Subject: [PATCH 2/7] Review from Jaime Co-authored-by: jaimergp --- cfep-xx.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cfep-xx.md b/cfep-xx.md index 29c5207..0b9d9fa 100644 --- a/cfep-xx.md +++ b/cfep-xx.md @@ -21,7 +21,7 @@ python releases. Currently, the package layout for all conda packages are dictated by the python package. All C/C++ libraries, header files end up in /Library because is -reserved for python because of its pecularities on windows. +reserved for python due to its peculiarities on windows. This CFEP proposes changing this so that other libraries can use /lib, /include if they choose to. @@ -39,7 +39,7 @@ This CFEP proposes changing this so that other libraries can use ### python package support -We propse implementing this CFEP for python 3.15 and up. +We propose implementing this CFEP for CPython 3.15 and up. This can be implemented by adding a `nt_conda` install scheme to [sysconfig]( https://github.com/python/cpython/blob/v3.15.0b1/Lib/sysconfig/__init__.py#L28-L60) and then making it the default. @@ -50,9 +50,11 @@ and `site-packages` (pip installed python packages). ### conda support -conda does not care where `stdlib/platstdlib`, `platlibdir` and -`include/platinclude` are in the directory structure. conda does care about -the other two components. +conda clients are only concerned with the location of the `scripts` and +`purelib`/`platlib` components. The former needs to be added to `PATH`, +and the latter needs to be part of Python's `sys.path`. The others +(`stdlib/platstdlib`, `platlibdir` and`include/platinclude`) can be +changed without breaking anything. 1. purelib/platlib @@ -77,7 +79,7 @@ the other two components. 2. scripts - No change because of conda limitation. See the previous section + No change because of conda limitation. See the previous section. 3. stdlib/platstdlib @@ -90,7 +92,7 @@ the other two components. 5. platlibdir These are internal places where `.pyd` and `py.ico` are installed and is - internal to cpython package. The dir `DLLs` does not interfere with any + internal to cpython package. The directory `DLLs` does not interfere with any other package, so we propose to defer the decision to conda-forge/python maintainers. From 8339a9b7b6b56207189b78a441d6155d8abb33f5 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 14 May 2026 11:35:08 -0700 Subject: [PATCH 3/7] Update conda support and rm \r line endings --- cfep-xx.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cfep-xx.md b/cfep-xx.md index 0b9d9fa..4c51b71 100644 --- a/cfep-xx.md +++ b/cfep-xx.md @@ -50,11 +50,11 @@ and `site-packages` (pip installed python packages). ### conda support -conda clients are only concerned with the location of the `scripts` and -`purelib`/`platlib` components. The former needs to be added to `PATH`, -and the latter needs to be part of Python's `sys.path`. The others -(`stdlib/platstdlib`, `platlibdir` and`include/platinclude`) can be -changed without breaking anything. +conda clients are only concerned with the location of the `scripts` and +`purelib`/`platlib` components. The former needs to be added to `PATH` +and both are needed for placing files in the correct layout for +`noarch: python` pacakges. The others (`stdlib/platstdlib`, `platlibdir` +and `include/platinclude`) can be changed without breaking anything. 1. purelib/platlib @@ -79,7 +79,7 @@ changed without breaking anything. 2. scripts - No change because of conda limitation. See the previous section. + No change because of conda limitation. See the previous section. 3. stdlib/platstdlib @@ -92,7 +92,7 @@ changed without breaking anything. 5. platlibdir These are internal places where `.pyd` and `py.ico` are installed and is - internal to cpython package. The directory `DLLs` does not interfere with any + internal to cpython package. The directory `DLLs` does not interfere with any other package, so we propose to defer the decision to conda-forge/python maintainers. From d7c01bb84a10c11e49b98c984626bc789ea13f00 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 15 May 2026 13:25:23 -0700 Subject: [PATCH 4/7] Fix typos Co-authored-by: pb01ka --- cfep-xx.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cfep-xx.md b/cfep-xx.md index 4c51b71..45e2ea3 100644 --- a/cfep-xx.md +++ b/cfep-xx.md @@ -1,7 +1,7 @@ - + @@ -21,7 +21,7 @@ python releases. Currently, the package layout for all conda packages are dictated by the python package. All C/C++ libraries, header files end up in /Library because is -reserved for python due to its peculiarities on windows. +reserved for python due to its peculiarities on windows. This CFEP proposes changing this so that other libraries can use /lib, /include if they choose to. @@ -39,7 +39,7 @@ This CFEP proposes changing this so that other libraries can use ### python package support -We propose implementing this CFEP for CPython 3.15 and up. +We propose implementing this CFEP for CPython 3.15 and up. This can be implemented by adding a `nt_conda` install scheme to [sysconfig]( https://github.com/python/cpython/blob/v3.15.0b1/Lib/sysconfig/__init__.py#L28-L60) and then making it the default. @@ -53,7 +53,7 @@ and `site-packages` (pip installed python packages). conda clients are only concerned with the location of the `scripts` and `purelib`/`platlib` components. The former needs to be added to `PATH` and both are needed for placing files in the correct layout for -`noarch: python` pacakges. The others (`stdlib/platstdlib`, `platlibdir` +`noarch: python` packages. The others (`stdlib/platstdlib`, `platlibdir` and `include/platinclude`) can be changed without breaking anything. 1. purelib/platlib From aa07d70a24750da350447d23663cc1930d90a3af Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 15 May 2026 13:27:21 -0700 Subject: [PATCH 5/7] Add link --- cfep-xx.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cfep-xx.md b/cfep-xx.md index 45e2ea3..fe87037 100644 --- a/cfep-xx.md +++ b/cfep-xx.md @@ -22,6 +22,8 @@ Currently, the package layout for all conda packages are dictated by the python package. All C/C++ libraries, header files end up in /Library because is reserved for python due to its peculiarities on windows. +See [CEP 0034](https://github.com/conda/ceps/blob/main/cep-0034.md#windows) +for more details on the file system. This CFEP proposes changing this so that other libraries can use /lib, /include if they choose to. From 151fc76d6f2a91bf13e03b77a79a207c19d7068a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 15 May 2026 13:40:01 -0700 Subject: [PATCH 6/7] update example --- cfep-xx.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cfep-xx.md b/cfep-xx.md index fe87037..0fef042 100644 --- a/cfep-xx.md +++ b/cfep-xx.md @@ -31,10 +31,10 @@ This CFEP proposes changing this so that other libraries can use | Component | Current | Proposed | Unix reference | | -------------------- | ----------------- | ------------------------ | ------------------------------ | -| purelib/platlib | Lib/site-packages | lib/python/site-packages | lib/python3.14t/site-packages | +| purelib/platlib | Lib/site-packages | lib/python/site-packages | lib/python3.15t/site-packages | | scripts | Scripts | Scripts | bin | -| stdlib/platstdlib | Lib | lib/python | lib/python3.14t | -| include/platinclude | include | include/python | include/python3.14t | +| stdlib/platstdlib | Lib | lib/python | lib/python3.15t | +| include/platinclude | include | include/python | include/python3.15t | | platlibdir | DLLs | DLLs | lib (not used) | ## Implementation From 3eb9e338667640c58f44932ee594708e8b1e45fa Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 28 May 2026 14:40:39 -0700 Subject: [PATCH 7/7] Update specification --- cfep-xx.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cfep-xx.md b/cfep-xx.md index 0fef042..6ad21bf 100644 --- a/cfep-xx.md +++ b/cfep-xx.md @@ -35,7 +35,9 @@ This CFEP proposes changing this so that other libraries can use | scripts | Scripts | Scripts | bin | | stdlib/platstdlib | Lib | lib/python | lib/python3.15t | | include/platinclude | include | include/python | include/python3.15t | -| platlibdir | DLLs | DLLs | lib (not used) | +| dynload | DLLs | lib/python/lib-dynload | lib/python3.15t/lib-dynload | +| import libraries | lib | lib | lib | +| sys.executable | python.exe | python.exe | bin/python | ## Implementation @@ -91,12 +93,11 @@ and `include/platinclude`) can be changed without breaking anything. Same rationale as purelib/platlib -5. platlibdir +5. dynload These are internal places where `.pyd` and `py.ico` are installed and is internal to cpython package. The directory `DLLs` does not interfere with any - other package, so we propose to defer the decision to conda-forge/python - maintainers. + other package, so we propose use the same directory as unix. ## Copyright
Title A more unixy layout for cpython on windows
Status Proposed
Author(s) Isuru Fernando <ifernando@openteams.comgt;
Author(s) Isuru Fernando <ifernando@openteams.com>
Created May 14, 2026
Updated May 14, 2026
Discussion https://github.com/conda-forge/python-feedstock/issues/860