Skip to content

🔧 Include tests/ and tox.ini in the sdist - #426

Merged
chrisjsewell merged 5 commits into
masterfrom
claude/pr-420
Sep 9, 2026
Merged

🔧 Include tests/ and tox.ini in the sdist#426
chrisjsewell merged 5 commits into
masterfrom
claude/pr-420

Conversation

@chrisjsewell

@chrisjsewell chrisjsewell commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Supersedes #420 by @BetterAndBetterII (GitHub refused to update that fork branch because the merge would carry workflow-file changes); their commits are carried here verbatim with authorship preserved (thank you!). Closes #261, open since 2023 from a distro packager.

PyPI sdists shipped tox.ini but omitted tests/, so packagers could not run the suite from the tarball. tests/ is moved out of [tool.flit.sdist] exclude and tests/ plus tox.ini are explicitly included; docs/ and benchmarking/ stay excluded.

Commits

  1. fix: include tests/ (and tox.ini) in the flit sdist and the pre-commit.ci autofix — the contributor's commits, unchanged.
  2. 🧪 TEST: Assert sdist contents by building the sdist — the original test only string-matched pyproject.toml. It now builds a real sdist with flit_core (no network, ~0.15 s) and asserts markdown_it/__init__.py, tests/test_api/test_main.py and tox.ini are members and nothing under docs/ or benchmarking/ is. It skips cleanly when flit_core is unavailable or when not run from a source checkout. Verified negative: with the include reverted, the test fails on tests/test_api/test_main.py.

Verification

BetterAndBetterII and others added 5 commits September 9, 2026 12:01
Fixes #261 — flit_core sdists omitted the test suite while shipping
tox.ini, so distro packagers could not run the project's tests from the
PyPI source tarball. Explicitly include tests/ and tox.ini; keep docs/
and benchmarking/ excluded.
Replace the pyproject.toml text-grep with a test that builds the sdist
with flit_core and asserts that tests/, tox.ini and the package itself
are members of the tarball, and that docs/ and benchmarking/ are not.
The test skips when flit_core is unavailable, or when not run from a
source checkout.
pip builds the package in an isolated environment, so flit_core was not
importable in the test jobs and tests/test_packaging skipped there
(CI reported "1000 passed, 1 skipped"). Adding flit_core to the testing
extra lets the assertion actually run.
@chrisjsewell
chrisjsewell merged commit 2700cc3 into master Sep 9, 2026
13 checks passed
@chrisjsewell
chrisjsewell deleted the claude/pr-420 branch September 9, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sdist is missing tests

2 participants