Skip to content

Add vulture for development and clean up dead code references#1837

Merged
nathanjmcdougall merged 5 commits into
mainfrom
1836-add-vulture-for-development
Apr 7, 2026
Merged

Add vulture for development and clean up dead code references#1837
nathanjmcdougall merged 5 commits into
mainfrom
1836-add-vulture-for-development

Conversation

@nathanjmcdougall

Copy link
Copy Markdown
Collaborator

Most of these are from CI implementations which are now removed.

Also sneaking in a change in functionality where we will prefer to use poetry if available in the environment when uv isn't instead of using the None backend and pyproject.toml doesn't exist.

Solves #1816 and solves #1836

Most of these are from CI implementations which are now removed.

Also sneaking in a change in functionality where we will prefer to use poetry if available in the environment when uv isn't instead of using the None backend and pyproject.toml doesn't exist.

Solves #1816 and solves #1836
@codspeed-hq

codspeed-hq Bot commented Apr 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing 1836-add-vulture-for-development (1b5a18e) with main (e6862cd)

Open in CodSpeed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds vulture to the development toolchain and removes several now-dead/internal code paths (largely CI/environment helpers), while also adjusting backend auto-detection to prefer Poetry when uv isn’t available and no pyproject.toml exists.

Changes:

  • Add vulture to dev dependencies, configure it in pyproject.toml, and run it via pre-commit.
  • Remove unused modules/APIs (CI GitHub tag integration, environment Python queries, uv python/version helpers, and some tool helper properties/methods).
  • Move test-only utilities into a dedicated _test module and update tests to import from it.

Reviewed changes

Copilot reviewed 119 out of 120 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uv.lock Adds vulture to the dev lock set.
pyproject.toml Adds vulture dev dep and config under [tool.vulture].
.pre-commit-config.yaml Adds the vulture pre-commit hook.
.importlinter Removes layers/contracts for deleted modules.
docs/module-tree.txt Updates module tree to reflect removed modules.
docs/functions.txt Removes references to deleted public/internal functions.
AGENTS.md Updates agent documentation for removed modules/functions.
src/usethis/_backend/dispatch.py Backend auto-detection now falls back to Poetry when appropriate.
src/usethis/_backend/poetry/detect.py Alters Poetry “used” detection logic.
src/usethis/_backend/uv/errors.py Removes unused uv error type.
src/usethis/_core/tool.py Removes now-dead use_tool dispatch and related typing.
src/usethis/_file/manager.py Minor cleanup in __exit__ (unused args).
src/usethis/file/yaml/io.py Removes edit_yaml/read_yaml helpers from production code.
src/usethis/_integrations/pre_commit/hooks.py Removes unused hooks_are_equivalent.
src/usethis/_integrations/pre_commit/version.py Removes get_pre_commit_version from production code.
src/usethis/_integrations/environ/init.py Deletes unused integration package.
src/usethis/_integrations/environ/python.py Deletes unused environment Python query logic.
src/usethis/_integrations/ci/init.py Deletes unused CI integration package.
src/usethis/_integrations/ci/github/init.py Deletes unused GitHub CI integration package.
src/usethis/_integrations/ci/github/errors.py Deletes unused GitHub CI error types.
src/usethis/_integrations/ci/github/tags.py Deletes unused GitHub tag fetcher.
src/usethis/_tool/base.py Removes unused is_config_present.
src/usethis/_tool/pre_commit.py Removes unused any_require_venv.
src/usethis/_pipeweld/func.py Removes unused compatible_config_groups field.
src/usethis/_backend/uv/version.py Deletes unused uv version helper module.
src/usethis/_backend/uv/python.py Deletes unused uv python helper module.
src/usethis/_file/pyproject_toml/remove.py Deletes unused pyproject removal helper.
src/usethis/_test.py Removes test utilities from the usethis package namespace.
src/_test.py Adds consolidated test utilities module used by the test suite.
tests/conftest.py Switches imports to _test and removes cache clear for deleted helper.
tests/test_help.py Switches CliRunner import to _test.
tests/test_install.py Switches change_cwd import to _test.
tests/usethis/test_init.py Switches change_cwd import to _test.
tests/usethis/test_fallback.py Switches GitHub tag helper imports to _test.
tests/usethis/test_deps.py Switches change_cwd import to _test.
tests/usethis/test_config.py Switches change_cwd import to _test.
tests/usethis/_ui/interface/test_version.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_typecheck.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_tool.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_test.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_status.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_spellcheck.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_show.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_rule.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_readme.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_list.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_lint.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_interface_readme.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_interface_badge.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_init.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_hook.py Switches CliRunner/change_cwd import to _test.
tests/usethis/ui/interface/test_format.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_docstyle.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_doc.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_browse.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_author.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_ui/interface/test_arch.py Switches CliRunner/change_cwd import to _test.
tests/usethis/_tool/test_pre_commit.py Switches change_cwd import to _test.
tests/usethis/_tool/test_heuristics.py Switches change_cwd import to _test.
tests/usethis/_tool/test_base.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_ty.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_tach.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_ruff.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_requirements_txt.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_pytest.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_pyproject_toml.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_pyproject_fmt.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_pre_commit.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_mkdocs.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_import_linter.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_deptry.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_coverage_py.py Switches change_cwd import to _test.
tests/usethis/_tool/impl/base/test_codespell.py Switches change_cwd import to _test.
tests/usethis/_pipeweld/test_func.py Removes assertions tied to removed compatible_config_groups.
tests/usethis/_integrations/sonarqube/test_sonarqube_config.py Switches helpers to _test (incl. uv_python_pin).
tests/usethis/_integrations/pytest/test_core.py Switches change_cwd import to _test.
tests/usethis/_integrations/project/test_packages.py Switches change_cwd import to _test.
tests/usethis/_integrations/project/test_license.py Switches change_cwd import to _test.
tests/usethis/_integrations/project/test_layout.py Switches change_cwd import to _test.
tests/usethis/_integrations/project/test_imports.py Switches change_cwd import to _test.
tests/usethis/_integrations/pre_commit/test_yaml.py Switches change_cwd import to _test.
tests/usethis/_integrations/pre_commit/test_version.py Switches get_pre_commit_version import to _test.
tests/usethis/_integrations/pre_commit/test_pre_commit_schema.py Switches helpers to _test.
tests/usethis/_integrations/pre_commit/test_pre_commit_core.py Switches change_cwd import to _test.
tests/usethis/_integrations/pre_commit/test_language.py Switches change_cwd import to _test.
tests/usethis/_integrations/pre_commit/test_init.py Switches change_cwd import to _test.
tests/usethis/_integrations/pre_commit/test_hooks.py Switches helpers to _test.
tests/usethis/_integrations/mkdocs/test_core.py Switches change_cwd import to _test.
tests/usethis/_integrations/environ/test_python.py Deletes tests for removed environ integration.
tests/usethis/_integrations/ci/github/test_tags.py Deletes tests for removed GitHub CI integration.
tests/usethis/file/yaml/test_yaml_io.py Switches YAML edit helpers to _test.
tests/usethis/_file/yaml/test_update.py Switches YAML edit helper to _test.
tests/usethis/file/toml/test_toml_io.py Switches change_cwd import to _test.
tests/usethis/_file/test_manager.py Switches change_cwd import to _test.
tests/usethis/_file/pyproject_toml/test_valid.py Switches change_cwd import to _test.
tests/usethis/_file/pyproject_toml/test_requires_python.py Switches change_cwd import to _test.
tests/usethis/_file/pyproject_toml/test_remove.py Deletes tests for removed remove_pyproject_toml.
tests/usethis/file/pyproject_toml/test_pyproject_toml_io.py Switches change_cwd import to _test.
tests/usethis/_file/pyproject_toml/test_project.py Switches change_cwd import to _test.
tests/usethis/_file/pyproject_toml/test_name.py Switches change_cwd import to _test.
tests/usethis/file/ini/test_ini_io.py Switches change_cwd import to _test.
tests/usethis/_core/test_status.py Switches change_cwd import to _test.
tests/usethis/_core/test_rule.py Switches change_cwd import to _test.
tests/usethis/_core/test_list.py Switches change_cwd import to _test.
tests/usethis/_core/test_docstyle.py Switches change_cwd import to _test.
tests/usethis/_core/test_core_tool.py Switches helpers to _test (incl. use_tool).
tests/usethis/_core/test_core_readme.py Switches change_cwd import to _test.
tests/usethis/_core/test_core_badge.py Switches change_cwd import to _test.
tests/usethis/_core/test_author.py Switches change_cwd import to _test.
tests/usethis/_backend/uv/test_lockfile.py Switches change_cwd import to _test.
tests/usethis/_backend/uv/test_link_mode.py Switches change_cwd import to _test.
tests/usethis/_backend/uv/test_init.py Switches change_cwd import to _test.
tests/usethis/_backend/uv/test_detect.py Switches change_cwd import to _test.
tests/usethis/_backend/uv/test_call.py Switches change_cwd import to _test.
tests/usethis/_backend/uv/test_available.py Switches change_cwd import to _test.
tests/usethis/_backend/uv/test_version.py Deletes tests for removed uv version helper.
tests/usethis/_backend/uv/test_python.py Deletes tests for removed uv python helper.
tests/usethis/_backend/test_dispatch.py Switches change_cwd import to _test.
tests/usethis/_backend/poetry/test_detect.py Switches change_cwd import to _test.
tests/usethis/_backend/poetry/test_call.py Switches change_cwd import to _test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/usethis/_backend/poetry/detect.py
Comment thread src/usethis/_backend/dispatch.py
@codecov

codecov Bot commented Apr 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.13043% with 15 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/_test.py 88.97% 14 Missing ⚠️
src/usethis/_backend/dispatch.py 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@nathanjmcdougall nathanjmcdougall merged commit 31a0d16 into main Apr 7, 2026
19 of 20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1836-add-vulture-for-development branch April 7, 2026 04: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.

Add vulture for development agent: remove derived lists and their circular tests when all real consumers are gone

2 participants