Skip to content
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

fix some errors in github action, and add python 3.12 #286

Merged
merged 6 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
66 changes: 33 additions & 33 deletions cyvcf2/cyvcf2.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -93,36 +93,36 @@ cdef extern from "htslib/vcf.h":
hts_itr_t *bcf_itr_querys(hts_idx_t *, void *, char *);


const int BCF_DT_ID = 0;
const int BCF_DT_CTG = 1
const int BCF_DT_SAMPLE = 2;
cdef extern const int BCF_DT_ID;
cdef extern const int BCF_DT_CTG;
cdef extern const int BCF_DT_SAMPLE;

uint32_t bcf_float_missing = 0x7F800001;
cdef extern uint32_t bcf_float_missing;

const int BCF_ERR_CTG_UNDEF = 1
cdef extern const int BCF_ERR_CTG_UNDEF;


const int BCF_BT_NULL = 0
const int BCF_BT_INT8 = 1
const int BCF_BT_INT16 = 2
const int BCF_BT_INT32 = 3
const int BCF_BT_FLOAT = 5
const int BCF_BT_CHAR = 7
cdef extern const int BCF_BT_NULL;
cdef extern const int BCF_BT_INT8;
cdef extern const int BCF_BT_INT16;
cdef extern const int BCF_BT_INT32;
cdef extern const int BCF_BT_FLOAT;
cdef extern const int BCF_BT_CHAR;

const int bcf_str_missing = 0x07
const int bcf_str_vector_end = 0
cdef extern const int bcf_str_missing;
cdef extern const int bcf_str_vector_end;

const int INT8_MIN = -128
const int INT16_MIN = -32768
const int INT32_MIN = -2147483648
cdef extern const int INT8_MIN;
cdef extern const int INT16_MIN;
cdef extern const int INT32_MIN;

const int bcf_int8_vector_end = -127
const int bcf_int16_vector_end = -32767
const int bcf_int32_vector_end = -2147483647
cdef extern const int bcf_int8_vector_end;
cdef extern const int bcf_int16_vector_end;
cdef extern const int bcf_int32_vector_end;

const int bcf_int8_missing = INT8_MIN
const int bcf_int16_missing = INT16_MIN
const int32_t bcf_int32_missing = INT32_MIN
cdef extern const int bcf_int8_missing;
cdef extern const int bcf_int16_missing;
cdef extern const int32_t bcf_int32_missing;

ctypedef union uv1:
int32_t i; # integer value
Expand Down Expand Up @@ -179,17 +179,17 @@ cdef extern from "htslib/vcf.h":
ctypedef struct bcf_idpair_t:
pass

const int BCF_HL_FLT = 0 # header line
const int BCF_HL_INFO = 1
const int BCF_HL_FMT = 2
const int BCF_HL_CTG = 3
const int BCF_HL_STR = 4 # structured header line TAG=<A=..,B=..>
const int BCF_HL_GEN = 5 # generic header line

const int BCF_HT_FLAG = 0 # header type
const int BCF_HT_INT = 1
const int BCF_HT_REAL = 2
const int BCF_HT_STR = 3
cdef extern const int BCF_HL_FLT; # header line
cdef extern const int BCF_HL_INFO;
cdef extern const int BCF_HL_FMT;
cdef extern const int BCF_HL_CTG;
cdef extern const int BCF_HL_STR; # structured header line TAG=<A=..,B=..>
cdef extern const int BCF_HL_GEN; # generic header line

cdef extern const int BCF_HT_FLAG; # header type
cdef extern const int BCF_HT_INT;
cdef extern const int BCF_HT_REAL;
cdef extern const int BCF_HT_STR;

ctypedef struct bcf_hrec_t:
int type; # One of the BCF_HL_* type
Expand Down
8 changes: 4 additions & 4 deletions cyvcf2/cyvcf2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ cdef class VCF(HTSFile):
itr = bcf_itr_querys(self.hidx, self.hdr, to_bytes(region))
if itr == NULL:
warnings.warn("no intervals found for %s at %s" % (self.fname, region))
raise StopIteration
return
brentp marked this conversation as resolved.
Show resolved Hide resolved
try:
while True:
b = bcf_init()
Expand Down Expand Up @@ -437,11 +437,11 @@ cdef class VCF(HTSFile):
"""
if not region:
yield from self
raise StopIteration
return

if self.fname.decode(ENC).endswith(('.bcf', '.bcf.gz')):
yield from self._bcf_region(region)
raise StopIteration
return

if self.idx == NULL:
self.idx = tbx_index_load(to_bytes(self.fname))
Expand All @@ -459,7 +459,7 @@ cdef class VCF(HTSFile):

if itr == NULL:
warnings.warn("no intervals found for %s at %s" % (self.fname, region))
raise StopIteration
return

try:
while 1:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ cython>=0.23.3
numpy
coloredlogs
click
setuptools
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import subprocess
import platform

import pkg_resources
from setuptools import setup, Extension

if sys.version_info.major == 2 and sys.version_info.minor != 7:
Expand Down
Loading