build: move pytest/pytest-cov/pytest-mock from runtime deps to dev group - #29
Merged
Merged
Conversation
These three packages were declared in [project].dependencies, which forced every consumer that ran `pip install google-colab-cli` to also install the entire pytest test framework plus its transitive deps (coverage, iniconfig, pluggy) -- ~2.5MB of test machinery that user code never imports. The correct semantic for test dependencies is [dependency-groups].dev (PEP 735), which `uv sync` populates by default for contributors but is NOT advertised in the published wheel's metadata as a runtime requirement. Concrete impact measured by installing the resulting wheel into a fresh py3.13 venv (`uv pip install dist/*.whl`): Before: 57 packages, 200 MB site-packages After: 51 packages, 197 MB site-packages Gone: pytest, pytest-cov, pytest-mock, coverage, iniconfig, pluggy Beyond size, removing pytest from runtime deps stops dependency scanners (pipdeptree, pip-audit, dependabot, snyk) from treating pytest version pins as user-facing constraints -- previously, any downstream environment that pinned pytest 8.x for plugin compat would conflict with our floor of pytest>=9.0.2 even though no user code imports pytest. Verified: - `uv sync` + `uv run pytest tests/` -> 201 passed (dev group still installs everything contributors need) - `uv run ruff check .` -> clean - Built wheel + installed into fresh venv: no pytest/coverage/pluggy in site-packages, `colab version` works, `colab url` works (verifies googlecolab#27 fragment fix is intact in the install path).
sethtroisi
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pytest,pytest-cov,pytest-mockwere in[project].dependencies, which forced everypip install google-colab-cliuser to install the entire pytest test framework plus its transitive deps (coverage,iniconfig,pluggy). Move them to[dependency-groups].dev(PEP 735) where they belong.Concrete impact
Measured by installing the resulting wheel into a fresh py3.13 venv:
pytest,pytest-cov,pytest-mock,coverage,iniconfig,pluggyWhy it matters beyond size
Removing pytest from runtime deps stops dependency scanners (
pipdeptree,pip-audit, dependabot, snyk) from treating pytest version pins as user-facing constraints. Previously, any downstream environment that pinnedpytest 8.xfor plugin compat would conflict with our floor ofpytest>=9.0.2even though no user code imports pytest.What still works
uv syncpopulates both groups by default, so contributors get pytest automatically — no workflow change.uv run pytest tests/→ 201 passed.uv run ruff check .→ clean.colab versionworks,colab urlworks (also verifies fix(url): also emit #datalabBackendUrl=<full URL> fragment #27's fragment fix is intact in the install path).