Skip to content

add type stubs #56

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

add type stubs #56

wants to merge 6 commits into from

Conversation

zzstoatzz
Copy link

@zzstoatzz zzstoatzz commented Mar 6, 2025

adds a python/libipld to house the .pyi file and the __all__

following the _{module_name} pattern that I use (and got from pydantic-core), note that maturin develop knows about the module-name set in pyproject.toml

let me know if there are any python type translations I messed up!

before

image

after

image

@zzstoatzz zzstoatzz force-pushed the main branch 3 times, most recently from 32a751d to 24e87cb Compare March 6, 2025 07:27
try again

clean up

3rd times a charm

one more
Comment on lines +40 to +42
[dependency-groups]
dev = ["maturin", "pytest", "pytest-benchmark"]

Copy link
Author

Choose a reason for hiding this comment

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

so uv sync gives you all you need for maturin develop --uv

@zzstoatzz zzstoatzz marked this pull request as ready for review March 6, 2025 21:20
@zzstoatzz
Copy link
Author

gentle ping for whenever you have a moment to look @MarshalX - I know there's probably more pressing things so I'll check back later 🙂

@MarshalX
Copy link
Owner

MarshalX commented Mar 7, 2025

That's an amazing job, thank you!!

I saw it already but did not comment immediately because this PR also integrates UV. I am still thinking about it but if we want to speed up it let's just include .pyi file :)

@zzstoatzz
Copy link
Author

zzstoatzz commented Mar 7, 2025

i don't think anything (else, after removing uv.lock) here is uv specific, for example dep groups are a python thing but I can remove it if you want (it shouldn't affect pip setups or anything about your distribution metadata like an extra would)

EDIT: doh the lockfile! duh, let me remove that

Copy link

codspeed-hq bot commented Mar 8, 2025

CodSpeed Performance Report

Merging #56 will degrade performances by 23.92%

Comparing zzstoatzz:main (db9d475) with main (a3b2a64)

Summary

⚡ 6 improvements
❌ 4 regressions
✅ 182 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_dag_cbor_decode[roundtrip02.json] 17.7 µs 22.5 µs -21.29%
test_dag_cbor_decode[roundtrip07.json] 17 µs 15.1 µs +12.25%
test_dag_cbor_decode[roundtrip22.json] 22.8 µs 16.9 µs +34.63%
test_dag_cbor_encode[roundtrip06.json] 21.6 µs 15.7 µs +37.14%
test_dag_cbor_encode[roundtrip10.json] 21.3 µs 26.3 µs -19.12%
test_dag_cbor_encode[roundtrip12.json] 18.7 µs 17 µs +10.11%
test_dag_cbor_encode[roundtrip13.json] 17.1 µs 22.4 µs -23.61%
test_dag_cbor_encode[roundtrip14.json] 17.2 µs 22.6 µs -23.92%
test_dag_cbor_encode[roundtrip16.json] 22.4 µs 17.6 µs +27.64%
test_dag_cbor_encode[roundtrip25.json] 22.3 µs 17.6 µs +26.17%

@zzstoatzz
Copy link
Author

Summary

⚡ 6 improvements ❌ 4 regressions ✅ 182 untouched benchmarks

not sure if related to my changes (i suspect not) or if these just have high variance

@MarshalX
Copy link
Owner

@zzstoatzz that's just a noise from small bechmarks. ignore it :)

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