-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
dmt-core: init at 2.1.0 #320189
base: master
Are you sure you want to change the base?
dmt-core: init at 2.1.0 #320189
Conversation
Please revisit Contributing to Nixpkgs, and be more mindful of notifying / requesting review from specific users. see the discourse page or matrix channel for requesting reviews. |
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.
the use of an overlay, odd formatting and unexplained shell.nix
? would like justification/explanation.
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.
Basically what @
fsnkty said. Just writing text here to suite GHs requirement to give a reason to "Request Changes".
I will also repeat the review related bullet points here, that I gave you in the discord this morning:
- Not like that! Please take a look at the contribution guidelines. (linked by
@
fsnkty) - Don't use overlays
- Don't reimport nixpkgs
- Don't provide a shell
- prefer
pkgs/by-name
- unless this is really a python package, then use
pythonPackages
- remember to add yourself to the
maintainers.nix
file if you haven't already
I also removed Sandro, as I do not think that they will say anything different in the current state of the PR
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.
Probably also want to look at other packages built with python and the nixpkgs manual; if dmt-core is not used for its modules, then buildPythonApplication would be preferable (and note some of the other guidelines mentioned in the manual)
Thanks for the feedback everyone. I will rewrite this. It was my understanding that I needed an overlay but it doesn't seem to be necessary here. |
The formatting is the result of |
bf87ec4
to
5572f2d
Compare
pkgs/by-name/dm/dmt-core/package.nix
Outdated
{ lib, buildPythonApplication, fetchurl, fetchPypi, pythonPackages }: | ||
|
||
let | ||
reprint = buildPythonApplication rec { |
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.
is this a python module? and in any case, why not package it separately?
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.
It is. Which is why my initial commit was an overlay. It's used as a dependency. I don't see it as necessary for the time being.
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.
Never said anything about an overlay, overlays are for when you can't just modify nixpkgs itself - but we are in the nixpkgs repo, we can modify nixpkgs itself.
I'm saying these are probably best packaged in separate files.
And as they are modules, not applications, we'd not use pkgs/by-name for those, nor buildPythonApplication.
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'm receiving conflicting feedback in that case because my initial PR didn't use pkgs/by-name. The description even notes that it's a lib. I'm not sure if anyone is reading it. I'll make those modifications.
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.
There's no conflicting feedback here. Nobbz said
prefer pkgs/by-name
unless this is really a python package, then use pythonPackages
The phrasing to use pythonPackages
was incorrect, it should've been python3Packages
. Other than that, we are in agreement; if it's used for its modules, as I said earlier, then it stays in python-modules. If it's simply a binary, then it goes in pkgs/by-name.
So you need dmt-core in pkgs/by-name using buildPythonApplication, while reprint and verilogae go in python-modules using buildPythonPackage, if I understood the purpose of these packages correctly.
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.
The phrasing to use pythonPackages was incorrect, it should've been python3Packages
Yeah, my fault, pythonPackages
belong in python2-modules
and python3Packages
in python-modules
, I hate whoever came up with that…
Though in general I used "pythonPackages
" as the generic name for "the relevant pythonXPackages
"
reprint = buildPythonApplication rec { | ||
pname = "reprint"; | ||
version = "0.6.0"; | ||
src = fetchurl { |
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.
Prefer fetchPypi
, and use hash
instead of sha256
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've had trouble using fetchPypi
It's what I used earlier but lots of 404 despite following the recommendations in the documentation. Also, DMT_core is the package name as formatted in PyPi. dmt-core will fail.
verilogae = buildPythonApplication rec { | ||
pname = "verilogae"; | ||
version = "1.0.0"; | ||
src = fetchurl { |
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.
Same as reprint
Did you try building this on your own machine before pushing? Because it fails for at least two immediate reasons - |
Yes I was able to build without issues. Good to know |
What exact command did you use to test building? |
|
Don't callPackage it manually, the whole point of having nixpkgs is that people don't have to run that themselves. Please use the command I provided. |
No, pkgs/by-name already handles callPackage-ing, and outside of that, the callPackage-ing is done in the appropriate pkgs/top-level/*.nix files. We really need to just stick to using Also, I'd appreciate not providing misleading and duplicate feedback on the PR, as this will cause more confusion and frustration. |
Co-authored-by: V. <[email protected]> Co-authored-by: éclairevoyant <[email protected]>
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.
Formalizing my response from the discord PR thread:
- Please extract the dependencies into their own (python) packages
- Please make sure you are following the contribution guideline, especially the part about how commits should be seperated and named. Squash and force push to fix that.
And… It just happened that I looked at the upstream repo, to figure out what the main scripts name was, also built and tried to check the build output… There doesn't seem to be any mention of a runnable program in the repo, nor is one in the build output. This seem to be a library not an application, please package this as a python module, not at the top-level! |
Yes, this is a library. That's why I was confused about the request to move it under |
Description of changes.
Init dmt-core lib.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.