Skip to content

Use schema namespaces instead of messy lists of imported classes#1267

Merged
nathanjmcdougall merged 1 commit intomainfrom
1246-dont-import-items-from-usethis_integrationsschema-modules-directly
Dec 30, 2025
Merged

Use schema namespaces instead of messy lists of imported classes#1267
nathanjmcdougall merged 1 commit intomainfrom
1246-dont-import-items-from-usethis_integrationsschema-modules-directly

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 refactors import statements across test and source files to use schema namespace imports instead of importing individual classes directly. The change improves code organization by replacing multiple specific class imports with a single namespace import (e.g., from usethis._integrations.pre_commit import schema), then accessing classes via the namespace (e.g., schema.UriRepo).

Key Changes:

  • Consolidates imports by using schema namespaces for pre-commit and Bitbucket configurations
  • Replaces individual class imports with namespace-qualified references throughout the codebase
  • Updates the fallback UV version from 0.9.20 to 0.9.21

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/usethis/_tool/test_base.py Replaced individual pre_commit schema class imports with namespace import
tests/usethis/_tool/impl/*.py Updated test files to use schema namespace for pre_commit classes
tests/usethis/_integrations/pre_commit/*.py Refactored to use schema namespace for pre_commit types
tests/usethis/_integrations/ci/bitbucket/*.py Changed to use schema namespace for Bitbucket types
src/usethis/_tool/*.py Updated source files to use schema namespaces
src/usethis/_integrations/*.py Refactored integration modules to use schema namespaces
src/usethis/_integrations/backend/uv/version.py Bumped fallback UV version to 0.9.21

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 30, 2025

CodSpeed Performance Report

Merging #1267 will not alter performance

Comparing 1246-dont-import-items-from-usethis_integrationsschema-modules-directly (9668c27) with main (75e61d4)

Summary

✅ 2 untouched

@nathanjmcdougall nathanjmcdougall merged commit e676872 into main Dec 30, 2025
19 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1246-dont-import-items-from-usethis_integrationsschema-modules-directly branch December 30, 2025 23: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.

Don't import items from usethis._integrations.*.schema modules directly

2 participants