tests.test_metadata module¶
Tests for repomatic.metadata.core: the CI metadata singleton and its dump.
- class tests.test_metadata.OptionalList(item_pattern)[source]¶
Bases:
objectMatcher for values that can be None or a list matching a pattern.
Used for fields like
new_commitsthat areNoneoutside GitHub Actions but contain commit SHAs when running in CI with event data.
- class tests.test_metadata.OptionalString(item_pattern)[source]¶
Bases:
objectMatcher for GitHub format values that can be empty or space-separated items.
GitHub Actions format converts None to empty string and lists to space-separated quoted strings. This class matches either case.
- class tests.test_metadata.AnyBool[source]¶
Bases:
objectMatcher that accepts either True or False.
Used for fields that depend on repository state and can vary between test runs.
- class tests.test_metadata.AnyBoolString[source]¶
Bases:
objectMatcher that accepts either ‘true’ or ‘false’ string.
Used for GitHub format booleans that depend on repository state.
- class tests.test_metadata.AnyLengthList(item_pattern)[source]¶
Bases:
objectMatcher for lists where each item matches a pattern, regardless of length.
Used for matrix fields like
commitwhere the number of commits can vary depending on how many are pushed together.
- class tests.test_metadata.StringList(iterable=(), /)[source]¶
Bases:
listA list of plain strings serialized without double-quoting in GitHub Actions format.
Used for metadata fields like
cli_scriptsthat contain plain string values (not file paths). File path lists use double-quoted space-separated format because the actual metadata holdsPathobjects; plain string lists do not.
- class tests.test_metadata.PartialIncludeList(required_items)[source]¶
Bases:
objectMatcher for include lists where required items must be present.
The nuitka_matrix
includelist contains per-commit entries that multiply when multiple commits are pushed together. This matcher validates that all required items (build targets, entry point info, state) are present, while allowing additional commit-specific items.
- class tests.test_metadata.OptionalMatrix[source]¶
Bases:
objectMatcher for values that can be None or a matrix dict with commit data.
Used for fields like
new_commits_matrixthat areNoneoutside GitHub Actions but contain a matrix dict when running in CI with event data.
- class tests.test_metadata.OptionalMatrixOrEmptyString[source]¶
Bases:
objectMatcher for GitHub format values that can be empty string or a matrix dict.
GitHub Actions format converts None to empty string. In CI, the value is a dict.
- class tests.test_metadata.OptionalVersionString(version_pattern)[source]¶
Bases:
objectMatcher for values that can be None or a version string.
Used for
released_versionwhich isNoneduring development but contains a version string like"5.5.0"on release branches.
- class tests.test_metadata.OptionalVersionOrEmptyString(version_pattern)[source]¶
Bases:
objectMatcher for GitHub format values that can be empty string or a version string.
GitHub Actions format converts None to empty string. On release branches, the value is a version string.
- class tests.test_metadata.AnyReleaseNotes(dev_pattern, release_pattern)[source]¶
Bases:
objectMatcher for release notes that vary based on development vs release state.
During development, release notes contain a warning that the version is not released yet. On release branches, the notes contain actual release content. None is valid when the changelog section is empty (e.g. right after a release).
- class tests.test_metadata.AnyReleaseNotesOrEmptyString(dev_pattern, release_pattern)[source]¶
Bases:
objectMatcher for GitHub format release notes.
Can be empty string (when no version), None (empty changelog section), or match either development or release notes patterns.
- tests.test_metadata.iter_checks(metadata, expected, context)[source]¶
Recursively iterate over expected content and check it matches in metadata.
- Return type:
- tests.test_metadata.MARKDOWN_EXTENSIONS = ('markdown', 'mdown', 'mkdn', 'mdwn', 'mkd', 'md', 'mdtxt', 'mdtext', 'mdx')¶
The
markdown_filesbrace set, mirroringMetadata.markdown_files.
- tests.test_metadata.MARKDOWN_INVENTORY = ['.claude/agents/grunt-qa.md', '.claude/agents/qa-engineer.md', '.claude/agents/sphinx-docs.md', '.claude/skills/av-false-positive/SKILL.md', '.claude/skills/awesome-triage/SKILL.md', '.claude/skills/babysit-ci/SKILL.md', '.claude/skills/babysit-ci/references/failure-patterns.md', '.claude/skills/benchmark-update/SKILL.md', '.claude/skills/brand-assets/SKILL.md', '.claude/skills/file-bug-report/SKILL.md', '.claude/skills/github-housekeeping/SKILL.md', '.claude/skills/probe-workflow/SKILL.md', '.claude/skills/repomatic-audit/SKILL.md', '.claude/skills/repomatic-changelog/SKILL.md', '.claude/skills/repomatic-deps/SKILL.md', '.claude/skills/repomatic-init/SKILL.md', '.claude/skills/repomatic-ship/SKILL.md', '.claude/skills/repomatic-ship/references/findings-in-repomatic.md', '.claude/skills/repomatic-ship/references/short-ship.md', '.claude/skills/repomatic-test-matrix/SKILL.md', '.claude/skills/repomatic-topics/SKILL.md', '.claude/skills/repomatic-upgrade/SKILL.md', '.claude/skills/sphinx-docs-sync/SKILL.md', '.claude/skills/translation-sync/SKILL.md', '.claude/skills/upstream-audit/SKILL.md', '.github/code-of-conduct.md', 'changelog.md', 'claude.md', 'docs/agent-skills.md', 'docs/benchmark.md', 'docs/binaries.md', 'docs/changelog-archive.md', 'docs/changelog.md', 'docs/claude-code-plugin.md', 'docs/cli.md', 'docs/cloudflare.md', 'docs/code-of-conduct.md', 'docs/commit-messages.md', 'docs/configuration.md', 'docs/contributing.md', 'docs/dependencies.md', 'docs/history.md', 'docs/index.md', 'docs/install.md', 'docs/license.md', 'docs/man.md', 'docs/nuitka.md', 'docs/operation-contracts.md', 'docs/packaging.md', 'docs/repomatic.awesome_toc.md', 'docs/repomatic.broken_links.md', 'docs/repomatic.cache.md', 'docs/repomatic.changelog.md', 'docs/repomatic.cli.github.md', 'docs/repomatic.cli.lint.md', 'docs/repomatic.cli.main.md', 'docs/repomatic.cli.md', 'docs/repomatic.cli.release.md', 'docs/repomatic.cli.sample.md', 'docs/repomatic.cli.setup.md', 'docs/repomatic.cli.sync.md', 'docs/repomatic.cloudflare.md', 'docs/repomatic.cloudflare_r2.md', 'docs/repomatic.compat.md', 'docs/repomatic.config.md', 'docs/repomatic.data.awesome_template.md', 'docs/repomatic.data.md', 'docs/repomatic.deps.dep_graph.md', 'docs/repomatic.deps.dep_policy.md', 'docs/repomatic.deps.dep_report.md', 'docs/repomatic.deps.dep_sources.md', 'docs/repomatic.deps.md', 'docs/repomatic.deps.uv.md', 'docs/repomatic.deps.vulnerable_deps.md', 'docs/repomatic.docs.md', 'docs/repomatic.file_inventory.md', 'docs/repomatic.file_ops.md', 'docs/repomatic.forge.md', 'docs/repomatic.frontmatter.md', 'docs/repomatic.git_ops.md', 'docs/repomatic.github.actions.md', 'docs/repomatic.github.ci_status.md', 'docs/repomatic.github.dev_release.md', 'docs/repomatic.github.gh.md', 'docs/repomatic.github.issue.md', 'docs/repomatic.github.job_timings.md', 'docs/repomatic.github.matrix.md', 'docs/repomatic.github.md', 'docs/repomatic.github.pr.md', 'docs/repomatic.github.pr_body.md', 'docs/repomatic.github.release_sync.md', 'docs/repomatic.github.releases.md', 'docs/repomatic.github.sponsor.md', 'docs/repomatic.github.status.md', 'docs/repomatic.github.token.md', 'docs/repomatic.github.unsubscribe.md', 'docs/repomatic.github.workflow_sync.md', 'docs/repomatic.gitignore.md', 'docs/repomatic.hashing.md', 'docs/repomatic.http.md', 'docs/repomatic.humanize.md', 'docs/repomatic.images.md', 'docs/repomatic.init_project.md', 'docs/repomatic.labels.md', 'docs/repomatic.lint_repo.md', 'docs/repomatic.mailmap.md', 'docs/repomatic.matrix_axes.md', 'docs/repomatic.md', 'docs/repomatic.metadata.core.md', 'docs/repomatic.metadata.env.md', 'docs/repomatic.metadata.git.md', 'docs/repomatic.metadata.matrix.md', 'docs/repomatic.metadata.md', 'docs/repomatic.metadata.project.md', 'docs/repomatic.metric_chart.md', 'docs/repomatic.metrics.md', 'docs/repomatic.npm.md', 'docs/repomatic.pages_redirects.md', 'docs/repomatic.pypi.md', 'docs/repomatic.pyproject.md', 'docs/repomatic.registry.md', 'docs/repomatic.release.attestation.md', 'docs/repomatic.release.binaries_page.md', 'docs/repomatic.release.binary.md', 'docs/repomatic.release.checksums.md', 'docs/repomatic.release.md', 'docs/repomatic.release.prepare_release.md', 'docs/repomatic.release.version_sync.md', 'docs/repomatic.release.virustotal.md', 'docs/repomatic.runner_catalog.md', 'docs/repomatic.runner_images.md', 'docs/repomatic.setup_guide.md', 'docs/repomatic.sync_ops.md', 'docs/repomatic.tabular.md', 'docs/repomatic.templates.md', 'docs/repomatic.tooling.bundle.md', 'docs/repomatic.tooling.md', 'docs/repomatic.tooling.plugin.md', 'docs/repomatic.tooling.tool_registry.md', 'docs/repomatic.tooling.tool_runner.md', 'docs/repomatic.versions.md', 'docs/security.md', 'docs/subagents.md', 'docs/test-matrix.md', 'docs/tests.conftest.md', 'docs/tests.md', 'docs/tests.test_actions.md', 'docs/tests.test_attestation.md', 'docs/tests.test_awesome_template.md', 'docs/tests.test_awesome_toc.md', 'docs/tests.test_binaries_page.md', 'docs/tests.test_binary.md', 'docs/tests.test_broken_links.md', 'docs/tests.test_cache.md', 'docs/tests.test_changelog.md', 'docs/tests.test_checksums.md', 'docs/tests.test_ci_status.md', 'docs/tests.test_claude_assets.md', 'docs/tests.test_cloudflare.md', 'docs/tests.test_cloudflare_r2.md', 'docs/tests.test_config.md', 'docs/tests.test_dep_graph.md', 'docs/tests.test_dep_policy.md', 'docs/tests.test_dep_report.md', 'docs/tests.test_dep_sources.md', 'docs/tests.test_dev_release.md', 'docs/tests.test_docs.md', 'docs/tests.test_docstrings.md', 'docs/tests.test_forge.md', 'docs/tests.test_frontmatter.md', 'docs/tests.test_gh.md', 'docs/tests.test_git_ops.md', 'docs/tests.test_gitignore.md', 'docs/tests.test_hashing.md', 'docs/tests.test_help.md', 'docs/tests.test_http.md', 'docs/tests.test_humanize.md', 'docs/tests.test_images.md', 'docs/tests.test_imports.md', 'docs/tests.test_init_project.md', 'docs/tests.test_issue.md', 'docs/tests.test_job_timings.md', 'docs/tests.test_labels.md', 'docs/tests.test_lint_repo.md', 'docs/tests.test_mailmap.md', 'docs/tests.test_matrix.md', 'docs/tests.test_metadata.md', 'docs/tests.test_metrics.md', 'docs/tests.test_npm.md', 'docs/tests.test_pages_redirects.md', 'docs/tests.test_platform_keys.md', 'docs/tests.test_plugin.md', 'docs/tests.test_plugin_update_detection.md', 'docs/tests.test_pr.md', 'docs/tests.test_pr_body.md', 'docs/tests.test_prepare_release.md', 'docs/tests.test_pypi.md', 'docs/tests.test_pyproject.md', 'docs/tests.test_readme.md', 'docs/tests.test_release_sync.md', 'docs/tests.test_releases.md', 'docs/tests.test_runner_catalog.md', 'docs/tests.test_runner_sync.md', 'docs/tests.test_setup_guide.md', 'docs/tests.test_skills.md', 'docs/tests.test_sphinx_crossrefs.md', 'docs/tests.test_status.md', 'docs/tests.test_suite_hygiene.md', 'docs/tests.test_sync_ops.md', 'docs/tests.test_tabular.md', 'docs/tests.test_todolist.md', 'docs/tests.test_tool_runner.md', 'docs/tests.test_unsubscribe.md', 'docs/tests.test_uv.md', 'docs/tests.test_version_sync.md', 'docs/tests.test_versions.md', 'docs/tests.test_virustotal.md', 'docs/tests.test_vulnerable_deps.md', 'docs/tests.test_workflow_sync.md', 'docs/tests.test_workflows.md', 'docs/todolist.md', 'docs/tool-runner.md', 'docs/upstream-development.md', 'docs/upstream.md', 'docs/workflows.md', 'readme.md', 'repomatic/data/awesome_template/.github/code-of-conduct.md', 'repomatic/data/awesome_template/.github/contributing.md', 'repomatic/data/awesome_template/.github/contributing.zh.md', 'repomatic/data/awesome_template/.github/pull_request_template.md', 'repomatic/templates/available-admonition.md', 'repomatic/templates/broken-links-issue.md', 'repomatic/templates/bump-version.md', 'repomatic/templates/detect-squash-merge.md', 'repomatic/templates/development-warning.md', 'repomatic/templates/fix-changelog.md', 'repomatic/templates/fix-typos.md', 'repomatic/templates/fix-vulnerable-deps.md', 'repomatic/templates/format-images.md', 'repomatic/templates/format-json.md', 'repomatic/templates/format-markdown.md', 'repomatic/templates/format-pyproject.md', 'repomatic/templates/format-python.md', 'repomatic/templates/format-shell.md', 'repomatic/templates/generated-footer.md', 'repomatic/templates/github-releases.md', 'repomatic/templates/immutable-releases.md', 'repomatic/templates/refresh-tip.md', 'repomatic/templates/release-notes.md', 'repomatic/templates/release-sync-report.md', 'repomatic/templates/sample-metrics.md', 'repomatic/templates/scan-virustotal.md', 'repomatic/templates/setup-guide-branch-ruleset.md', 'repomatic/templates/setup-guide-cloudflare-pages.md', 'repomatic/templates/setup-guide-cloudflare-r2.md', 'repomatic/templates/setup-guide-dependabot.md', 'repomatic/templates/setup-guide-fork-pr-approval.md', 'repomatic/templates/setup-guide-notifications-pat.md', 'repomatic/templates/setup-guide-pages-source.md', 'repomatic/templates/setup-guide-pypi-trusted-publisher.md', 'repomatic/templates/setup-guide-sha-pinning-required.md', 'repomatic/templates/setup-guide-token.md', 'repomatic/templates/setup-guide-verify.md', 'repomatic/templates/setup-guide-virustotal.md', 'repomatic/templates/setup-guide.md', 'repomatic/templates/sync-action-pins.md', 'repomatic/templates/sync-bumpversion.md', 'repomatic/templates/sync-dep-sources.md', 'repomatic/templates/sync-gitignore.md', 'repomatic/templates/sync-mailmap.md', 'repomatic/templates/sync-repomatic-upgrade.md', 'repomatic/templates/sync-repomatic.md', 'repomatic/templates/sync-runner-images.md', 'repomatic/templates/sync-tool-versions.md', 'repomatic/templates/sync-uv-lock.md', 'repomatic/templates/sync-workflow-pins.md', 'repomatic/templates/unavailable-admonition.md', 'repomatic/templates/unsubscribe-phase1.md', 'repomatic/templates/unsubscribe-phase2.md', 'repomatic/templates/update-dep-graph.md', 'repomatic/templates/update-docs.md', 'repomatic/templates/upgrade-invite.md', 'repomatic/templates/yanked-admonition.md']¶
Every Markdown file tracked in the repository, in
glob_filesorder.Backs both
doc_filesandmarkdown_files. The two metadata keys glob different extension sets:doc_filesalso takes.rstand.tex. They coincide only because the repository currently ships neither, so the day one lands the two expectations below have to diverge.
- tests.test_metadata.test_dump_factories_match_key_descriptions()[source]¶
The three views of the key inventory must name the same keys.
_METADATA_KEY_DESCRIPTIONS(what--list-keysand the docs table show),Metadata.dump_factories(what the command emits) andall_metadata_keys(what the command accepts as an argument) are three hand-maintained lists sitting far apart in the module. A description without a factory makesrepomatic show-metadata <key>accept the key and then emit nothing; a factory without a description drops the key from--list-keysand the rendered docs.
- tests.test_metadata.test_metadata_keys_reference_documents_every_key()[source]¶
Every emitted key needs a non-empty description in the reference table.
- tests.test_metadata.test_config_defaults_render_as_github_values(field_name)[source]¶
Every config field exposed as metadata must survive GitHub encoding.
A nested config dataclass has no GitHub encoding, so adding one without listing it in
SUBCOMMAND_CONFIG_FIELDSmakesrepomatic show-metadataraiseNotImplementedErroron every run. Checking the dataclass defaults rather than this repository’s own values keeps the guard on the declared surface.
- tests.test_metadata.test_file_inventories_are_not_vacuous()[source]¶
The git-derived inventories really enumerate the tree.
Guards the
_tracked_inventoryderivations against a filter typo silently emptying a list: each inventory must contain a signature file that will exist for the life of the project, and the symlink collapse must keep targets, never link names.
- tests.test_metadata.test_gitignore_is_decoded_as_utf8_whatever_the_locale(tmp_path)[source]¶
A non-ASCII
.gitignorepattern matches under a locale that is not UTF-8.py-walk decodes the file with the locale encoding, so the inventory decodes it itself. The probe runs in an interpreter of its own, because the locale is fixed when an interpreter starts. It is a file and not a
-cargument: Python reads a source file as UTF-8 under any locale, and its command line with the locale encoding.
- tests.test_metadata.test_metadata_command_renders_under_captured_runner()[source]¶
repomatic show-metadatarenders to a captured stdout that has no descriptor.The docs
{click:run}directive live-renders this command through click-extra’s in-memory runner, which is Click’s defaultcapture="sys"mode: its stdout has nofileno().prep_pathmust degrade to that stream rather than reopening its descriptor, and a bare stdout run must stay silent (no spurious overwrite warning) so the rendered block is pure JSON. Seerepomatic.cli.main.prep_path.
- tests.test_metadata.test_python_version_sort_key_orders_by_release(versions, expected)[source]¶
Versions sort numerically, a flavor right after its base version.
- tests.test_metadata.test_show_test_matrix_renders_full_grid()[source]¶
--gridrenders the full matrix as a labelled grid.
- tests.test_metadata.test_show_test_matrix_rows_sorted_by_release(view)[source]¶
Both views order Python rows by release, flavors after their base.
- tests.test_metadata.test_show_test_matrix_columns_follow_canonical_order(matrix_name, canonical)[source]¶
Grid OS columns follow the runner order of the axis constants.
- tests.test_metadata.test_show_test_matrix_pr_is_reduced()[source]¶
The
prargument selects a grid with fewer rows and columns thanfull.
- tests.test_metadata.test_show_test_matrix_no_emoji_uses_plain_words()[source]¶
--no-emojirenders bare state words, deriving the expectation from config.
- tests.test_metadata.test_format_matrix_cell_labels_every_state()[source]¶
Each state of a cell shared by several jobs gets its own glyph.
- tests.test_metadata.test_format_matrix_cell_counts_jobs_past_the_first(state, label)[source]¶
A state carrying several jobs says how many; a lone job stays bare.
- tests.test_metadata.test_format_matrix_cell_keeps_the_empty_intersection_placeholder()[source]¶
A cell no job occupies renders whatever
pivotput there.
- tests.test_metadata.test_show_test_matrix_pivots_on_the_chosen_axes()[source]¶
–row-axis and –col-axis transpose the grid onto the named job keys.
- tests.test_metadata.test_flat_matrix_table_columns_every_key_with_the_state_last()[source]¶
Every key any job carries becomes a column, the state landing last.
- tests.test_metadata.test_flat_matrix_table_leads_with_the_keys_it_is_given()[source]¶
Leading keys column first, in order. One no job carries is skipped.
- tests.test_metadata.test_show_test_matrix_lists_every_job_by_default()[source]¶
With no –grid, the command renders one row per solved job.
- tests.test_metadata.test_show_test_matrix_grid_collapses_the_listing()[source]¶
–grid trades the one-row-per-job listing for the two-axis pivot.
The listing is lossless and the grid is not, so the grid never has more rows than there are values on its row axis.
- tests.test_metadata.test_show_test_matrix_rejects_an_unknown_axis()[source]¶
An axis no job carries is refused, naming the keys the matrix has.
- tests.test_metadata.test_show_test_matrix_help_lists_the_axis_keys(axis_option)[source]¶
Both axis options render the keys they accept as a Choice metavar.
- tests.test_metadata.test_show_test_matrix_help_and_validation_read_the_same_keys()[source]¶
The listing offered and the set enforced come from one source.
A hand-kept help string is what drifts: it would keep naming an axis the matrix dropped, or miss the
[tool.repomatic.test-matrix]variation this project just added.
- tests.test_metadata.test_matrix_axis_falls_back_to_the_universal_keys(monkeypatch)[source]¶
An unreadable matrix leaves the keys every matrix carries, never none.
Empty choices would refuse this option’s own default, so a matrix that failed to compute would take the whole command down with it.
- tests.test_metadata.test_matrix_axis_completes_the_keys_it_lists()[source]¶
Shell completion offers the same keys, filtered on what is typed.
- tests.test_metadata.test_show_test_matrix_rejects_unknown_name()[source]¶
An unknown matrix name is rejected by the Choice argument.
- tests.test_metadata.test_dev_targets_default()[source]¶
Without config, the canary subset is the fastest Linux arm builder.
- tests.test_metadata.test_dev_targets_discards_unknown(tmp_path, monkeypatch, caplog)[source]¶
Unknown dev target names are warned about and dropped.
- tests.test_metadata.test_nuitka_matrix_canary_on_push(monkeypatch)[source]¶
An ordinary CI push compiles only the dev-targets canary subset.
- tests.test_metadata.test_nuitka_matrix_full_fleet_on_schedule(monkeypatch)[source]¶
The weekly scheduled run rebuilds every target.
- tests.test_metadata.test_nuitka_matrix_full_fleet_on_release_push(monkeypatch)[source]¶
A push carrying a release commit rebuilds every target.
- tests.test_metadata.test_nuitka_matrix_full_fleet_locally()[source]¶
Outside CI (no event), the matrix keeps the full roster.
- tests.test_metadata.test_nuitka_matrix_needs_no_module_file(tmp_path, monkeypatch)[source]¶
An entry point reaches the matrix whatever the layout of its project.
Nuitka imports the module by name, so the matrix never looks for a file. No
papaya/__main__.pyexists below the working directory, which is what a src-layout project leaves at the path its module name spells.
- tests.test_metadata.test_nuitka_matrix_skips_push_without_dev_targets(monkeypatch)[source]¶
An empty dev-targets list disables binary builds on ordinary pushes.
- tests.test_metadata.test_null_sha_constant()[source]¶
Test that NULL_SHA is a valid 40-character string of zeros.
This constant is used to detect when GitHub sends a null SHA as the “before” commit when a tag is created (since there is no previous commit).
- tests.test_metadata.test_new_commits_degrades_when_git_rejects_checkout(monkeypatch, caplog)[source]¶
A git failure degrades new_commits to None with git’s stderr surfaced, instead of crashing the whole
metadatacommand.Reproduces the compiled-binary self-test running inside a manylinux container over a checkout git refuses as “dubious ownership”.
- tests.test_metadata.test_changed_files_surfaces_git_stderr(monkeypatch, caplog)[source]¶
A
git difffailure degrades changed_files to None and logs git’s stderr.
- tests.test_metadata.test_is_bot_false_by_default(monkeypatch)[source]¶
Test that is_bot is False when not in a bot context.
- tests.test_metadata.test_ci_context_properties(monkeypatch, prop, envvar, value)[source]¶
Test CI context properties read from environment variables.
- tests.test_metadata.test_ci_context_defaults(monkeypatch)[source]¶
Test CI context properties return None when env vars are unset.
- tests.test_metadata.test_ci_context_empty_is_none(monkeypatch, prop, envvar)[source]¶
Test that empty env var values are normalized to None.
- tests.test_metadata.test_repo_name_derived_from_slug(monkeypatch)[source]¶
Test that repo_name is derived from repo_slug.
- tests.test_metadata.test_repo_slug_fallback_chain(monkeypatch, gh_slug, remote_slug, expected)[source]¶
Without
GITHUB_REPOSITORY, the slug falls back to gh, then the remote.Both fallbacks are stubbed rather than probed: on a runner with no
ghauth the real chain yieldsNone, which is what made the original pair of tests assert nothing at all on CI.
- tests.test_metadata.test_repo_name_fallback_to_gh_cli(monkeypatch)[source]¶
repo_nameis the trailing segment of a gh-resolved slug.
- tests.test_metadata.test_is_awesome(monkeypatch, repo, expected)[source]¶
Test that is_awesome detects awesome-* repository names.
- tests.test_metadata.test_is_awesome_none_slug(monkeypatch)[source]¶
Test that is_awesome returns False when repo_slug is None.
- tests.test_metadata.test_repo_owner_fallback_to_slug(monkeypatch)[source]¶
Test that repo_owner falls back to owner from repo_slug.
- tests.test_metadata.test_repo_url_composed(monkeypatch)[source]¶
Test that repo_url is composed from server_url and repo_slug.
- tests.test_metadata.test_repo_url_fallback(monkeypatch)[source]¶
repo_urlcomposes the default server with a gh-resolved slug.
- tests.test_metadata.test_repo_url_none_without_a_slug(monkeypatch)[source]¶
No slug from any source leaves the URL undefined rather than malformed.
- tests.test_metadata.test_server_url_default(monkeypatch)[source]¶
Test that server_url defaults to https://github.com.
- tests.test_metadata.test_repomatic_config_defaults(tmp_path, monkeypatch)[source]¶
Test that [tool.repomatic] config properties return sensible defaults.
- tests.test_metadata.test_full_include_flattens_matrix(tmp_path, monkeypatch)[source]¶
full-includerows emit as standalone jobs in a flat matrix.A full-include cell sharing its
os/python-versionwith a shipped-config combination must add a new job, not overwrite that combination, and the matrix must serialize as a flat{"include": [...]}list so GitHub runs the rows verbatim.
- tests.test_metadata.test_full_include_backfills_probe_defaults(tmp_path, monkeypatch)[source]¶
Free-threaded probe jobs inherit the single-key default includes.
The 3.14t probe is a standalone include pinned to one runner, appended by
solve()and never augmented by GitHub’s include algorithm. The flat full-include matrix backfills the matrix defaults onto it, so it never emits an emptyclick-version/cloup-versionthat GitHub would expand to""and a downstream run step would mishandle.
- tests.test_metadata.test_repomatic_config_custom_values(tmp_path, monkeypatch)[source]¶
Test that [tool.repomatic] config properties read from pyproject.toml.
- tests.test_metadata.test_test_matrix_config_exclude(tmp_path, monkeypatch)[source]¶
Test that test-matrix.exclude removes combos from both matrices.
- tests.test_metadata.test_test_matrix_config_variations(tmp_path, monkeypatch)[source]¶
Test that test-matrix.variations adds to full matrix only.
- tests.test_metadata.test_test_matrix_config_include(tmp_path, monkeypatch)[source]¶
Test that test-matrix.include adds directives to both matrices.
- tests.test_metadata.test_test_matrix_config_replace(tmp_path, monkeypatch)[source]¶
Test that test-matrix.replace swaps axis values in both matrices.
- tests.test_metadata.test_test_matrix_config_remove(tmp_path, monkeypatch)[source]¶
Test that test-matrix.remove drops axis values from both matrices.
- tests.test_metadata.test_test_matrix_config_unstable(tmp_path, monkeypatch)[source]¶
Test test-matrix.unstable flags full-matrix combos and skips the PR matrix.
- tests.test_metadata.test_single_runner_python_versions_are_stable_and_pinned(tmp_path, monkeypatch)[source]¶
Each released flavor runs once, on its pinned runner, stable; never in PR.
Locks the SINGLE_RUNNER_PYTHON_VERSIONS contract for every entry: a free-threaded build is a single-runner smoke test, not the full cross-platform spread, and not an unstable probe.
- tests.test_metadata.test_unstable_python_versions_carry_a_prerelease_label(tmp_path, monkeypatch)[source]¶
Each in-development Python gets a display label; the axis keeps the version.
The label is what the CI job name shows, so an unstable cell reads
py3.15-devand says why it may fail rather than looking like any released one. Adding a version to UNSTABLE_PYTHON_VERSIONS and forgetting its label is the failure this catches.Label and axis value stay separate on purpose:
uv venv --python, whichtests.yamlfeeds frompython-version, does not parse the-devspelling, and downstream[tool.repomatic.test-matrix]directives key on the bare version.
- tests.test_metadata.test_stale_test_matrix_excludes(tmp_path, monkeypatch)[source]¶
Test detection of test-matrix.exclude entries that match no live axis.
- tests.test_metadata.test_unstable_targets_default(tmp_path, monkeypatch)[source]¶
Test that unstable_targets defaults to an empty set.
- tests.test_metadata.test_unstable_targets_ignores_unknown(tmp_path, monkeypatch)[source]¶
Test that unrecognized unstable targets are discarded with a warning.
- tests.test_metadata.test_nuitka_entry_points_default_deduplicates(tmp_path, monkeypatch)[source]¶
Default: alias entry points sharing a callable are deduplicated.
- tests.test_metadata.test_nuitka_entry_points_default_distinct(tmp_path, monkeypatch)[source]¶
Default: entry points with different callables are all kept.
- tests.test_metadata.test_nuitka_entry_points_custom(tmp_path, monkeypatch)[source]¶
Custom entry-points config selects specific entry points.
- tests.test_metadata.test_nuitka_entry_points_all(tmp_path, monkeypatch)[source]¶
Listing all entry points explicitly builds all of them.
- tests.test_metadata.test_nuitka_entry_points_ignores_unknown(tmp_path, monkeypatch)[source]¶
Unrecognized entry points are discarded; falls back to first if all invalid.
- tests.test_metadata.test_script_entries_basic(tmp_path, monkeypatch)[source]¶
Well-formed
[project.scripts]entries parse into (name, module, callable).