A Python tool to enforce dependencies, using modular architecture π Open source π Installable via pip π§ Able to be adopted incrementally - β‘ Implemented with no runtime impact βΎοΈ Interoperable with your existing systems π¦ Written in rust
This adds visibility as a configuration option for modules. This value will determine which modules are allowed to depend on a given module (the inverse of depends_on). By default, this is set to ['*'], which means 'this module can be depended on by any other module'.
[[modules]]
path = 'tach.core'
depends_on = []
// DEFAULT: globally visible
visibility = ['*']
[[modules]]
path = 'tach.core'
depends_on = []
// ISOLATED: no other module may depend on this module
visibility = []
[[modules]]
path = 'tach.core'
depends_on = []
// PARTIALLY ISOLATED: only modules with paths starting with `tach.` may depend on this module
visibility = ['tach.*']
[[modules]]
path = 'tach.core'
depends_on = []
// PARTIALLY ISOLATED: only modules with paths starting with `tach.` or matching `utils` may depend on this module
visibility = ['tach.*', 'utils']
Errors are given when running tach check. Running tach sync will ignore the visibility settings, and sync depends_on as usual.
Errors look like this:
β Module configuration error: 'tach.cli' cannot depend on 'tach.constants' because 'tach.cli' does not match its visibility: [].
Adjust 'visibility' for 'tach.constants' to include 'tach.cli', or remove the dependency.
β Module configuration error: 'tach.filesystem' cannot depend on 'tach.constants' because 'tach.filesystem' does not match its visibility: [].
Adjust 'visibility' for 'tach.constants' to include 'tach.filesystem', or remove the dependency.
β Module configuration error: 'tach.hooks' cannot depend on 'tach.constants' because 'tach.hooks' does not match its visibility: [].
Adjust 'visibility' for 'tach.constants' to include 'tach.hooks', or remove the dependency.
Ref: #119
This adds
visibility
as a configuration option for modules. This value will determine which modules are allowed to depend on a given module (the inverse ofdepends_on
). By default, this is set to['*']
, which means 'this module can be depended on by any other module'.Errors are given when running
tach check
. Runningtach sync
will ignore thevisibility
settings, and syncdepends_on
as usual. Errors look like this: