[med-svn] [Git][med-team/cyvcf2][upstream] New upstream version 0.30.2

Nilesh Patra gitlab at salsa.debian.org
Thu Dec 24 10:00:32 GMT 2020



Nilesh Patra pushed to branch upstream at Debian Med / cyvcf2


Commits:
4d480293 by Nilesh Patra at 2020-12-24T15:23:01+05:30
New upstream version 0.30.2
- - - - -


6 changed files:

- + .github/workflows/build.yml
- + .github/workflows/wheels.yml
- cyvcf2/__init__.py
- cyvcf2/cyvcf2.pyx
- + cyvcf2/tests/test-invalid-header.vcf
- cyvcf2/tests/test_reader.py


Changes:

=====================================
.github/workflows/build.yml
=====================================
@@ -0,0 +1,34 @@
+name: Build
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    name: Run tests on Python ${{ matrix.python-version }}
+    runs-on: ubuntu-18.04
+    strategy:
+      matrix:
+        python-version: [3.5, 3.6, 3.7, 3.8]
+
+    steps:
+    - uses: actions/checkout at v2
+      with:
+        submodules: true
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python at v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install
+      run: |
+        sudo apt-get install libcurl4-openssl-dev
+        pip install -r requirements.txt
+        cd htslib
+        autoheader && autoconf
+        ./configure --enable-s3 --disable-lzma --disable-bz2
+        make
+        cd ..
+        CYTHONIZE=1 python setup.py install
+    - name: Test
+      run: |
+        python setup.py test
+


=====================================
.github/workflows/wheels.yml
=====================================
@@ -0,0 +1,56 @@
+name: Wheels
+
+on: 
+  push:
+    tags:
+      - 'v*.*.*'
+
+jobs:
+  build_wheels:
+    name: Build wheels on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-18.04, macos-latest]
+
+    steps:
+    - uses: actions/checkout at v2
+      with:
+        submodules: true
+    - uses: actions/setup-python at v2
+      name: Install Python
+      with:
+        python-version: "3.7"
+
+    - name: Install cibuildwheel
+      run: |
+        python -m pip install cibuildwheel
+
+    - name: Build wheels for Linux
+      if: matrix.os == 'ubuntu-18.04'
+      run: |
+        python -m cibuildwheel --output-dir wheelhouse
+      env:
+        CIBW_SKIP: "pp* cp27-* cp34-* *i686*"
+        CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
+        CIBW_BEFORE_BUILD_LINUX: "{project}/ci/linux-deps"
+        CIBW_TEST_COMMAND: "{project}/ci/test"
+        CIBW_ENVIRONMENT: "CYTHONIZE=1 LDFLAGS='-L/usr/lib64/openssl11' CPPFLAGS='-I/usr/include/openssl11' C_INCLUDE_PATH='/root/include' LIBRARY_PATH='/root/lib'"
+
+    - name: Build wheels for Mac OS
+      if: matrix.os == 'macos-latest'
+      run: |
+        python -m cibuildwheel --output-dir wheelhouse
+      env:
+        CIBW_SKIP: "pp* cp27-* cp34-* *i686*"
+        CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
+        CIBW_BEFORE_BUILD_MACOS: "{project}/ci/osx-deps"
+        CIBW_TEST_COMMAND: "{project}/ci/test"
+        CIBW_ENVIRONMENT: "CYTHONIZE=1"
+        LDFLAGS: "-L/usr/local/opt/openssl at 1.1/lib"
+        CPPFLAGS: "-I/usr/local/opt/openssl at 1.1/include"
+        PKG_CONFIG_PATH: "/usr/local/opt/openssl at 1.1/lib/pkgconfig"
+
+    - uses: actions/upload-artifact at v2
+      with:
+        path: ./wheelhouse/*.whl


=====================================
cyvcf2/__init__.py
=====================================
@@ -2,4 +2,4 @@ from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
                      par_het)
 Reader = VCFReader = VCF
 
-__version__ = "0.30.1"
+__version__ = "0.30.2"


=====================================
cyvcf2/cyvcf2.pyx
=====================================
@@ -256,6 +256,8 @@ cdef class VCF(HTSFile):
         cdef bcf_hdr_t *hdr
         self._open_htsfile(fname, mode)
         hdr = self.hdr = bcf_hdr_read(self.hts)
+        if hdr == NULL:
+            raise Exception("cannot parse VCF header")
         if samples is not None:
             self.set_samples(samples)
         self.n_samples = bcf_hdr_nsamples(self.hdr)


=====================================
cyvcf2/tests/test-invalid-header.vcf
=====================================
@@ -0,0 +1,7 @@
+##fileformat=VCFv4.0
+#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	FOO	
+20	10001292	rs1	G	A	42.22	.	AF=0.50;AC=1	GT:RD:GQ	1/0:23:19.28
+20	10002963	.	C	G	42.22	.	AF=0.30	GT:RD:GQ	0/1:30:33.07
+20	10005008	rs2	A	T	123.78	.	AF=1.00	GT:RD:GQ	1/1:30:8.26
+20	10044557	rs3	C	T	42.22	.	AC=2	GT:RD:GQ	0/1:31:15.01
+20	10048580	.	T	A	42.22	.	AF=0.75	GT:RD:GQ	1/0:33:23.49


=====================================
cyvcf2/tests/test_reader.py
=====================================
@@ -1138,3 +1138,9 @@ def test_set_unknown_format():
     parts = record.split()
     assert parts[-1][-1] == '.'
     assert parts[-2][-3:] == '1.1'
+
+def test_invalid_header():
+    # htslib produces the error "Empty sample name: trailing spaces/tabs in the header line?"
+    p = os.path.join(HERE, "test-invalid-header.vcf")
+    assert os.path.exists(p)
+    assert_raises(Exception, VCF, p)



View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/4d480293f495e5dc9425ee6c0ee3377d31878607

-- 
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/4d480293f495e5dc9425ee6c0ee3377d31878607
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/20201224/c246050d/attachment-0001.html>


More information about the debian-med-commit mailing list