Skip to content
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

Update python.md #23669

Merged
merged 7 commits into from Mar 20, 2017
Merged

Update python.md #23669

merged 7 commits into from Mar 20, 2017

Conversation

qknight
Copy link
Member

@qknight qknight commented Mar 9, 2017

this makes it clear how to alter attributes by using packageOverrides

this makes it clear how to alter `attributes` by using `packageOverrides`
@mention-bot
Copy link

@qknight, thanks for your PR! By analyzing the history of the files in this pull request, we identified @FRidh, @alexeymuranov and @bennofs to be potential reviewers.


```nix
nixpkgs.config.packageOverrides = super: {
pythonPackages = super.pythonPackages // { bepasty-server = super.python27Packages.bepasty-server.overrideAttrs (oldAttrs: {
Copy link
Contributor

Choose a reason for hiding this comment

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

not quite sure if we should recommend this, since this will not affect dependent python packages. A better approach is this, I believe:

pythonPackages = super.pythonPackages.override {
  overrides = self: super: {
    bepasty-server = super.bepasty-server.overrideAttrs { ... }
  };
}

src = pkgs.fetchgit {
url = "https://github.com/bepasty/bepasty-server";
sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
#sha256 = "5ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
Copy link
Member

Choose a reason for hiding this comment

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

remove old urls and fix indentation

@FRidh
Copy link
Member

FRidh commented Mar 9, 2017

A couple more comments:

  • There is a whole section on overriding just below this piece. It would be better to either include it there, or, at the very least, put it below it instead of above it.
  • bepasty-server is an unfortunate example. That package shouldn't be in pythonPackages because its not a Python library.
  • You're using super for both 'layers'. Maybe its better to use a different name for each layer.

@qknight
Copy link
Member Author

qknight commented Mar 10, 2017

@FRidh

  • i've put it last as merging it into the paragraph is too much for me ATM
  • bepasty-server, as an example, might be not the best but i have tested it with it
  • the remark on super usage is alright, good point! i've renamed it to superP, better ideas?

@qknight qknight merged commit 91debcb into master Mar 20, 2017
@qknight
Copy link
Member Author

qknight commented Mar 20, 2017

thanks everyone for the feedback!

globin pushed a commit that referenced this pull request Mar 21, 2017
* Update python.md

this makes it clear how to alter `attributes` by using `packageOverrides`

* Update python.md

* Update python.md

* Update python.md

* Update python.md

* Update python.md

* Update python.md

(cherry picked from commit 91debcb)
@FRidh FRidh mentioned this pull request Jun 5, 2017
6 tasks
@wizeman wizeman deleted the qknight-overrideAttrs branch October 30, 2017 15:20
@grahamc grahamc restored the qknight-overrideAttrs branch October 30, 2017 15:55
@grahamc grahamc deleted the qknight-overrideAttrs branch March 11, 2018 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants