Skip to content

Add a importlinter block to pyproject.toml #4768

Description

@h8d13

This is something I've seen @svartkanin comment on many PRs. So i thought we could perhaps try to fix/enforce it !

Example config:

[tool.importlinter]
root_package = "archinstall"
include_external_packages = false
exclude_type_checking_imports = true

[[tool.importlinter.contracts]]
name = "No circular imports between sibling subpackages"
type = "acyclic_siblings"
ancestors = ["archinstall", "archinstall.**"]

Currently flagged:

  - archinstall: default_profiles -> lib (16 imports), tui -> lib (4)
  - archinstall.lib: models -> disk, models -> locale, models -> profile, networking ->
    pacman
  - archinstall.lib.disk: partitioning_menu -> disk_menu

Maybe @correctmost can help with this to setup properly, perhaps integrate to PCH/CI.
Think this would help break cycles and keep it clean in the future.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions