-
Notifications
You must be signed in to change notification settings - Fork 15
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
[CI test] Integrate secp256k1lab as subtree #83
base: master
Are you sure you want to change the base?
[CI test] Integrate secp256k1lab as subtree #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good. Added some comments.
4d38d98
to
3c03e67
Compare
Rebased on master and addressed the review comments above (#83 (comment), #83 (comment), #83 (comment)). I btw thought it might be nice to squash the first three commits into one, but somehow always the rename of the vendored package (src/secp256k1lab => python/secp256k1lab/src/secp256k1lab, apparently happening in the merge commit) gets lost 🤔 |
python/chilldkg_ref/__init__.py
Outdated
# Prefer the vendored copy of secp256k1lab. | ||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../secp256k1lab/src")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit more modern Python and also a bit more readable IMO:
# Prefer the vendored copy of secp256k1lab. | |
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../secp256k1lab/src")) | |
# Prefer the vendored copy of secp256k1lab. | |
sys.path.insert(0, Path(__file__).parent / "../secp256k1lab/src") |
(needs from pathlib import Path
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Note that I had to convert the resulting Path object (PosixPath
on my machine) to a string though (str(...)
), as otherwise it wouldn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, indeed... Well, fine, I guess it's still a tiny bit more readable than the os.path
variants.
python/secp256k1lab/pyproject.toml
Outdated
authors = [ | ||
{ name = "Tim Ruffing", email = "[email protected]" }, | ||
{ name = "Jonas Nick", email = "[email protected]" }, | ||
{ name = "Sebastian Falbesoner", email = "[email protected]" } | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be fair to list @sipa as an author:
authors = [ | |
{ name = "Tim Ruffing", email = "[email protected]" }, | |
{ name = "Jonas Nick", email = "[email protected]" }, | |
{ name = "Sebastian Falbesoner", email = "[email protected]" } | |
] | |
authors = [ | |
{ name = "Pieter Wuille", email = "[email protected]" }, | |
{ name = "Tim Ruffing", email = "[email protected]" }, | |
{ name = "Jonas Nick", email = "[email protected]" }, | |
{ name = "Sebastian Falbesoner", email = "[email protected]" } | |
] | |
maintainers = [ | |
{ name = "Tim Ruffing", email = "[email protected]" }, | |
{ name = "Jonas Nick", email = "[email protected]" }, | |
{ name = "Sebastian Falbesoner", email = "[email protected]" } | |
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've added authors
but not maintainers
. Was this intentional? (I also don't like the duplication too much, but well, it's correct...)
@@ -0,0 +1,16 @@ | |||
[project] | |||
name = "secp256k1lab" | |||
version = "0.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can safely make this "production", otherwise it'll be in 0.x.x land forever.
Perhaps a date-based versioning scheme like YYYY.M.D
is better? I'd be hesitant to use MAJOR.MINOR.REVISON
as people then think "semantic versioning" and I don't think we want to make any guarantees. This a primarily a playground. If someone wants to use it, they can vendor/pin the commit?
@jonasnick @theStack What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think semantic versioning is a good choice in our case. I don't really see the problem with trying to make guarantees. We can just be very liberal about increasing the major version. Even if users vendor or pin the commit, it's very helpful to see very quickly what has changed in the library.
I agree that starting with 1.0.0 makes sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me. Related question: Do we want a changelog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that'd be helpful (at least once we have actual changes).
Are there any changes we already know we want to do before 1.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep it minimal:
- add CI (ruff and mypy?)
- fix secp256k1proto: Split
APrime.from_int
into a wrapping and a checked variant #77 - add a Changelog
anything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any opinion about the "[build-system]" section? "hatchling" is what "uv init" created by default, but I don't have any knowledge about what makes sense to use (or if it even matters that much, considering we have no dependencies).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't really matter for us, but hatchling is totally fine and the uv devs choose it for a reason. astral-sh/uv#7132. Fwiw, uv will soon have its own build backend. I'd just keep this as is.
I think I've seen this before. Just a shot in the dark but perhaps this helps: https://stackoverflow.com/questions/30136558/how-to-squash-commits-which-have-merge-commit-in-between |
git-subtree-dir: python/secp256k1lab git-subtree-split: b6db09ca2f4d911e46250cec8d4c10ba35012f96
Co-authored-by: Sebastian Falbesoner <[email protected]>
3c03e67
to
def1dfc
Compare
Added the secp256k1lab suggestions in branch https://github.com/theStack/secp256k1lab/tree/secp256k1lab-draft02 and updated the subtree integration in this PR accordingly. Still a bunch of TODOs (#83 (comment), plus determining a reasonable required Python version), I hope to tackle them this week. I guess with the ruff and mypy integration I can pretty much reuse the CI config here with minor adaptions, or is there anything special to be considered if it's a (uv) package? |
This is not strictly necessary, but since we use
Something like |
This PR moves the secp256k1lab (formerly called secp256k1proto) folder to an external package (living at https://github.com/theStack/secp256k1lab currently, created with the uv package manager), integrating it as git-subtree here [1]:
Supersedes #81, using the suggested syspath extension approach [1] [2] [3] to avoid the ugly import hack that was used before.
[1] #81 (comment)
[2] #81 (comment)
[3] https://github.com/BlockstreamResearch/bip-frost-dkg/tree/syspath