Add test that prevents increasing import cycles in the mypy implementation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
It's easy to accidentally introduce new modules in import cycles, which can make the structure of the codebase worse and slow down incremental builds. Add a test that checks that this does not happen.
See #7397 for context. Here is one idea from that PR:
We could perhaps run another incremental build after self check in verbose mode and assert that the largest import cycle is below some size limit by parsing the verbose output. Alternatively, we could modify verbose mode to write more details about SCCs in incremental mode and make more specific assertions, such as requiring that the nodes, typeops and checker cycles are disjoint.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the context in #7397 and tracing the incremental build, self check, and verbose mode entry points. Determine which proposed assertion is practical, then add a regression test that detects increased import-cycle size or verifies the relevant SCC constraints; done means the test fails when cycles worsen and passes on the current implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, compilers, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100