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

Add ledger_agent, trezor_agent and keepkey_agent packages #69153

Merged
merged 4 commits into from Nov 12, 2019

Conversation

hkjn
Copy link
Contributor

@hkjn hkjn commented Sep 20, 2019

Motivation for this change

Add new ledger_agent, trezor_agent and keepkey_agent packages, providing the binaries:

  • ledger-agent
  • ledger-gpg
  • trezor-agent
  • trezor-gpg
  • keepkey-agent

Also add hkjn as initial maintainer for pythonPackages.trezor_agent.

Edit: Updated description after changes from review feedback.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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.
Notify maintainers

cc @mmahut @np

@mmahut
Copy link
Member

mmahut commented Sep 20, 2019

This is the same source code as pythonPackages.trezor_agent do you mind integrating it from there and while at it, make the trezor-agent as the same way?

@mmahut
Copy link
Member

mmahut commented Sep 20, 2019

And probably keepkey while we are at it, for consistency.

@hkjn
Copy link
Contributor Author

hkjn commented Sep 20, 2019

This is the same source code as pythonPackages.trezor_agent do you mind integrating it from there and while at it, make the trezor-agent as the same way?

Thanks for the feedback and pointer to the existing pythonPackages.trezor_agent, which I somehow didn't notice, @mmahut! As you say, that package uses the same https://github.com/romanz/trezor-agent source code as is used in this PR in the ledger_agent.

I'll rephrase your suggestion to make sure I understood; is the aim to have a pythonPackages.trezor_agent define a single python package, that can be referenced in three top-level packages as follows?

  • pkgs/applications/misc/ledgeragent
  • pkgs/applications/misc/trezoragent
  • pkgs/applications/misc/keepkeyagent

I don't have Trezor or Keepkey devices accessible right now, so I can't fully test those changes, but if that's what you were suggesting I can make that change and we can hold off on merging until we can test the change fully.

Also, do you (and/or @np?) want to be added as a maintainer to these top-level packages? (I'm fine not being a maintainer too btw, depending on your preference, just put myself there in this PR to get things started.)

@mmahut
Copy link
Member

mmahut commented Sep 21, 2019

I'll rephrase your suggestion to make sure I understood; is the aim to have a pythonPackages.trezor_agent define a single python package, that can be referenced in three top-level packages as follows?

That is correct.

I don't have Trezor or Keepkey devices accessible right now, so I can't fully test those changes, but if that's what you were suggesting I can make that change and we can hold off on merging until we can test the change fully.

I think I can help with testing.

Also, do you (and/or @np?) want to be added as a maintainer to these top-level packages? (I'm fine not being a maintainer too btw, depending on your preference, just put myself there in this PR to get things started.)

Sure, yes, please. More maintainers the better :)

@hkjn
Copy link
Contributor Author

hkjn commented Sep 22, 2019

Thanks for the feedback @mmahut @worldofpeace, please take another look.

I'll rephrase your suggestion to make sure I understood; is the aim to have a pythonPackages.trezor_agent define a single python package, that can be referenced in three top-level packages as follows?

That is correct.

I couldn't figure out a way to achieve what you suggested here..

The issue is that the buildPythonPackage definition uses fetchPyPi to pull down the specific library, one of the ones below depending on which package we're building:

Because the top-level packages now are just using with python3Packages; toPythonApplication foo_agent; (thanks for the suggestion @worldofpeace), I don't see how to avoid having three python packages for the three pip projects we want to pull down.

As an aside, the listed versions above are the latest that have been published, but at https://github.com/romanz/trezor-agent the latest published version is 0.13.1.

cc @romanz, would it be possible to publish the latest release to pypi.org as well?

Also, do you (and/or @np?) want to be added as a maintainer to these top-level packages? (I'm fine not being a maintainer too btw, depending on your preference, just put myself there in this PR to get things started.)

Sure, yes, please. More maintainers the better :)

Cool, I've added the two of you and myself (hkjn mmahut np) to all three packages:

  • trezor_agent
  • ledger_agent
  • keepkey_agent

@hkjn hkjn changed the title ledgeragent: init at 0.9.0 Add ledger_agent, trezor_agent and keepkey_agent packages Sep 22, 2019
@ofborg ofborg bot requested review from np and mmahut September 22, 2019 15:08
@romanz
Copy link

romanz commented Sep 23, 2019

cc @romanz, would it be possible to publish the latest release to pypi.org as well?

The latest versions of specific agents' packages should be on PyPI, albeit under different versions than the libagent package (which contains the common library code).
For example, https://pypi.org/project/trezor-agent/ has 0.10.0 - which is the latest TREZOR agent release (see agents/trezor/setup.py).

Please let me know if I can fix the versioning to be more consistent and easier to follow :)

@hkjn
Copy link
Contributor Author

hkjn commented Sep 25, 2019

cc @romanz, would it be possible to publish the latest release to pypi.org as well?

The latest versions of specific agents' packages should be on PyPI, albeit under different versions than the libagent package (which contains the common library code).
For example, https://pypi.org/project/trezor-agent/ has 0.10.0 - which is the latest TREZOR agent release (see agents/trezor/setup.py).

Please let me know if I can fix the versioning to be more consistent and easier to follow :)

Ah, that versioning scheme makes sense, given that all four releaseable units (three agents + libagent) are in the same repo.

I guess my confusion came from the repo being named trezor-agent, but containing the code for all four releases. Perhaps we can add a note to either the Github releases for the repo, or the README.md? (I can send a PR, let's continue there.)

@mmahut
Copy link
Member

mmahut commented Sep 25, 2019

This looks good to me, @worldofpeace might confirm is there is a better way to do this.

@1000101 might help with ledger/keepkey testing.

The pythonPackages.trezor_agent existed since earlier, now we
also add a top-level package by making use of `toPythonApplication`.
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.

otherwise LGTM, weird that they have wheel in install_requires, should be in setup_requires... but that's an upstream issue

@mmahut
Copy link
Member

mmahut commented Nov 9, 2019

Sorry, this felt off my radar. I will try to get it tested with real hardware.

@hkjn
Copy link
Contributor Author

hkjn commented Nov 12, 2019

Thanks for the review, @jonringer!

Let me know if anyone has any remaining comments that have not been addressed, or otherwise how to progress with getting this PR merged.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Build them locally.

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.

nix-review passes on NixOS
diff LGTM
executables seem to work

[6 built, 271 copied (481.2 MiB), 106.8 MiB DL]
https://github.com/NixOS/nixpkgs/pull/69153
6 package were build:
keepkey_agent ledger_agent python27Packages.ledger_agent python38Packages.keepkey_agent python38Packages.ledger_agent trezor_agent

@jonringer jonringer merged commit 354e872 into NixOS:master Nov 12, 2019
@jb55
Copy link
Contributor

jb55 commented Nov 12, 2019

awesome, I'll look into rebasing my trezor gpg agent module on this now

@hkjn hkjn deleted the 20190918-ledgeragent branch November 13, 2019 00:02
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

6 participants