File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ permissions:
1313env :
1414 UV_FROZEN : true
1515 UV_PYTHON : 3.14
16- RUST_VERSION : " 1.90 .0"
16+ RUST_VERSION : " 1.95 .0"
1717
1818jobs :
1919 benchmark :
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ permissions:
1313env :
1414 UV_FROZEN : true
1515 UV_PYTHON : 3.14
16- RUST_VERSION : " 1.90 .0"
16+ RUST_VERSION : " 1.95 .0"
1717
1818jobs :
1919 benchmarks :
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ permissions:
77
88env :
99 RUSTFLAGS : " -Dwarnings" # treat warnings as errors
10+ RUST_VERSION : " 1.95.0"
1011
1112jobs :
1213 lint :
1617 - name : Checkout repository.
1718 uses : actions/checkout@v6
1819
20+ - name : Install rust.
21+ uses : dtolnay/rust-toolchain@master
22+ with :
23+ toolchain : ${{ env.RUST_VERSION }}
24+ components : clippy, rustfmt
25+
1926 - name : Run Clippy.
2027 run : cargo clippy --all-targets --all-features
2128
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ permissions:
1212 contents : read
1313
1414env :
15- RUST_VERSION : " 1.90 .0"
15+ RUST_VERSION : " 1.95 .0"
1616
1717jobs :
1818 build :
Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ name = "libipld"
1313crate-type = [" rlib" , " cdylib" ]
1414
1515[dependencies ]
16- pyo3 = { version = " 0.27.1 " , features = [" generate-import-lib" , " anyhow" ] }
17- python3-dll-a = " 0.2.14 "
18- anyhow = " 1.0.100 "
19- cid = " 0.11.1 "
20- cbor4ii = { version = " 1.2.1 " }
16+ pyo3 = { version = " 0.28.3 " , features = [" generate-import-lib" , " anyhow" ] }
17+ python3-dll-a = " 0.2.15 "
18+ anyhow = " 1.0.102 "
19+ cid = " 0.11.3 "
20+ cbor4ii = { version = " 1.2.2 " }
2121
2222[workspace ]
2323members = [ " profiling" ]
Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ structopt = "0.3.26"
1111clap = " 4.5.29"
1212
1313[dependencies .pyo3 ]
14- version = " 0.27.1 "
14+ version = " 0.28.3 "
Original file line number Diff line number Diff line change @@ -6,12 +6,17 @@ pub fn exec(iterations: u64) {
66 let bench_file_name = "benchmarks/repo.car" ;
77
88 let car_bytes = fs:: read ( bench_file_name)
9- . expect ( & format ! ( "Could not open bench file '{}'" , bench_file_name) ) ;
9+ . unwrap_or_else ( |_| panic ! ( "Could not open bench file '{}'" , bench_file_name) ) ;
1010
11- pyo3:: prepare_freethreaded_python ( ) ;
11+ Python :: initialize ( ) ;
12+
13+ Python :: attach ( |gil| {
14+ unsafe { pyo3:: ffi:: Py_SetRecursionLimit ( 10_000 ) } ;
15+ let _ = gil;
16+ } ) ;
1217
1318 for _ in 0 ..iterations {
14- Python :: with_gil ( |gil| {
19+ Python :: attach ( |gil| {
1520 println ! ( "{}" , libipld:: decode_car( gil, & car_bytes) . is_ok( ) ) ;
1621 } ) ;
1722 }
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ pub fn exec(iterations: u64) {
66 let bench_file_name = "benchmarks/decode.dagcbor" ;
77
88 let dag_cbor_bytes = fs:: read ( bench_file_name)
9- . expect ( & format ! ( "Could not open bench file '{}'" , bench_file_name) ) ;
9+ . unwrap_or_else ( |_| panic ! ( "Could not open bench file '{}'" , bench_file_name) ) ;
1010
11- pyo3 :: prepare_freethreaded_python ( ) ;
11+ Python :: initialize ( ) ;
1212
1313 for _ in 0 ..iterations {
14- Python :: with_gil ( |gil| {
14+ Python :: attach ( |gil| {
1515 println ! ( "{}" , libipld:: decode_dag_cbor( gil, & dag_cbor_bytes) . is_ok( ) ) ;
1616 } ) ;
1717 }
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ pub fn exec(iterations: u64) {
77 let bench_file_name = "benchmarks/encode.json" ;
88
99 let json_data = fs:: read_to_string ( bench_file_name)
10- . expect ( & format ! ( "Could not open bench file '{}'" , bench_file_name) ) ;
10+ . unwrap_or_else ( |_| panic ! ( "Could not open bench file '{}'" , bench_file_name) ) ;
1111 let json_str = json_data. as_str ( ) ;
1212
13- pyo3 :: prepare_freethreaded_python ( ) ;
13+ Python :: initialize ( ) ;
1414
1515 for _ in 0 ..iterations {
16- Python :: with_gil ( |gil| {
16+ Python :: attach ( |gil| {
1717 println ! (
1818 "{}" ,
1919 libipld:: encode_dag_cbor( gil, & PyString :: new( gil, json_str) ) . is_ok( )
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def test_decode_car_invalid_header_type() -> None:
4242 header_obj = libipld .encode_dag_cbor ('strInsteadOfObj' )
4343 libipld .decode_car (header_len + header_obj )
4444
45- assert "cannot be cast as 'dict'" in str (exc_info .value )
45+ assert "is not an instance of 'dict'" in str (exc_info .value )
4646
4747
4848def test_decode_car_invalid_header_version_key () -> None :
@@ -78,7 +78,7 @@ def test_decode_car_invalid_header_roots_value_type() -> None:
7878 header_obj = libipld .encode_dag_cbor ({'version' : 1 , 'roots' : 123 })
7979 libipld .decode_car (header_len + header_obj )
8080
81- assert "cannot be cast as 'list'" in str (exc_info .value )
81+ assert "is not an instance of 'list'" in str (exc_info .value )
8282
8383
8484def test_decode_car_invalid_header_roots_value_empty_list () -> None :
You can’t perform that action at this time.
0 commit comments