selfcustody / krux

Open-source signing device firmware for Bitcoin
https://selfcustody.github.io/krux/
Other
179 stars 36 forks source link

Makefile to make development easier and faster #146

Closed qlrd closed 6 months ago

qlrd commented 2 years ago

Some development tasks require, on an extended time scale, a considerable amount of repetition of the commands. Example for updates, format, lint, test, simulate, build and flash firmware:

  1. git pull origin <branch> && git submodule update --init --recursive
  2. poetry update
  3. poetry run black ./src && poetry run black ./tests
  4. poetry run pytest --cache-clear --cov src/krux --cov-report html ./tests 4.1. verbose: poetry run pytest --cache-clear --cov src/krux --cov-report html --show-capture all --capture tee-sys -r A ./tests
  5. cd simulator && ./run-all-sequences
  6. vagrant up 8.vagrant ssh -c 'cd /vagrant; ./krux generate-keypair'
  7. vagrant ssh -c 'cd /vagrant; ./krux pem-to-pubkey pubkey.pem'
  8. vagrant ssh -c 'cd /vagrant; ./krux build maixpy_m5stickv'
  9. vagrant ssh -c 'cd /vagrant; ./krux flash'

I propose to simplify, for the developer, the repetition of these commands in some leaner ones, through a Makefile. The example above would then be:

I made an example here.

For more details, see this discussion

tadeubas commented 6 months ago

I think with the addition of poetry run poe tasks this problem is "solved", right? I've created a few tasks that I'm using to help with development, and I think anyone could add new tasks to suit their needs.

Some examples (all commands start with poetry run poe):

All current tasks are listed here: https://github.com/selfcustody/krux/blob/develop/pyproject.toml#L64

qlrd commented 6 months ago

Poe is a better solution than Makefile since can run on any platform. So yes, do it man! Should i close it?

odudex commented 6 months ago

Agreed! We could close this @qlrd