[med-svn] [Git][med-team/python-bx][upstream] New upstream version 0.12.0
Michael R. Crusoe (@crusoe)
gitlab at salsa.debian.org
Wed Jul 3 17:11:19 BST 2024
Michael R. Crusoe pushed to branch upstream at Debian Med / python-bx
Commits:
5426a3f3 by Michael R. Crusoe at 2024-07-03T14:15:08+02:00
New upstream version 0.12.0
- - - - -
20 changed files:
- .github/workflows/deploy.yaml
- .gitignore
- lib/bx/__init__.py
- lib/bx/align/sitemask/sitemask_tests.py
- lib/bx/binned_array.py
- lib/bx/binned_array_tests.py
- lib/bx/interval_index_file_tests.py
- lib/bx/intervals/cluster_tests.py
- lib/bx/intervals/intersection.pyx
- lib/bx/misc/seekbzip2_tests.py
- lib/bx/motif/io/transfac_tests.py
- lib/bx/motif/pwm_tests.py
- lib/bx/seq/fasta_tests.py
- lib/bx/seq/nib_tests.py
- lib/bx/seq/qdna_tests.py
- lib/bx/seq/twobit_tests.py
- pyproject.toml
- pytest.ini
- src/pwm_utils.c
- tox.ini
Changes:
=====================================
.github/workflows/deploy.yaml
=====================================
@@ -32,10 +32,11 @@ jobs:
run: python -m cibuildwheel --output-dir dist
env:
CIBW_ARCHS: ${{ matrix.archs }}
- # Skip building musllinux wheels for the Python versions for which the oldest
- # supported numpy version doesn't have musllinux wheels on PyPI.
- # Skip also building for PyPy 3.8, which is deprecated upstream.
- CIBW_SKIP: "cp38-musllinux_* cp39-musllinux_* cp310-musllinux_* cp311-musllinux_* pp38-*"
+ # Skip building musllinux wheels for the CPython versions for which the
+ # numpy version we build against doesn't have musllinux wheels on PyPI.
+ # Skip building for PyPy 3.8, which is deprecated upstream.
+ # Skip building for PyPy on i686 since NumPy 2.0 fails to build on it.
+ CIBW_SKIP: "cp38-musllinux_* pp38-* pp*-manylinux_i686"
- name: Check packages
run: twine check dist/*
- uses: actions/upload-artifact at v4
=====================================
.gitignore
=====================================
@@ -32,3 +32,6 @@ nose*.egg
# Built sdist directory
dist
+
+# Testing
+.tox/
=====================================
lib/bx/__init__.py
=====================================
@@ -1 +1 @@
-__version__ = "0.11.0"
+__version__ = "0.12.0"
=====================================
lib/bx/align/sitemask/sitemask_tests.py
=====================================
@@ -6,7 +6,7 @@ import tempfile
from io import StringIO
import bx.align.maf
-from . import cpg
+from bx.align.sitemask import cpg
test_maf_cpg = """##maf version=1 scoring=none
a score=0
=====================================
lib/bx/binned_array.py
=====================================
@@ -20,7 +20,7 @@ from numpy import (
array,
concatenate,
frombuffer,
- NaN,
+ nan,
resize,
zeros,
)
@@ -70,7 +70,7 @@ def bytesify(s):
class BinnedArray:
- def __init__(self, bin_size=512 * 1024, default=NaN, max_size=MAX, typecode="f"):
+ def __init__(self, bin_size=512 * 1024, default=nan, max_size=MAX, typecode="f"):
self.max_size = max_size
self.bin_size = bin_size
self.nbins = int(math.ceil(max_size / self.bin_size))
@@ -273,7 +273,7 @@ class FileBinnedArray:
class BinnedArrayWriter:
- def __init__(self, f, bin_size=512 * 1024, default=NaN, max_size=MAX, typecode="f", comp_type="zlib"):
+ def __init__(self, f, bin_size=512 * 1024, default=nan, max_size=MAX, typecode="f", comp_type="zlib"):
# All parameters in the constructor are immutable after creation
self.f = f
self.max_size = max_size
=====================================
lib/bx/binned_array_tests.py
=====================================
@@ -2,15 +2,16 @@
Tests for `bx.binned_array`.
"""
+import pytest
from numpy import (
allclose,
concatenate,
- NaN,
+ nan,
zeros,
)
from numpy.random import random_sample as random
-from .binned_array import (
+from bx.binned_array import (
BinnedArray,
BinnedArrayWriter,
FileBinnedArray,
@@ -22,12 +23,9 @@ CHUNK_SIZE_ZEROS = 897
# CHUNK_SIZE_RANDOM=9456
# CHUNK_SIZE_ZEROS=8972
-source = target = None
-
-def setup():
- global source
- global target
+ at pytest.fixture(scope="module")
+def source_target():
source = []
for _ in range(13):
if random() < 0.5:
@@ -36,14 +34,15 @@ def setup():
source = concatenate((source, zeros(CHUNK_SIZE_ZEROS, "f")))
source = source.astype("f")
# Set on target
- target = BinnedArray(128, NaN, len(source))
+ target = BinnedArray(128, nan, len(source))
for i in range(len(source)):
# if not isNaN( source[i] ):
target[i] = source[i]
return source, target
-def test_simple():
+def test_simple(source_target):
+ source, target = source_target
# Verify
for i in range(len(source)):
assert source[i] == target[i], "No match, index: %d, source: %f, target: %f, len( source ): %d" % (
@@ -66,7 +65,8 @@ def test_simple():
)
-def test_file():
+def test_file(source_target):
+ source, target = source_target
# With a file (zlib)
target.to_file(open("/tmp/foo", "wb"))
target2 = FileBinnedArray(open("/tmp/foo", "rb"))
@@ -87,7 +87,8 @@ def test_file():
)
-def test_file_lzo():
+def test_file_lzo(source_target):
+ source, target = source_target
# With a file (lzo)
target.to_file(open("/tmp/foo3", "wb"), comp_type="lzo")
target3 = FileBinnedArray(open("/tmp/foo3", "rb"))
@@ -109,7 +110,8 @@ def test_file_lzo():
)
-def test_binned_array_writer():
+def test_binned_array_writer(source_target):
+ source, target = source_target
# Test with ba writer
o = open("/tmp/foo4", "wb")
w = BinnedArrayWriter(o, 128, comp_type="lzo")
=====================================
lib/bx/interval_index_file_tests.py
=====================================
@@ -1,8 +1,8 @@
import random
from tempfile import mktemp
-from . import interval_index_file
-from .interval_index_file import Indexes
+from bx import interval_index_file
+from bx.interval_index_file import Indexes
def test_offsets():
=====================================
lib/bx/intervals/cluster_tests.py
=====================================
@@ -1,14 +1,6 @@
-import os
-import sys
import unittest
-try:
- sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
-except Exception:
- sys.path.insert(0, os.path.dirname(os.path.abspath(".")))
-
-# from bx.intervals.cluster import ClusterTree
-from .cluster import ClusterTree
+from bx.intervals.cluster import ClusterTree
class TestCluster(unittest.TestCase):
=====================================
lib/bx/intervals/intersection.pyx
=====================================
@@ -282,8 +282,6 @@ cdef class Interval:
>>> f1 = Interval(23, 36)
>>> f2 = Interval(34, 48, value=OrderedDict([('chr', 12), ('anno', 'transposon')]))
- >>> f2
- Interval(34, 48, value=OrderedDict([('chr', 12), ('anno', 'transposon')]))
"""
cdef public int start, end
=====================================
lib/bx/misc/seekbzip2_tests.py
=====================================
@@ -7,7 +7,7 @@ import os
import random
from codecs import encode
-from . import seekbzip2
+from bx.misc import seekbzip2
F = None
T = None
=====================================
lib/bx/motif/io/transfac_tests.py
=====================================
@@ -2,7 +2,7 @@ from io import StringIO
from numpy import allclose
-from . import transfac
+from bx.motif.io import transfac
sample = """
VV TRANSFAC MATRIX TABLE, Rel.3.2 26-06-1997
=====================================
lib/bx/motif/pwm_tests.py
=====================================
@@ -3,7 +3,7 @@ from numpy import (
isnan,
)
-from . import pwm
+from bx.motif import pwm
def test_create():
=====================================
lib/bx/seq/fasta_tests.py
=====================================
@@ -4,7 +4,7 @@ Tests for `bx.seq.fasta`.
import unittest
-from . import fasta
+from bx.seq import fasta
test_fa = "test_data/seq_tests/test.fa"
=====================================
lib/bx/seq/nib_tests.py
=====================================
@@ -4,7 +4,7 @@ Tests for `bx.seq.nib`.
import unittest
-from . import nib
+from bx.seq import nib
test_nib = "test_data/seq_tests/test.nib"
=====================================
lib/bx/seq/qdna_tests.py
=====================================
@@ -4,7 +4,7 @@ Tests for `bx.seq.qdna`.
import unittest
-from . import qdna
+from bx.seq import qdna
test_qdna = "test_data/seq_tests/test.qdna"
=====================================
lib/bx/seq/twobit_tests.py
=====================================
@@ -2,7 +2,7 @@ import random
import pytest
-from . import twobit
+from bx.seq import twobit
def quick_fasta_iter(f):
=====================================
pyproject.toml
=====================================
@@ -1,5 +1,11 @@
[build-system]
-requires = ["cython", "oldest-supported-numpy", "setuptools", "wheel"]
+requires = [
+ "cython",
+ "numpy>=1.25.0; python_version>='3.9'",
+ "oldest-supported-numpy; python_version<'3.9'",
+ "setuptools",
+ "wheel",
+]
build-backend = "setuptools.build_meta"
[tool.black]
=====================================
pytest.ini
=====================================
@@ -1,5 +1,4 @@
[pytest]
-#addopts = --doctest-cython --doctest-modules # https://github.com/lgpage/pytest-cython/issues/58
-addopts = --doctest-modules
+addopts = --doctest-cython --doctest-modules
python_files = *_tests.py
testpaths = lib script_tests/
=====================================
src/pwm_utils.c
=====================================
@@ -1,7 +1,7 @@
#include <ctype.h>
#include <stdio.h>
-#include <strings.h>
+#include <string.h>
int symbol_match( char, char);
int pattern_match( char*, char*, int);
=====================================
tox.ini
=====================================
@@ -11,7 +11,7 @@ deps =
test: Cython
test: numpy
test: pytest
- test: pytest-cython
+ test: pytest-cython >= 0.2.2 # https://github.com/lgpage/pytest-cython/issues/58
test: python-lzo >= 1.14 # Python 3.10 support
lint: black
lint: flake8
View it on GitLab: https://salsa.debian.org/med-team/python-bx/-/commit/5426a3f343914fede97819fb9667f2995d910287
--
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/med-team/python-bx/-/commit/5426a3f343914fede97819fb9667f2995d910287
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240703/eac701f8/attachment-0001.htm>
More information about the debian-med-commit
mailing list