Skip to content

Conversation

@aekasitt
Copy link
Contributor

This is a general (perhaps too opinionated) clean-up of the project as such:

  • Adopt Astral's uv as preferred package manager
  • Consolidate pytest and flake8 rules under pyproject.toml
  • Remove sub requirements.txt files and requirements-dev.txt under pyproject.toml
  • Add intentions to .gitignore rules and remove obvious none-paths
  • .env is listed under .gitignore rule but included in git -> rename to .env.example
  • Drop flat layout packaging and adopt src layout packaging
  • Use hatchling as preferred project build-system
  • Separate README.md subsections for passerby and contributors
  • Add walkthrough for uv commands under README.md

@aekasitt
Copy link
Contributor Author

Recently converted run-tests.yml workflow to a more uv focus workflow

@aekasitt
Copy link
Contributor Author

In the example README.md files, I changed the installation guide to use uv sync --extra xxx syntax and change the commands being run for examples to expect users running such commands from the root directory.

@bigspider
Copy link
Collaborator

Thanks for the PR!
It might be some days before I manage to review it, but I'll get to it.

@aekasitt
Copy link
Contributor Author

aekasitt commented Jun 22, 2025

Please do !
I'll work on fix the Python Test Suite workflow now.
Things I'm doing on my develop branch:

  • Flatten tests structure
  • Integrate ruff formatter and linter
  • Expand tests to using dynamicly generated priv-pub keys
  • Integrate testcontainers library (no need to have running container separately)
  • Shebangs, encoding, module strings
  • Pdoc

Quick question:

Seeing how the project does not use TypeGuard nor Self in typing, is typing-extensions a necessary requirement for future upgrades?


Spoiler

It's not completed, but I managed to get the built wheel file integrated into a pyodide environment so expect to see in-browser sMATT environment soon.

@bigspider
Copy link
Collaborator

Looks good to me, I was able to run the tests locally.
Possible followup (not necessarily due to this PR) on how to successfully run setup.sh: mention that for the setup.sh script to work, a bitcoin-cli binary needs to be in the PATH (or maybe we could improve the script so that it can use the one from the container); if using the bitcoin-cli in the path, also the authentication must be compatible as in the example bitcoin.conf.

Seeing how the project does not use TypeGuard nor Self in typing, is typing-extensions a necessary requirement for future upgrades?

Probably not needed indeed; I think it was required when I started the project, as I was using python versions below 3.9.

Once the CI is running (seems to be an issue with the source command not working in sh instead of bash?), happy to merge it!

Thanks a lot, definitely cleaner!

Happy to hear more about what you have in mind with the browser environment 👀

@aekasitt
Copy link
Contributor Author

aekasitt commented Jul 9, 2025

Refactored source to sh like you mentioned.
I'm currently using nektos/act as my local workflow runner and running into myriads of other problems if I leave base container as bigspider/bitcoin_matt which is not reproducible anywhere else so I'll be mindful of not shifting from your workflow too much.


Under the next flattening pull request, I'll make sure to remove typing_extensions to avoid side-effects.


Under krutt/smatt repository, I've made a Single-Page Application built with vite bundler and static webassembly python interpreter for the browser, which can also include downloaded pymatt wheel hence you can have a replit-like in-browser code-editor where you can create transaction to sign (once ready at sMATT) Hopefully, I can get it to work with message signing of extension-wallets that implement webbtc like alby

@aekasitt
Copy link
Contributor Author

Fixing this from the workflow:
Run Tests and Capture outputs

0s Run pytest -vv
/__w/_temp/114902be-179b-46c8-95e2-284875ece36f.sh: 1: pytest: not found
Error: Process completed with exit code 127.

@aekasitt
Copy link
Contributor Author

Thanks for your patience with the workflow errors.
This is the sMATT web workspace I told you about.

smatt-demo

@aekasitt
Copy link
Contributor Author

Working on debugging test runner

@bigspider
Copy link
Collaborator

No problem, I know the pain of debugging CIs, thanks for your work!

I think you can remove the "Persist path across steps" now, since you added the source command directly before calling pytest in the same step. Not sure why persisting it is not working, it was a suggested solution online. 🤷

Also, please squash the last batch of commits fixing the CI into a single one.

@aekasitt
Copy link
Contributor Author

I think you can remove the "Persist path across steps" now, since you added the source command directly before calling pytest in the same step. Not sure why persisting it is not working, it was a suggested solution online. 🤷

Noted.

Also, please squash the last batch of commits fixing the CI into a single one.

Noted.

Copy link
Collaborator

@bigspider bigspider left a comment

Choose a reason for hiding this comment

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

Seems like a good time to merge it, any further improvement can be in separate PRs. Thank you!

@bigspider bigspider merged commit daac3c4 into Merkleize:master Jul 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants