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

python3Packages.fastecdsa: init at 2.1.5 #99194

Merged
merged 1 commit into from Nov 12, 2020
Merged

Conversation

prusnak
Copy link
Member

@prusnak prusnak commented Sep 30, 2020

Motivation for this change

new python module for fast ecdsa operations

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.

buildInputs = [ gmp ];

# skip tests, most of them require being online to download test vectors
doCheck = false;
Copy link
Member

@mweinelt mweinelt Oct 1, 2020

Choose a reason for hiding this comment

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

There are two test files specifically that require downloading third-party files: https://github.com/AntonKueltz/fastecdsa/search?q=urlopen.

I believe it should be feasible to get the tests up and running using pytestCheckHook and

pytestFlags = [
   "--ignore=fastecdsa/tests/test_wycheproof_vectors.py"
   "--ignore=fastecdsa/tests/test_rfc6979_ecdsa.py"
];

Copy link
Member Author

@prusnak prusnak Oct 1, 2020

Choose a reason for hiding this comment

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

I did this, but now other tests fail with:

ImportError while importing test module '/build/fastecdsa-2.1.5/fastecdsa/tests/encoding/test_asn1.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
fastecdsa/tests/encoding/test_asn1.py:5: in <module>
    from fastecdsa.keys import export_key, import_key, gen_keypair
fastecdsa/keys.py:7: in <module>
    from .ecdsa import verify
fastecdsa/ecdsa.py:5: in <module>
    from fastecdsa import _ecdsa
E   ImportError: cannot import name '_ecdsa' from 'fastecdsa' (/build/fastecdsa-2.1.5/fastecdsa/__init__.py)

Any ideas why? /build/fastecdsa-2.1.5 looks spurious, but not sure where this is from ...

Copy link
Member

Choose a reason for hiding this comment

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

I guess that's because you are not building this: https://github.com/AntonKueltz/fastecdsa/tree/master/src

Copy link
Member Author

@prusnak prusnak Oct 1, 2020

Choose a reason for hiding this comment

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

That is mentioned in the setup.py and the following works if I skip the tests: from fastecdsa import _ecdsa , so I assume that is being built.

Copy link
Member

Choose a reason for hiding this comment

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

Right, I'm not sure then.

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 rebased this on top of the current master and now it works - included in c28e12b6b552b2b3fe48f2970eb03c3d2a277828

Copy link
Member

Choose a reason for hiding this comment

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

What is included? If the tests still don't work but the resulting package works, add a comment why you disabled them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, sorry. Brainfart - tests disabled and comment added in f70ecb6

@mweinelt
Copy link
Member

Result of nixpkgs-review pr 99194 1

3 packages built:
  • python27Packages.fastecdsa
  • python37Packages.fastecdsa
  • python38Packages.fastecdsa

@mweinelt mweinelt merged commit 5c79a18 into NixOS:master Nov 12, 2020
@prusnak prusnak deleted the fastecdsa branch November 12, 2020 23:22
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