Skip to content

doc: use idiomatic overlay names in the python manual example#87440

Merged
bhipple merged 1 commit into
NixOS:masterfrom
bhipple:doc/py-manual
May 10, 2020
Merged

doc: use idiomatic overlay names in the python manual example#87440
bhipple merged 1 commit into
NixOS:masterfrom
bhipple:doc/py-manual

Conversation

@bhipple

@bhipple bhipple commented May 9, 2020

Copy link
Copy Markdown
Contributor

An overlay by any other name would function just as well, but we generally use
self: super: for the regular overlays, and python-self: python-super.

Another improvement after reading thorugh the docs from #87094

An overlay by any other name would function just as well, but we generally use
`self: super:` for the regular overlays, and `python-self: python-super`.
@bhipple bhipple requested a review from FRidh as a code owner May 9, 2020 22:04
@ofborg ofborg Bot added 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels May 9, 2020
@jonringer

Copy link
Copy Markdown
Contributor

since this is a python-overrides, this makes sense

@bhipple bhipple merged commit bc8e621 into NixOS:master May 10, 2020
newpkgs = import pkgs.path { overlays = [ (self: super: {
python38 = let
packageOverrides = python-self: python-super: {
numpy = python-super.numpy_1_18.3;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo

python-super.numpy_1_18.3

Point is incorrect, and this package does not exist. Note also that, if we add a version, we try to be as unspecific as possible. Patch version you typically do not want to pin to, but major or minor you would. This, numpy_1_18 is a better value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Argh, you're right. I also don't particularly like this example, as most of the time we just have 1 version of a package and the "real" way you have to do it is by using overrideAttrs to re-fetch pypi and your src.

Ideally we'd either make it the more heavyweight example (with the full src fetch on the chosen version), or swap it to an example showing how to do something like build pytorch with cuda (except that doesn't work at the moment and is proprietary).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

overridePythonAttrs ;-) NixOS/rfcs#67

@bhipple bhipple deleted the doc/py-manual branch June 2, 2020 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants