Skip to content

python3Packages.bootstrapped-build: to replace pip #105714

Closed
FRidh wants to merge 3 commits intoNixOS:masterfrom
FRidh:bootstrapped-build
Closed

python3Packages.bootstrapped-build: to replace pip #105714
FRidh wants to merge 3 commits intoNixOS:masterfrom
FRidh:bootstrapped-build

Conversation

@FRidh
Copy link
Member

@FRidh FRidh commented Dec 2, 2020

build is a lightweight PEP 517 frontend for building wheels that could
replace pip for this purpose.

installer is a new project for installing wheels.

Why replace pip with build and installer? pip has a large
codebase 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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

TODO

@FRidh FRidh added the 6.topic: python Python is a high-level, general-purpose programming language. label Dec 2, 2020
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haven't implemented yet

Copy link
Member Author

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.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Dec 2, 2020
Copy link
Member

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.

@stale
Copy link

stale bot commented Jul 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 19, 2021
@FRidh FRidh force-pushed the bootstrapped-build branch from 6dfd0ca to 9c245d9 Compare January 16, 2022 13:38
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 16, 2022
@FRidh
Copy link
Member Author

FRidh commented Jan 16, 2022

Managed to get bootstrapping going with build and installer!

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 16, 2022
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a 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.

Comment on lines 59 to 62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"
'';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'';
'';
meta = {
description = "Package for bootstrapping the Python packages set.";
maintainers = [ lib.maintainers.fridh ];
};

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
data = map (drv: lib.getAttrs ["pname" "src" ] drv) runtimeDeps;
data = map (drv: lib.getAttrs [ "pname" "src" ] drv) runtimeDeps;

Comment on lines +83 to +86
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

@FRidh FRidh mentioned this pull request Jan 17, 2022
13 tasks
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 26, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 31, 2022
@FRidh FRidh force-pushed the bootstrapped-build branch from 1a47d88 to f77e33a Compare October 27, 2022 15:37
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 27, 2022
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 27, 2022
@ofborg ofborg bot requested a review from veehaitch October 27, 2022 16:21
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. and removed 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Oct 27, 2022
@FRidh
Copy link
Member Author

FRidh commented Aug 1, 2023

Superseded by #245509

@FRidh FRidh closed this Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments