Add depends_on_external
, cannot_depend_on_external
to control external dependencies
#683
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.
Fixes: #535
Relevant to use case mentioned in: #679
This PR introduces
depends_on_external
andcannot_depend_on_external
to module configuration. These function identically todepends_on
andcannot_depend_on
, but for external dependencies.By default, no module-level checks are performed for external dependencies - instead the package-level dependencies are checked (e.g. in
pyproject.toml
,requirements.txt
)By adding one of these new dependency fields to a module, this will opt-in to additional controls on the external dependencies that can be used within that module.
Example:
The configuration above means that
check-external
will validate thattach.console
ONLY depends onrich
, and no other external packages.Alternately:
This configuration means that any module matching
tach.filesystem.**
cannot depend onrich
. Other external dependencies are allowed.NOTE: This PR does not add automatic detection of these dependencies to
tach sync
-- this will be done in a future PR.