Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .importlinter
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
[importlinter]
root_packages =
usethis

[importlinter:contract:usethis]
name = usethis
type = layers
containers =
usethis
layers =
_test | __main__
_ui
_toolset
_core
_tool
_init
_deps
_config_file
_integrations
_io | _subprocess | _console
_config
_types | errors
_pipeweld
exhaustive = true
exhaustive_ignores =
_version

[importlinter:contract:ui]
name = usethis._ui
type = layers
containers =
usethis._ui
layers =
app
interface
options
exhaustive = true

[importlinter:contract:core]
name = usethis._core
type = layers
containers =
usethis._core
layers =
badge | docstyle | list | rule
author | browse | ci | readme | show | status | tool
exhaustive = true

[importlinter:contract:tool]
name = usethis._tool
type = layers
containers =
usethis._tool
layers =
all_
impl
base
config | pre_commit | rule
exhaustive = true

[importlinter:contract:tool_impl]
name = usethis._tool.impl
type = layers
containers =
usethis._tool.impl
layers =
pyproject_toml
codespell | deptry | import_linter | pyproject_fmt | requirements_txt
ruff
pytest : coverage_py
pre_commit | mkdocs
exhaustive = true

[importlinter:contract:integrations]
name = usethis._integrations
type = layers
containers =
usethis._integrations
layers =
ci | pre_commit
environ
backend | mkdocs | pytest | pydantic | sonarqube
project
file
python
exhaustive = true

[importlinter:contract:integrations_file]
name = usethis._integrations.file
type = layers
containers =
usethis._integrations.file
layers =
pyproject_toml | setup_cfg
ini | toml | yaml
dir
exhaustive = true

[importlinter:contract:ui_interface]
name = usethis._ui.interface
type = layers
containers =
usethis._ui.interface
layers =
author | badge | browse | ci | doc | docstyle | format_ | init | lint | list | readme | rule | show | spellcheck | status | test | tool | version
exhaustive = true

[importlinter:contract:pipeweld]
name = usethis._pipeweld
type = layers
containers =
usethis._pipeweld
layers =
func
result
containers | ops
exhaustive = true

[importlinter:contract:integrations_ci]
name = usethis._integrations.ci
type = layers
containers =
usethis._integrations.ci
layers =
bitbucket | github
exhaustive = true
127 changes: 0 additions & 127 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -236,132 +236,5 @@ reportUnusedFunction = false
reportUnusedCallResult = false
reportUnusedParameter = false

[tool.importlinter]
root_packages = [ "usethis" ]

[[tool.importlinter.contracts]]
name = "usethis"
type = "layers"
layers = [
"_test | __main__",
"_ui",
# Tool implementations
"_toolset",
"_core",
"_tool",
# Specific config file and backend implementations
"_init",
"_deps",
"_config_file",
"_integrations",
"_io | _subprocess | _console",
# Global state and constants
"_config",
"_types | errors",
# Completely independent helper modules
"_pipeweld",
]
containers = [ "usethis" ]
exhaustive = true
exhaustive_ignores = [ "_version" ]

[[tool.importlinter.contracts]]
name = "usethis._ui"
type = "layers"
layers = [
"app",
"interface",
"options",
]
containers = [ "usethis._ui" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._core"
type = "layers"
layers = [
# docstyle uses (Ruff) tool, badge uses readme
"badge | docstyle | list | rule",
"author | browse | ci | readme | show | status | tool",
]
containers = [ "usethis._core" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._tool"
type = "layers"
layers = [
"all_",
"impl",
"base",
"config | pre_commit | rule",
]
containers = [ "usethis._tool" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._tool.impl"
type = "layers"
layers = [
"pyproject_toml",
"codespell | deptry | import_linter | pyproject_fmt | requirements_txt",
"ruff",
"pytest : coverage_py",
"pre_commit | mkdocs",
]
containers = [ "usethis._tool.impl" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._integrations"
type = "layers"
layers = [
"ci | pre_commit",
"environ",
"backend | mkdocs | pytest | pydantic | sonarqube",
"project",
"file",
"python",
]
containers = [ "usethis._integrations" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._integrations.file"
type = "layers"
layers = [
"pyproject_toml | setup_cfg",
"ini | toml | yaml",
"dir",
]
containers = [ "usethis._integrations.file" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._ui.interface"
type = "layers"
layers = [
# Note; if you're adding an interface, make sure it's in the README too.
"author | badge | browse | ci | doc | docstyle | format_ | init | lint | list | readme | rule | show | spellcheck | status | test | tool | version",
]
containers = [ "usethis._ui.interface" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._pipeweld"
type = "layers"
layers = [ "func", "result", "containers | ops" ]
containers = [ "usethis._pipeweld" ]
exhaustive = true

[[tool.importlinter.contracts]]
name = "usethis._integrations.ci"
type = "layers"
layers = [
"bitbucket | github",
]
containers = [ "usethis._integrations.ci" ]
exhaustive = true

[tool.sync-with-uv.repo-to-package]
"https://github.com/astral-sh/uv-pre-commit" = "uv"