Skip to content

Commit b5e34e6

Browse files
Give a strategy for broken references in usethis-python-module-layout-modify (#1372)
1 parent 5cabe8c commit b5e34e6

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

  • .agents/skills/usethis-python-module-layout-modify

.agents/skills/usethis-python-module-layout-modify/SKILL.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,29 @@ description: Modify the Python module layout (create, move, rename, or delete mo
44
compatibility: usethis, Python
55
license: MIT
66
metadata:
7-
version: "1.0"
7+
version: "1.1"
88
---
99

1010
# Modifying the module layout for Python projects
1111

12+
## Strategy for broken references
13+
14+
Whenever:
15+
16+
- creating a new module and moving code into it from another module
17+
- moving an existing module to a different location
18+
- renaming an existing module
19+
20+
There is the possibility of breaking references (e.g. import statements). Make sure to check for these and fix any.
21+
22+
### Preserving backwards compatibility
23+
24+
usethis adheres to a convention where modules starting with an underscore (e.g. `usethis._internal`) are considered internal (including all their submodules) and are not part of the public API. As such, it is not necessary to maintain backwards compatibility for these modules.
25+
26+
For example, if we had `src/usethis/_a.py` and were splitting it into new submodules `usethis/_a/b.py` and `usethis/_a/c.py`, we would not need to maintain backwards compatibility for `usethis._a` (e.g. by keeping an `__init__.py` file with imports of the new submodules).
27+
28+
However, in other cases, backwards compatibility should be maintained.
29+
30+
## Updating Import Linter Contracts
31+
1232
Make sure to adhere to the Import Linter checks using the `usethis-qa-import-linter` skill.

0 commit comments

Comments
 (0)