Skip to content

sdist is incomplete for tests: test_meson_python_file_handling assumes missing packages/ workspace #452

@mcepl

Description

@mcepl

Hi,
while packaging griffe 2.0.2 for openSUSE, the test suite fails when run from the PyPI source tarball (sdist), even though most of the suite passes.

The failing test is:

  • tests/test_finder.py::test_meson_python_file_handling

Failure:

FileNotFoundError: [Errno 2] No such file or directory: 'packages/griffelib/src'
From the test:
pth_file.write_text(
    "hello=1\ninstall({'griffe', 'hello'}, 'packages/griffelib', ['/tmp/ninja'], False)",
    encoding="utf8",
)
...
assert paths == [Path("packages/griffelib/src")]

The problem seems to be that the test assumes a repository/workspace checkout layout where packages/griffelib/src exists. However, in the published sdist, the packages/ directory is not included.

Relevant pyproject.toml bits:

  • the sdist include list does not include /packages
  • but the project still defines a workspace with members = ["packages/*"]

So either:

  1. the sdist should include the packages/ tree needed by the tests, or
  2. this test should not assume checkout-only paths when run from an sdist

In downstream packaging, we currently have to skip this single test when testing from the released tarball.
Would you prefer a patch to the test, or should the sdist contents be adjusted?

Metadata

Metadata

Assignees

Labels

packagingPackaging or distribution issuestestsIssue or enhancement within tests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions