Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider import-linter or another way to document the overall architecture #282

Open
nathanjmcdougall opened this issue Jul 24, 2024 · 0 comments

Comments

@nathanjmcdougall
Copy link
Contributor

For new contributors, having some documentation of the overall pins-python package structure could be helpful.

In particular, it is helpful to get an idea of the dependency relationships between modules. import-linter allows you to declare and enforce a layered architecture; for example for pins-python, the configuration could be declared as:

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

[[tool.importlinter.contracts]]
name = "pins Modular Design"
type = "layers"
layers = [
    "constructors",
    "boards",
    "drivers",
    "meta | cache | rsconnect",
    "versions | utils",
    "config | errors | _types | data",
]
containers = "pins"
exhaustive = true

The idea is that that higher layers in the list can import from lower layers in the list, but not vice versa; and modules in the same level separated by | cannot import each other either.

Alternatively, I think having a diagram or other form of documentation would be quite helpful. However, import-linter has the advantage of enforcing the structure (potentially via pre-commit); whereas documentation can become out of date.

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

No branches or pull requests

1 participant