Skip to content

Conversation

@cffls
Copy link
Collaborator

@cffls cffls commented Dec 17, 2025

This commit will ensure pure python version of cbor2 is used when installing pycardano for the first time, without modifying any dependencies. Users are still free to use cbor2 if speed is preferred over correctness by setting CBOR_C_EXETENSION=1 in their environment.

A dynamic cbor2 module is also exported by pycardano, which allows users to use if they want to write custom version of decoder without worrying about using the wrong cbor library with pycardano.

from pycardano.cbor2 import cbor2

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.57%. Comparing base (40e18d5) to head (d1c151d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pycardano/cbor.py 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #475      +/-   ##
==========================================
- Coverage   90.64%   90.57%   -0.08%     
==========================================
  Files          33       34       +1     
  Lines        5153     5157       +4     
  Branches      781      782       +1     
==========================================
  Hits         4671     4671              
- Misses        304      306       +2     
- Partials      178      180       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nielstron
Copy link
Contributor

Thanks for finally tackling this! Overall the approach is sound, just 2 minor notes.

@cffls
Copy link
Collaborator Author

cffls commented Dec 18, 2025

Thanks for reviewing and the suggestions! All tests are passing, merging now.

@cffls cffls merged commit dd2170b into main Dec 18, 2025
22 of 24 checks passed
@theeldermillenial
Copy link
Contributor

@cffls This is huge! Thanks. It will make things much easier.

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.

4 participants