Skip to content

Ship the examples used by the tests and docs in the sdist #196

Done

Description

@tony

Summary

The source distribution built from #193 contains the tests and docs but omits the five example files they read. A contributor testing the archive gets failures that do not occur in the checkout. The wheel can still be built.

Reproduction

  1. In a clean checkout of the reviewed revision, install the development dependencies.
$ uv sync --frozen --all-groups
  1. Build the source archive and run the packaged replay test, game doctests, and attached-tmux test from the extracted source. The tmux cases require a supported tmux on PATH.
work=$(mktemp -d)
python=$(uv run --frozen python -c 'import sys; print(sys.executable)')
uv build --sdist --out-dir "$work"
mkdir "$work/source"
tar -xf "$work"/*.tar.gz -C "$work/source" --strip-components=1
cd "$work/source"
PYTHONPATH="$PWD/src" "$python" -m pytest -q \
  tests/test_testing.py::test_pytest_failure_replays_ordered_resize_and_written_space \
  docs/topics/interactive-game.md \
  tests/test_tmux.py::test_attached_tmux_screen_example

Expected

The examples referenced by the shipped tests and documentation are present and executable from the extracted archive.

Actual

Eight cases fail. Restoring only examples/replay_prompt.py, examples/tmux_screens.py and the three examples/last_beacon/ files makes all eight pass.

Environment

Build and test environment

Linux aarch64, CPython 3.15.2, pytest 9.2.0, tmux 3.8 supplied by mise. The build backend is Hatchling.

References

The sdist include list predates the example tree. #139 adds the replay script, #140 adds the game files, and #141 adds the attached-tmux script. All three can share one packaging change. Verify the extracted artifact through its existing tests.

Activity

  1. added
    bug
    p1
    area:examples
    area:release
    topic:distribution
    python
    on Dec 5, 2026
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

    area:examplesarea:releasebugp1pythontopic:distribution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions