-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3Packages.bootstrapped-build: to replace pip #105714
Conversation
substitutions = { | ||
inherit pythonInterpreter pythonSitePackages; | ||
}; | ||
} ./build-build-hook.sh) {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't implemented yet
runHook preInstall | ||
|
||
export PYTHONPATH="$(ls | tr '\n' '\:'):''${PYTHONPATH:-}" | ||
for pkg in $(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \;); do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for every runtime dep of build
we create a wheel and install it. This requires the build backends to be available already. We probably end up needing to add setuptools and flit here as well.
@@ -46,6 +46,15 @@ in rec { | |||
}; | |||
} ./flit-build-hook.sh) {}; | |||
|
|||
buildBuildHook = callPackage ({ build, wheel }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That name is not that nice.
I marked this as stale due to inactivity. → More info |
6dfd0ca
to
9c245d9
Compare
Managed to get bootstrapping going with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some random style comments mostly for when you are done with the implementation.
export PYTHONPATH="$(pwd)/installer/src:$(pwd)/wheel/src:$(pwd)/build/src:$(pwd)/setuptools/pkg_resources:$PYTHONPATH" | ||
|
||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export PYTHONPATH="$(pwd)/installer/src:$(pwd)/wheel/src:$(pwd)/build/src:$(pwd)/setuptools/pkg_resources:$PYTHONPATH" | |
''; | |
export PYTHONPATH="$(pwd)/installer/src:$(pwd)/wheel/src:$(pwd)/build/src:$(pwd)/setuptools/pkg_resources:$PYTHONPATH" | |
''; |
|
||
postFixup = '' | ||
wrapPythonPrograms | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
''; | |
''; | |
meta = { | |
description = "Package for bootstrapping the Python packages set."; | |
maintainers = [ lib.maintainers.fridh ]; | |
}; |
# json = builtins.toFile "instructions.json" (builtins.toJSON data); | ||
srcs = with lib; catAttrs "src" runtimeDeps; | ||
in stdenv.mkDerivation rec { | ||
name = "${python.libPrefix}-bootstrapped-build-installer"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice if we had some version attribute but honestly I have no idea what we should use because this is just a collection of files.
installer | ||
]; | ||
# runtimeDeps = lib.remove python (requiredPythonModules [ build installer setuptools wheel ]); | ||
data = map (drv: lib.getAttrs ["pname" "src" ] drv) runtimeDeps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data = map (drv: lib.getAttrs ["pname" "src" ] drv) runtimeDeps; | |
data = map (drv: lib.getAttrs [ "pname" "src" ] drv) runtimeDeps; |
if [[ -d $pkg ]]; then | ||
echo "Building $pkg wheel" | ||
${python.pythonForBuild.interpreter} -m build --wheel "$pkg" --no-isolation --skip-dependency-check | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally shell inside of nix files is intended with 2 spaces.
strictDeps = true; | ||
|
||
nativeBuildInputs = [ | ||
unzip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
1a47d88
to
f77e33a
Compare
Superseded by #245509 |
build
is a lightweight PEP 517 frontend for building wheels that couldreplace pip for this purpose.
installer
is a new project for installing wheels.Why replace
pip
withbuild
andinstaller
?pip
has a largecodebase doing many more things, and it vendors its dependencies.
See also https://github.com/FFY00/python-bootstrap
Might become significantly simpler if pypa/flit#511 is merged.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)TODO
bootstrapped-build
bootstrapped-build-installer
pipInstallFlags = [ "--ignore-installed" ];
for eachbootstrapped-build
dep