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

pythonPackages.mohawk: init at 1.1.0 #98336

Merged
merged 1 commit into from Sep 21, 2020
Merged

Conversation

austinbutler
Copy link
Member

@austinbutler austinbutler commented Sep 20, 2020

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 because requests-hawk is not packaged. And requests-hawk needs mohawk. So if this is correct my plan was to follow this PR up with requests-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
  • 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.

description = "Python library for Hawk HTTP authorization.";
homepage = "https://github.com/kumar303/mohawk";
license = licenses.mpl20;
maintainers = [ ];
Copy link
Contributor

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 :)

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

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".

Copy link
Contributor

Choose a reason for hiding this comment

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

pythonImportsCheck = [ "mohawk" ];

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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 from result

nix-shell -I nixpkgs=$PWD -p python3Packages.mohawk --run "python -c 'import mohawk'"

Copy link
Contributor

@jonringer jonringer left a 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

@jonringer jonringer merged commit 8be7347 into NixOS:master Sep 21, 2020
@austinbutler austinbutler deleted the mohawk branch September 26, 2020 18:10
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

2 participants