Skip to content

Commit de2ac00

Browse files
authored
Merge pull request #102 from databio/hf_to_str
Hot fix for python bindings failing (resolve #104)
2 parents 3cc1692 + 9be1f90 commit de2ac00

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

bindings/python/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gtars-py"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

bindings/python/src/digests/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use gtars::digests::{md5, sha512t24u, DigestResult};
44
use pyo3::prelude::*;
55

66
use pyo3::exceptions::PyTypeError;
7-
use pyo3::prelude::*;
87
use pyo3::types::{PyBytes, PyString};
98

109
#[pyfunction]
1110
pub fn sha512t24u_digest(readable: &Bound<'_, PyAny>) -> PyResult<String> {
1211
if let Ok(s) = readable.downcast::<PyString>() {
13-
Ok(sha512t24u(s.to_str()?)) // Borrowed, no copying
12+
// https://discord.com/channels/1209263839632424990/1229461480873922681/1229465185270370376
13+
Ok(sha512t24u(s.encode_utf8()?.as_bytes())) // Borrowed, no copying
1414
} else if let Ok(b) = readable.downcast::<PyBytes>() {
1515
Ok(sha512t24u(b.as_bytes())) // Borrowed, no copying
1616
} else {
@@ -21,7 +21,8 @@ pub fn sha512t24u_digest(readable: &Bound<'_, PyAny>) -> PyResult<String> {
2121
#[pyfunction]
2222
pub fn md5_digest(readable: &Bound<'_, PyAny>) -> PyResult<String> {
2323
if let Ok(s) = readable.downcast::<PyString>() {
24-
Ok(md5(s.to_str()?)) // Borrowed, no copying
24+
// https://discord.com/channels/1209263839632424990/1229461480873922681/1229465185270370376
25+
Ok(md5(s.encode_utf8()?.as_bytes())) // Borrowed, no copying
2526
} else if let Ok(b) = readable.downcast::<PyBytes>() {
2627
Ok(md5(b.as_bytes())) // Borrowed, no copying
2728
} else {

bindings/r/DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: gtars
22
Title: Performance critical genomic interval analysis using Rust, in R
3-
Version: 0.2.3
3+
Version: 0.2.4
44
Authors@R:
55
person("Nathan", "LeRoy", , "[email protected]", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0002-7354-7213"))

bindings/r/src/rust/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = 'gtars-r'
3-
version = '0.2.3'
3+
version = '0.2.4'
44
edition = '2021'
55

66
[lib]

gtars/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gtars"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
description = "Performance-critical tools to manipulate, analyze, and process genomic interval data. Primarily focused on building tools for geniml - our genomic machine learning python package."
66
license = "MIT"

gtars/docs/changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.2.4]
8+
- Attempt to fix failing python bindings in CI linux [#104](https://github.com/databio/gtars/issues/104)
9+
710
## [0.2.3]
811
- Improved RegionSet, by adding a multiple new methods: `to_bed`, `to_bed_gz`, `to_bigbed`, `identifier()`, and others.
912
- Fixed allowed `fasta_digest` to accept `Path` or `bytes` [#93](https://github.com/databio/gtars/issues/93)

0 commit comments

Comments
 (0)