Skip to content

Commit

Permalink
build: support 3.13 python version (#190)
Browse files Browse the repository at this point in the history
* build: support python version
* build: update exon version
* build: update signatures for pyclass
  • Loading branch information
tshauck authored Dec 21, 2024
1 parent 6781c54 commit 2747829
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.13'

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ crate-type = ["cdylib"]
name = "biobear"

[dependencies]
arrow = { version = "52.1.0", features = ["pyarrow"] }
datafusion = "41"
exon = { version = "0.32.3", features = ["default"] }
pyo3 = "0.21.2"
arrow = { version = "53.3.0", features = ["pyarrow"] }
datafusion = "43"
exon = { version = "0.32.4", features = ["default"] }
pyo3 = "0.22.2"
tokio = { version = "1", features = ["rt"] }
noodles = { version = "0.86", features = ["core"] }

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "maturin"
requires = ["maturin==1.5.1"]
requires = ["maturin==1.7.8"]

[project]
authors = [{ name = "WHERE TRUE devs", email = "[email protected]" }]
Expand All @@ -13,7 +13,7 @@ dependencies = ["pyarrow>=15"]
license = { file = "LICENSE" }
name = "biobear"
readme = "README.md"
requires-python = ">=3.9,<3.13"
requires-python = ">=3.9"
description = "A package for working with Bioinformatics data with SQL and Arrow"
version = "0.23.2"

Expand Down
1 change: 1 addition & 0 deletions src/bam_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl BamIndexedReader {
#[pymethods]
impl BamIndexedReader {
#[new]
#[pyo3(signature = (path, batch_size=None))]
fn new(path: &str, batch_size: Option<usize>) -> PyResult<Self> {
Self::open(path, batch_size).map_err(|e| {
PyErr::new::<pyo3::exceptions::PyIOError, _>(format!(
Expand Down
1 change: 1 addition & 0 deletions src/bcf_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl BCFIndexedReader {
#[pymethods]
impl BCFIndexedReader {
#[new]
#[pyo3(signature = (path, batch_size=None))]
fn new(path: &str, batch_size: Option<usize>) -> PyResult<Self> {
Self::open(path, batch_size).map_err(PyErr::new::<pyo3::exceptions::PyValueError, _>)
}
Expand Down
1 change: 1 addition & 0 deletions src/datasources/bam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub struct BAMReadOptions {
#[pymethods]
impl BAMReadOptions {
#[new]
#[pyo3(signature = (region=None))]
pub fn try_new(region: Option<String>) -> PyResult<Self> {
let region = parse_region(region)?;

Expand Down
1 change: 1 addition & 0 deletions src/datasources/cram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub struct CRAMReadOptions {
#[pymethods]
impl CRAMReadOptions {
#[new]
#[pyo3(signature = (region=None, fasta_reference=None))]
pub fn try_new(region: Option<String>, fasta_reference: Option<String>) -> PyResult<Self> {
let region = parse_region(region)?;

Expand Down
4 changes: 2 additions & 2 deletions src/datasources/fasta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use pyo3::{pyclass, pymethods};

const DEFAULT_FASTA_FILE_EXTENSION: &str = "fasta";

#[derive(Debug, Clone)]
#[pyclass]
#[derive(Debug, Clone, PartialEq, Eq)]
#[pyclass(eq, eq_int)]
pub enum FastaSequenceDataType {
UTF8,
#[allow(non_camel_case_types)]
Expand Down
1 change: 1 addition & 0 deletions src/datasources/fcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub struct FCSReadOptions {
#[pymethods]
impl FCSReadOptions {
#[new]
#[pyo3(signature = (file_compression_type=None))]
pub fn new(file_compression_type: Option<FileCompressionType>) -> Self {
Self {
file_compression_type: file_compression_type.unwrap_or_default(),
Expand Down
1 change: 1 addition & 0 deletions src/datasources/genbank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ impl_settable_from_file_options!(GenBankReadOptions);
#[pymethods]
impl GenBankReadOptions {
#[new]
#[pyo3(signature = (file_compression_type=None))]
fn new(file_compression_type: Option<FileCompressionType>) -> Self {
Self {
file_compression_type,
Expand Down
1 change: 1 addition & 0 deletions src/datasources/gtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl_settable_from_file_options!(GTFReadOptions);
#[pymethods]
impl GTFReadOptions {
#[new]
#[pyo3(signature = (file_compression_type=None))]
pub fn new(file_compression_type: Option<FileCompressionType>) -> Self {
Self {
file_compression_type,
Expand Down
1 change: 1 addition & 0 deletions src/datasources/hmm_dom_tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ impl SettableFromFileOptions for HMMDomTabReadOptions {
#[pymethods]
impl HMMDomTabReadOptions {
#[new]
#[pyo3(signature = (file_extension=None, file_compression_type=None))]
fn new(
file_extension: Option<String>,
file_compression_type: Option<FileCompressionType>,
Expand Down
1 change: 1 addition & 0 deletions src/datasources/mzml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ impl Default for MzMLReadOptions {
#[pymethods]
impl MzMLReadOptions {
#[new]
#[pyo3(signature = (file_compression_type=None))]
fn new(file_compression_type: Option<FileCompressionType>) -> Self {
Self {
file_compression_type: Some(
Expand Down
1 change: 1 addition & 0 deletions src/exon_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl ExonReader {
#[pymethods]
impl ExonReader {
#[new]
#[pyo3(signature = (path, file_type, compression=None, batch_size=None))]
fn new(
path: &str,
file_type: &str,
Expand Down
2 changes: 1 addition & 1 deletion src/file_compression_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use pyo3::prelude::*;

use crate::error::BioBearError;

#[pyclass]
#[derive(Debug, Clone, PartialEq)]
#[pyclass(eq, eq_int)]
pub enum FileCompressionType {
GZIP,
ZSTD,
Expand Down
15 changes: 15 additions & 0 deletions src/session_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ impl BioBearSessionContext {
}

/// Read one or more VCF files from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_vcf_file(
&mut self,
file_path: &str,
Expand All @@ -62,6 +63,7 @@ impl BioBearSessionContext {
}

/// Read a HMM Dom Tab file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_hmm_dom_tab_file(
&mut self,
file_path: &str,
Expand All @@ -80,6 +82,7 @@ impl BioBearSessionContext {
}

/// Read an SDF file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_sdf_file(
&mut self,
file_path: &str,
Expand All @@ -98,6 +101,7 @@ impl BioBearSessionContext {
}

/// Read a bigwig file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_bigwig_file(
&mut self,
file_path: &str,
Expand Down Expand Up @@ -126,6 +130,7 @@ impl BioBearSessionContext {
}

/// Read a gff file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_gff_file(
&mut self,
file_path: &str,
Expand All @@ -143,6 +148,7 @@ impl BioBearSessionContext {
}

/// Read a fastq file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_fastq_file(
&mut self,
file_path: &str,
Expand All @@ -161,6 +167,7 @@ impl BioBearSessionContext {
}

/// Read a genbank file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_genbank_file(
&mut self,
file_path: &str,
Expand All @@ -179,6 +186,7 @@ impl BioBearSessionContext {
}

/// Read a CRAM file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_cram_file(
&mut self,
file_path: &str,
Expand All @@ -194,6 +202,7 @@ impl BioBearSessionContext {
}

/// Read a mzml file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_mzml_file(
&mut self,
file_path: &str,
Expand All @@ -212,6 +221,7 @@ impl BioBearSessionContext {
}

/// Read a GTF file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_gtf_file(
&mut self,
file_path: &str,
Expand All @@ -230,6 +240,7 @@ impl BioBearSessionContext {
}

/// Read a BCF file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_bcf_file(
&mut self,
file_path: &str,
Expand All @@ -245,6 +256,7 @@ impl BioBearSessionContext {
}

/// Read a fasta file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_fasta_file(
&mut self,
file_path: &str,
Expand All @@ -263,6 +275,7 @@ impl BioBearSessionContext {
}

/// Read a BED file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_bed_file(
&mut self,
file_path: &str,
Expand All @@ -281,6 +294,7 @@ impl BioBearSessionContext {
}

/// Read a BAM file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_bam_file(
&mut self,
file_path: &str,
Expand All @@ -296,6 +310,7 @@ impl BioBearSessionContext {
}

/// Read a SAM file from the given path.
#[pyo3(signature = (file_path, options=None))]
fn read_sam_file(
&mut self,
file_path: &str,
Expand Down
1 change: 1 addition & 0 deletions src/vcf_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl VCFIndexedReader {
#[pymethods]
impl VCFIndexedReader {
#[new]
#[pyo3(signature = (path, batch_size=None))]
fn new(path: &str, batch_size: Option<usize>) -> PyResult<Self> {
Self::open(path, batch_size).map_err(PyErr::new::<pyo3::exceptions::PyValueError, _>)
}
Expand Down

0 comments on commit 2747829

Please sign in to comment.