Message411657
| Author |
Frederik Rietdijk |
| Recipients |
FFY00, Frederik Rietdijk, christian.heimes, frenzy, hroncok, jakirkham, jaraco, lemburg, petr.viktorin, steve.dower, xrcg |
| Date |
2022年01月25日.18:24:36 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1643135076.65.0.362239541527.issue43976@roundup.psfhosted.org> |
| In-reply-to |
| Content |
In Nixpkgs we install every Python package under a unique prefix, a so-called Nix store path. If we were to use sysconfig for installing packages, then we'd need to be able to dynamically set the paths. This was also discussed as part of the Installer project. https://github.com/pradyunsg/installer/issues/98
We could use a custom scheme, however, we do need to be able to dynamically set a certain variable, e.g. `base`.
```
variables = {"installed_base": "$out", "base": "$out", "platbase": "$out", "installed_platbase": "$out"}
# Note there is no `sysconfig.get_default_scheme()`
sysconfig._expand_vars("posix_prefix", variables)
```
I could imagine we do something like
```
# check whether we're in a nix build and want to install in a prefix
if "IN_NIX_BUILD" in os.environ:
base = os.environ["out"]
scheme = {...}
```
We'd then need to update the base variable in sysconfig or partially expand our own scheme using this variable. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2022年01月25日 18:24:36 | Frederik Rietdijk | set | recipients:
+ Frederik Rietdijk, lemburg, jaraco, christian.heimes, petr.viktorin, steve.dower, hroncok, frenzy, FFY00, jakirkham, xrcg |
| 2022年01月25日 18:24:36 | Frederik Rietdijk | set | messageid: <1643135076.65.0.362239541527.issue43976@roundup.psfhosted.org> |
| 2022年01月25日 18:24:36 | Frederik Rietdijk | link | issue43976 messages |
| 2022年01月25日 18:24:36 | Frederik Rietdijk | create |
|