Skip to content

0.12.1: numcodecs/tests is part of the installable resources #509

Closed

Description

@kloczek

Looks like test suite files are added to list of files which are installed.

Details
+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
[numcodecs] setting up Blosc extension
[numcodecs] setting up Zstandard extension
[numcodecs] setting up LZ4 extension
[numcodecs] setting up compat extension
[numcodecs] setting up shuffle extension
[numcodecs] setting up vlen extension
[numcodecs] setting up fletcher32 extension
[numcodecs] setting up jenkins extension
running egg_info
creating numcodecs.egg-info
writing numcodecs.egg-info/PKG-INFO
writing dependency_links to numcodecs.egg-info/dependency_links.txt
writing requirements to numcodecs.egg-info/requires.txt
writing top-level names to numcodecs.egg-info/top_level.txt
writing manifest file 'numcodecs.egg-info/SOURCES.txt'
reading manifest file 'numcodecs.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'numcodecs.egg-info/SOURCES.txt'
* Building wheel...
[numcodecs] setting up Blosc extension
[numcodecs] setting up Zstandard extension
[numcodecs] setting up LZ4 extension
[numcodecs] setting up compat extension
[numcodecs] setting up shuffle extension
[numcodecs] setting up vlen extension
[numcodecs] setting up fletcher32 extension
[numcodecs] setting up jenkins extension
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/__init__.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/abc.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/astype.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/base64.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/bitround.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/bz2.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/categorize.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/checksum32.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/compat.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/delta.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/fixedscaleoffset.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/gzip.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/json.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/lzma.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/msgpacks.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/ndarray_like.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/packbits.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/pickles.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/quantize.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/registry.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/shuffle.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/zfpy.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/zlib.py -> build/lib.linux-x86_64-cpython-38/numcodecs
copying ./numcodecs/version.py -> build/lib.linux-x86_64-cpython-38/numcodecs
creating build/lib.linux-x86_64-cpython-38/numcodecs/tests        <<<<< FROM HERE
copying ./numcodecs/tests/__init__.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/common.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_astype.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_base64.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_bitround.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_bz2.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_categorize.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_checksum32.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_compat.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_delta.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_entrypoints.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_entrypoints_backport.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_fixedscaleoffset.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_fletcher32.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_gzip.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_jenkins.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_json.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_lz4.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_lzma.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_msgpacks.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_ndarray_like.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_packbits.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_pickles.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_quantize.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_registry.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_shuffle.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_vlen_array.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_vlen_bytes.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_vlen_utf8.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_zfpy.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_zlib.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_zstd.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests
copying ./numcodecs/tests/test_blosc.py -> build/lib.linux-x86_64-cpython-38/numcodecs/tests        <<<<< TO HERE
running egg_info

Easiest way to sort out out would be move numcodecs/tests/ to tests/

Activity

  1. dstansby commented on May 22, 2024

    @dstansby
    Contributor

    Is there a good reason to not include them in the installation? For re-packaging on conda-forge it is much easier to test if the tests are part of the package: https://conda-forge.org/docs/maintainer/adding_pkgs/#tests-outside-of-the-package

  2. dstansby commented on Aug 11, 2024

    @dstansby
    Contributor

    Since there's no large test data in the test directory, I think having tests as part of the installable resources is fine (and makes life easier for conda-forge), so I'll close this. Thanks for opening though!

  3. kloczek commented on Aug 12, 2024

    @kloczek
    Author

    Conda works perfectly fine when test suite is in tests/.

  4. d-v-b commented on Aug 12, 2024

    @d-v-b
    Contributor

    if anyone has the appetite for it, I would suggest moving to src/numcodecs layout with an external test suite in tests. This makes it much easier to ensure proper isolation of the test suite.

  5. dstansby commented on Aug 12, 2024

    @dstansby
    Contributor

    I checked again for conda, and I didn't realise it was possible to copy a folder outside the package to run tests: https://conda-forge.org/docs/maintainer/adding_pkgs/#copying-test-files

    In that case 👍 for this, I will re-open

  6. jakirkham commented on Apr 11, 2025

    @jakirkham
    Member

    Yeah agree with this suggestion

    Think the reason sometimes developers opt for including tests in the distribution is that it provides a way for the user who installed the package to test it simply after the fact

    For example, NumPy supplies numpy.test(), which lets the end user install and run the tests on the installed package

    That said, in a world where most users are getting prebuilt binaries and package builders are often running the test suite, this is not as necessary as it was when most users installed from source

    Even in the case of building from source, a user has the tests available in the source artifact they used to build from

    Mostly what I see is users run into subtle problems due to the structure of nesting tests within the source code. Like discovery or import issues of the sort it seems you have run into. Unpicking them is tricky and may involve others help to unpick. This erodes a lot of the value of including tests within the source code in my view

    So yeah agree it would be good to pull the tests out into their own directory and not ship them with the package. We can update the Conda recipe after. Have done the same thing in other projects. Honestly find the test suite more easy to work with in Conda package builds when split out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions