indygreg / indygreg/python-zstandard

0.17.0: pytest is failing

Open
#173 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
642
Forks
116
Avg merge
1d 14h
Merged PRs (30d)
5

Description

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
- `python3 -sBm build -w --no-isolation`
- because I'm calling `build` with `--no-isolation` I'm using during all processes only locally installed modules
- install .whl file in
- run pytest with PYTHONPATH pointing to sitearch and sitelib inside

Here is pytest output:

```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-zstandard-0.17.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-zstandard-0.17.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0
plugins: forked-1.4.0, xdist-2.5.0
collected 0 items / 25 errors / 3 skipped

================================================================================== ERRORS ==================================================================================
________________________________________________________________ ERROR collecting tests/test_buffer_util.py ________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_buffer_util.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_buffer_util.py:4: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
________________________________________________________________ ERROR collecting tests/test_compressor.py _________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
____________________________________________________________ ERROR collecting tests/test_compressor_chunker.py _____________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_chunker.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_chunker.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
____________________________________________________________ ERROR collecting tests/test_compressor_compress.py ____________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_compress.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_compress.py:4: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
__________________________________________________________ ERROR collecting tests/test_compressor_compressobj.py ___________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_compressobj.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_compressobj.py:5: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
__________________________________________________________ ERROR collecting tests/test_compressor_copy_stream.py ___________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_copy_stream.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_copy_stream.py:5: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
____________________________________________________ ERROR collecting tests/test_compressor_multi_compress_to_buffer.py ____________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_multi_compress_to_buffer.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_multi_compress_to_buffer.py:4: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
__________________________________________________________ ERROR collecting tests/test_compressor_read_to_iter.py __________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_read_to_iter.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_read_to_iter.py:4: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
_________________________________________________________ ERROR collecting tests/test_compressor_stream_reader.py __________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_stream_reader.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_stream_reader.py:4: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
_________________________________________________________ ERROR collecting tests/test_compressor_stream_writer.py __________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_compressor_stream_writer.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compressor_stream_writer.py:8: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
______________________________________________________________ ERROR collecting tests/test_data_structures.py ______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_data_structures.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_data_structures.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
_______________________________________________________________ ERROR collecting tests/test_decompressor.py ________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
______________________________________________________ ERROR collecting tests/test_decompressor_content_dict_chain.py ______________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_content_dict_chain.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_content_dict_chain.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
_________________________________________________________ ERROR collecting tests/test_decompressor_copy_stream.py __________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_copy_stream.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_copy_stream.py:5: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
__________________________________________________________ ERROR collecting tests/test_decompressor_decompress.py __________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_decompress.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_decompress.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
________________________________________________________ ERROR collecting tests/test_decompressor_decompressobj.py _________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_decompressobj.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_decompressobj.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
__________________________________________________ ERROR collecting tests/test_decompressor_multi_decompress_to_buffer.py __________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_multi_decompress_to_buffer.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_multi_decompress_to_buffer.py:4: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
_________________________________________________________ ERROR collecting tests/test_decompressor_read_to_iter.py _________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_read_to_iter.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_read_to_iter.py:7: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
________________________________________________________ ERROR collecting tests/test_decompressor_stream_reader.py _________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_stream_reader.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_stream_reader.py:5: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
________________________________________________________ ERROR collecting tests/test_decompressor_stream_writer.py _________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_decompressor_stream_writer.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_decompressor_stream_writer.py:7: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
______________________________________________________________ ERROR collecting tests/test_estimate_sizes.py _______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_estimate_sizes.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_estimate_sizes.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
_____________________________________________________________ ERROR collecting tests/test_module_attributes.py _____________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_module_attributes.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_module_attributes.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
___________________________________________________________________ ERROR collecting tests/test_open.py ____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_open.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_open.py:6: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
_____________________________________________________________ ERROR collecting tests/test_train_dictionary.py ______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_train_dictionary.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_train_dictionary.py:4: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
__________________________________________________________________ ERROR collecting tests/test_utility.py __________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/python-zstandard-0.17.0/tests/test_utility.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_utility.py:3: in
import zstandard as zstd
zstandard/__init__.py:39: in
from .backend_c import * # type: ignore
E ModuleNotFoundError: No module named 'zstandard.backend_c'
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_compressor_fuzzing.py:9: unittest.case.SkipTest: hypothesis not available
SKIPPED [1] tests/test_data_structures_fuzzing.py:8: unittest.case.SkipTest: hypothesis not available
SKIPPED [1] tests/test_decompressor_fuzzing.py:9: unittest.case.SkipTest: hypothesis not available
ERROR tests/test_buffer_util.py
ERROR tests/test_compressor.py
ERROR tests/test_compressor_chunker.py
ERROR tests/test_compressor_compress.py
ERROR tests/test_compressor_compressobj.py
ERROR tests/test_compressor_copy_stream.py
ERROR tests/test_compressor_multi_compress_to_buffer.py
ERROR tests/test_compressor_read_to_iter.py
ERROR tests/test_compressor_stream_reader.py
ERROR tests/test_compressor_stream_writer.py
ERROR tests/test_data_structures.py
ERROR tests/test_decompressor.py
ERROR tests/test_decompressor_content_dict_chain.py
ERROR tests/test_decompressor_copy_stream.py
ERROR tests/test_decompressor_decompress.py
ERROR tests/test_decompressor_decompressobj.py
ERROR tests/test_decompressor_multi_decompress_to_buffer.py
ERROR tests/test_decompressor_read_to_iter.py
ERROR tests/test_decompressor_stream_reader.py
ERROR tests/test_decompressor_stream_writer.py
ERROR tests/test_estimate_sizes.py
ERROR tests/test_module_attributes.py
ERROR tests/test_open.py
ERROR tests/test_train_dictionary.py
ERROR tests/test_utility.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 25 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================================== 3 skipped, 25 errors in 1.05s =======================================================================
```

Content of the ``
```console
[tkloczko@devel-g2v python-zstandard-0.17.0-2.fc35.x86_64]$ ls -lR usr/lib64/python3.8/site-packages/zstandard
usr/lib64/python3.8/site-packages/zstandard:
total 1716
-rwxr-xr-x. 1 tkloczko tkloczko 714688 May 21 17:40 backend_c.cpython-38-x86_64-linux-gnu.so
-rw-r--r--. 1 tkloczko tkloczko 146761 May 21 17:40 backend_cffi.py
-rwxr-xr-x. 1 tkloczko tkloczko 865984 May 21 17:40 _cffi.cpython-38-x86_64-linux-gnu.so
-rw-r--r--. 1 tkloczko tkloczko 7102 May 21 17:40 __init__.py
-rw-r--r--. 1 tkloczko tkloczko 13590 May 21 17:40 __init__.pyi
drwxr-xr-x. 1 tkloczko tkloczko 348 May 21 17:40 __pycache__
-rw-r--r--. 1 tkloczko tkloczko 0 May 21 17:40 py.typed

usr/lib64/python3.8/site-packages/zstandard/__pycache__:
total 320
-rw-r--r--. 1 tkloczko tkloczko 121903 May 21 17:40 backend_cffi.cpython-38.opt-1.pyc
-rw-r--r--. 1 tkloczko tkloczko 59062 May 21 17:40 backend_cffi.cpython-38.opt-2.pyc
-rw-r--r--. 1 tkloczko tkloczko 122064 May 21 17:40 backend_cffi.cpython-38.pyc
-rw-r--r--. 1 tkloczko tkloczko 5012 May 21 17:40 __init__.cpython-38.opt-1.pyc
-rw-r--r--. 1 tkloczko tkloczko 2512 May 21 17:40 __init__.cpython-38.opt-2.pyc
-rw-r--r--. 1 tkloczko tkloczko 5012 May 21 17:40 __init__.cpython-38.pyc
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the listed PEP517 build and installation commands, then inspect zstandard/__init__.py and the installed wheel for the missing zstandard.backend_c module. Run pytest -ra with the shown PYTHONPATH. Done means the built package imports successfully and test collection no longer raises ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.