rstudio / rstudio/pins-python

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

Open
#282 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.documentation .maint
Dominant language
Python
Stars
59
Forks
11
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the pins package structure and the proposed import-linter layers first. Done means choosing and documenting an architecture approach, with dependency relationships either enforced by import-linter and pre-commit or captured in an alternative diagram or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.