Source: ncbi-acc-download
Version: 0.2.8-2
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lu...@debian.org
Usertags: ftbfs-20240615 ftbfs-trixie

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
>  debian/rules binary
> dh binary --with python3 --buildsystem=pybuild
>    dh_update_autotools_config -O--buildsystem=pybuild
>    dh_autoreconf -O--buildsystem=pybuild
>    dh_auto_configure -O--buildsystem=pybuild
> I: pybuild base:311: python3.12 setup.py config 
> /usr/lib/python3/dist-packages/setuptools/dist.py:744: 
> SetuptoolsDeprecationWarning: Invalid dash-separated options
> !!
> 
>         
> ********************************************************************************
>         Usage of dash-separated 'requires-dist' will not be supported in 
> future
>         versions. Please use the underscore name 'requires_dist' instead.
> 
>         This deprecation is overdue, please update your project and remove 
> deprecated
>         calls to avoid build errors in the future.
> 
>         See 
> https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for 
> details.
>         
> ********************************************************************************
> 
> !!
>   opt = self.warn_dash_deprecation(opt, section)
> running config
> I: pybuild base:311: python3.11 setup.py config 
> /usr/lib/python3/dist-packages/setuptools/dist.py:744: 
> SetuptoolsDeprecationWarning: Invalid dash-separated options
> !!
> 
>         
> ********************************************************************************
>         Usage of dash-separated 'requires-dist' will not be supported in 
> future
>         versions. Please use the underscore name 'requires_dist' instead.
> 
>         This deprecation is overdue, please update your project and remove 
> deprecated
>         calls to avoid build errors in the future.
> 
>         See 
> https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for 
> details.
>         
> ********************************************************************************
> 
> !!
>   opt = self.warn_dash_deprecation(opt, section)
> running config
>    dh_auto_build -O--buildsystem=pybuild
> I: pybuild base:311: /usr/bin/python3.12 setup.py build 
> /usr/lib/python3/dist-packages/setuptools/dist.py:744: 
> SetuptoolsDeprecationWarning: Invalid dash-separated options
> !!
> 
>         
> ********************************************************************************
>         Usage of dash-separated 'requires-dist' will not be supported in 
> future
>         versions. Please use the underscore name 'requires_dist' instead.
> 
>         This deprecation is overdue, please update your project and remove 
> deprecated
>         calls to avoid build errors in the future.
> 
>         See 
> https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for 
> details.
>         
> ********************************************************************************
> 
> !!
>   opt = self.warn_dash_deprecation(opt, section)
> running build
> running build_py
> creating 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/__init__.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/validate.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/__main__.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/wgs.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/errors.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/download.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/core.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build/ncbi_acc_download
> I: pybuild base:311: /usr/bin/python3 setup.py build 
> /usr/lib/python3/dist-packages/setuptools/dist.py:744: 
> SetuptoolsDeprecationWarning: Invalid dash-separated options
> !!
> 
>         
> ********************************************************************************
>         Usage of dash-separated 'requires-dist' will not be supported in 
> future
>         versions. Please use the underscore name 'requires_dist' instead.
> 
>         This deprecation is overdue, please update your project and remove 
> deprecated
>         calls to avoid build errors in the future.
> 
>         See 
> https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for 
> details.
>         
> ********************************************************************************
> 
> !!
>   opt = self.warn_dash_deprecation(opt, section)
> running build
> running build_py
> creating 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/__init__.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/validate.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/__main__.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/wgs.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/errors.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/download.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
> copying ncbi_acc_download/core.py -> 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build/ncbi_acc_download
>    dh_auto_test -O--buildsystem=pybuild
> I: pybuild base:311: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build; python3.12 
> -m pytest tests
> ============================= test session starts 
> ==============================
> platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
> rootdir: /<<PKGBUILDDIR>>
> plugins: cov-5.0.0, requests-mock-1.11.0, mock-3.12.0
> collected 32 items
> 
> tests/test_core.py ................                                      [ 
> 50%]
> tests/test_correct.py .                                                  [ 
> 53%]
> tests/test_download.py .                                                 [ 
> 56%]
> tests/test_validate.py ...                                               [ 
> 65%]
> tests/test_wgs.py ....FF.FF.x                                            
> [100%]
> 
> =================================== FAILURES 
> ===================================
> _________________________ test_download_wgs_parts_wgs 
> __________________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7f5355e58c50>
> 
>     def test_download_wgs_parts_wgs(req):
>         cfg = Config(format="genbank")
>         wgs_contig = open(full_path('wgs.gbk'), 'rt')
>         req.get(ENTREZ_URL, body=open(full_path('wgs_full.gbk'), 'rt'))
>     
> >       outhandle = wgs.download_wgs_parts(wgs_contig, cfg)
> 
> tests/test_wgs.py:89: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:114: in download_wgs_parts
>     updated_records.extend(download_wgs_for_record(record, config))
> ncbi_acc_download/wgs.py:164: in download_wgs_for_record
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7f5355e59670>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> ______________________ test_download_wgs_parts_wgs_retry 
> _______________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7f5355e27c80>
> 
>     def test_download_wgs_parts_wgs_retry(req):
>         cfg = Config(format="genbank")
>         wgs_contig = open(full_path('wgs.gbk'), 'rt')
>         req.get(ENTREZ_URL, response_list=[
>             {"text": u'Whoa, slow down', "status_code": 429, "headers": 
> {"Retry-After": "0"}},
>             {"body": open(full_path('wgs_full.gbk'), 'rt')},
>         ])
>     
> >       outhandle = wgs.download_wgs_parts(wgs_contig, cfg)
> 
> tests/test_wgs.py:104: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:114: in download_wgs_parts
>     updated_records.extend(download_wgs_for_record(record, config))
> ncbi_acc_download/wgs.py:164: in download_wgs_for_record
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7f5355deba70>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> ----------------------------- Captured stdout call 
> -----------------------------
> Too many requests, please consider using --api-key parameter (see 
> https://www.ncbi.nlm.nih.gov/books/NBK25497/).
> _____________________ test_download_wgs_parts_supercontig 
> ______________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7f5355e27ef0>
> 
>     def test_download_wgs_parts_supercontig(req):
>         cfg = Config(format="genbank")
>         supercontig = open(full_path('supercontig.gbk'), 'rt')
>         req.get(ENTREZ_URL, body=open(full_path('supercontig_full.gbk'), 
> 'rt'))
>     
> >       outhandle = wgs.download_wgs_parts(supercontig, cfg)
> 
> tests/test_wgs.py:128: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:116: in download_wgs_parts
>     updated_records.extend(fix_supercontigs(record, config))
> ncbi_acc_download/wgs.py:191: in fix_supercontigs
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7f5355e57e00>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> __________________ test_download_wgs_parts_supercontig_retry 
> ___________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7f5355e27a10>
> 
>     def test_download_wgs_parts_supercontig_retry(req):
>         cfg = Config(format="genbank")
>         supercontig = open(full_path('supercontig.gbk'), 'rt')
>         req.get(ENTREZ_URL, response_list=[
>             {"text": u'Whoa, slow down', "status_code": 429, "headers": 
> {"Retry-After": "0"}},
>             {"body": open(full_path('supercontig_full.gbk'), 'rt')}
>         ])
>     
> >       outhandle = wgs.download_wgs_parts(supercontig, cfg)
> 
> tests/test_wgs.py:143: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:116: in download_wgs_parts
>     updated_records.extend(fix_supercontigs(record, config))
> ncbi_acc_download/wgs.py:191: in fix_supercontigs
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7f5355d2efc0>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> ----------------------------- Captured stdout call 
> -----------------------------
> Too many requests, please consider using --api-key parameter (see 
> https://www.ncbi.nlm.nih.gov/books/NBK25497/).
> =========================== short test summary info 
> ============================
> FAILED tests/test_wgs.py::test_download_wgs_parts_wgs - TypeError: a 
> bytes-li...
> FAILED tests/test_wgs.py::test_download_wgs_parts_wgs_retry - TypeError: a 
> by...
> FAILED tests/test_wgs.py::test_download_wgs_parts_supercontig - TypeError: a 
> ...
> FAILED tests/test_wgs.py::test_download_wgs_parts_supercontig_retry - 
> TypeErr...
> =================== 4 failed, 27 passed, 1 xfailed in 0.72s 
> ====================
> E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ncbi-acc-download/build; python3.12 
> -m pytest tests
> I: pybuild base:311: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build; python3.11 
> -m pytest tests
> ============================= test session starts 
> ==============================
> platform linux -- Python 3.11.9, pytest-8.2.2, pluggy-1.5.0
> rootdir: /<<PKGBUILDDIR>>
> plugins: cov-5.0.0, requests-mock-1.11.0, mock-3.12.0
> collected 32 items
> 
> tests/test_core.py ................                                      [ 
> 50%]
> tests/test_correct.py .                                                  [ 
> 53%]
> tests/test_download.py .                                                 [ 
> 56%]
> tests/test_validate.py ...                                               [ 
> 65%]
> tests/test_wgs.py ....FF.FF.x                                            
> [100%]
> 
> =================================== FAILURES 
> ===================================
> _________________________ test_download_wgs_parts_wgs 
> __________________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7fe159522b10>
> 
>     def test_download_wgs_parts_wgs(req):
>         cfg = Config(format="genbank")
>         wgs_contig = open(full_path('wgs.gbk'), 'rt')
>         req.get(ENTREZ_URL, body=open(full_path('wgs_full.gbk'), 'rt'))
>     
> >       outhandle = wgs.download_wgs_parts(wgs_contig, cfg)
> 
> tests/test_wgs.py:89: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:114: in download_wgs_parts
>     updated_records.extend(download_wgs_for_record(record, config))
> ncbi_acc_download/wgs.py:164: in download_wgs_for_record
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7fe159520650>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> ______________________ test_download_wgs_parts_wgs_retry 
> _______________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7fe159432790>
> 
>     def test_download_wgs_parts_wgs_retry(req):
>         cfg = Config(format="genbank")
>         wgs_contig = open(full_path('wgs.gbk'), 'rt')
>         req.get(ENTREZ_URL, response_list=[
>             {"text": u'Whoa, slow down', "status_code": 429, "headers": 
> {"Retry-After": "0"}},
>             {"body": open(full_path('wgs_full.gbk'), 'rt')},
>         ])
>     
> >       outhandle = wgs.download_wgs_parts(wgs_contig, cfg)
> 
> tests/test_wgs.py:104: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:114: in download_wgs_parts
>     updated_records.extend(download_wgs_for_record(record, config))
> ncbi_acc_download/wgs.py:164: in download_wgs_for_record
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7fe159409710>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> ----------------------------- Captured stdout call 
> -----------------------------
> Too many requests, please consider using --api-key parameter (see 
> https://www.ncbi.nlm.nih.gov/books/NBK25497/).
> _____________________ test_download_wgs_parts_supercontig 
> ______________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7fe1594b3290>
> 
>     def test_download_wgs_parts_supercontig(req):
>         cfg = Config(format="genbank")
>         supercontig = open(full_path('supercontig.gbk'), 'rt')
>         req.get(ENTREZ_URL, body=open(full_path('supercontig_full.gbk'), 
> 'rt'))
>     
> >       outhandle = wgs.download_wgs_parts(supercontig, cfg)
> 
> tests/test_wgs.py:128: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:116: in download_wgs_parts
>     updated_records.extend(fix_supercontigs(record, config))
> ncbi_acc_download/wgs.py:191: in fix_supercontigs
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7fe1594dd250>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> __________________ test_download_wgs_parts_supercontig_retry 
> ___________________
> 
> req = <requests_mock.mocker.Mocker object at 0x7fe15aedcdd0>
> 
>     def test_download_wgs_parts_supercontig_retry(req):
>         cfg = Config(format="genbank")
>         supercontig = open(full_path('supercontig.gbk'), 'rt')
>         req.get(ENTREZ_URL, response_list=[
>             {"text": u'Whoa, slow down', "status_code": 429, "headers": 
> {"Retry-After": "0"}},
>             {"body": open(full_path('supercontig_full.gbk'), 'rt')}
>         ])
>     
> >       outhandle = wgs.download_wgs_parts(supercontig, cfg)
> 
> tests/test_wgs.py:143: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ncbi_acc_download/wgs.py:116: in download_wgs_parts
>     updated_records.extend(fix_supercontigs(record, config))
> ncbi_acc_download/wgs.py:191: in fix_supercontigs
>     write_stream(r, handle, dl_id, config)
> ncbi_acc_download/download.py:118: in write_stream
>     for chunk in request.iter_content(4096, decode_unicode=True):
> /usr/lib/python3/dist-packages/requests/utils.py:568: in 
> stream_decode_response_unicode
>     yield from iterator
> /usr/lib/python3/dist-packages/requests/models.py:820: in generate
>     yield from self.raw.stream(chunk_size, decode_content=True)
> /usr/lib/python3/dist-packages/urllib3/response.py:936: in stream
>     data = self.read(amt=amt, decode_content=decode_content)
> /usr/lib/python3/dist-packages/urllib3/response.py:910: in read
>     data = self._decoded_buffer.get(amt)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.response.BytesQueueBuffer object at 0x7fe15930b650>, n = 4096
> 
>     def get(self, n: int) -> bytes:
>         if n == 0:
>             return b""
>         elif not self.buffer:
>             raise RuntimeError("buffer is empty")
>         elif n < 0:
>             raise ValueError("n should be > 0")
>     
>         fetched = 0
>         ret = io.BytesIO()
>         while fetched < n:
>             remaining = n - fetched
>             chunk = self.buffer.popleft()
>             chunk_length = len(chunk)
>             if remaining < chunk_length:
>                 left_chunk, right_chunk = chunk[:remaining], chunk[remaining:]
>                 ret.write(left_chunk)
>                 self.buffer.appendleft(right_chunk)
>                 self._size -= remaining
>                 break
>             else:
> >               ret.write(chunk)
> E               TypeError: a bytes-like object is required, not 'str'
> 
> /usr/lib/python3/dist-packages/urllib3/response.py:272: TypeError
> ----------------------------- Captured stdout call 
> -----------------------------
> Too many requests, please consider using --api-key parameter (see 
> https://www.ncbi.nlm.nih.gov/books/NBK25497/).
> =========================== short test summary info 
> ============================
> FAILED tests/test_wgs.py::test_download_wgs_parts_wgs - TypeError: a 
> bytes-li...
> FAILED tests/test_wgs.py::test_download_wgs_parts_wgs_retry - TypeError: a 
> by...
> FAILED tests/test_wgs.py::test_download_wgs_parts_supercontig - TypeError: a 
> ...
> FAILED tests/test_wgs.py::test_download_wgs_parts_supercontig_retry - 
> TypeErr...
> =================== 4 failed, 27 passed, 1 xfailed in 0.85s 
> ====================
> E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ncbi-acc-download/build; python3.11 
> -m pytest tests
> dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.12 
> 3.11" returned exit code 13


The full build log is available from:
http://qa-logs.debian.net/2024/06/15/ncbi-acc-download_0.2.8-2_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240615;users=lu...@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20240615&fusertaguser=lu...@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.

Reply via email to