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
pythonPackages.mohawk: init at 1.1.0 #98336
Conversation
description = "Python library for Hawk HTTP authorization."; | ||
homepage = "https://github.com/kumar303/mohawk"; | ||
license = licenses.mpl20; | ||
maintainers = [ ]; |
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.
please add yourself as a maintainer :)
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 can do this, but just to be clear this PR is purely from ZHF, I don't use this package or Alerta. As I noted in the second paragraph I don't even know how to test importing this package currently.
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.
ah, then you can skip it... but it's just nice to have someone who has context
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.
Cool, I will skip for now. Any suggestions on the equivalent of python3 -c "import mohawk"
but using mohawk from result
? Best I've come up with is PYTHONPATH=result/lib/python3.8/site-packages:/nix/store/md9ld5w5s4dkqkm0rjbsqrlzlhyjiq4y-python3.8-six-1.15.0/lib/python3.8/site-packages python -c "import mohawk"
.
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.
pythonImportsCheck = [ "mohawk" ];
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.
If tests are not available, then please use pythonImportsCheck
to import the most important modules. This isn't as good as unit tests, but will usually give a good indication of run-time errors. Please see pythonImportsCheck documentation for more information.
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's helpful, although I more so mean an interactive Python REPL outside of the .nix
file that can import from result
. But I don't want this to turn into a support thread, and I think the PR is ready at this point.
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.
Any suggestions on the equivalent of
python3 -c "import mohawk"
but using mohawk fromresult
nix-shell -I nixpkgs=$PWD -p python3Packages.mohawk --run "python -c 'import mohawk'"
6ae51cb
to
b072de4
Compare
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.
LGTM
Result of nixpkgs-review pr 98336 1
3 packages built:
- python27Packages.mohawk
- python37Packages.mohawk
- python38Packages.mohawk
Motivation for this change
This is actually part of getting the
alerta
Python package fixed. My understanding from the 20.09 Hydra failure is that Alerta is failing becauserequests-hawk
is not packaged. Andrequests-hawk
needsmohawk
. So if this is correct my plan was to follow this PR up withrequests-hawk
, then seeing if that fixes Alerta.This seems to pass all tests with all Python versions, however I am not sure how to actually try importing a Python package from
result
, so I haven't tested this even imports. I guess I could temporarily put a command into the check phase that just tries to import it, but I was hoping someone had some guidance on the best practice for this.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)