Reorganize scripts modules to drop the try/except ImportError import shim
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6
- Forks
- 2
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 17
Description
Several scripts (e.g. sweep.py) use a try/except ImportError shim to import shared modules under both scripts.<mod> (package) and <mod> (flat) runtimes:
```python
try:
from scripts.github_utils import SEVERITY_RANK, has_codeowner_approval, is_bot
except ImportError:
from github_utils import ... # type: ignore[no-redef]
```
This gets more cumbersome as shared modules grow. Reorganize the package layout / invocation so shared modules import cleanly in every runtime (workflow, CLI, tests) and the shim can be removed.
Raised by @groovecoder in review of #147.
Contributor guide
No contributing guide indexed for this repository
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 with scripts such as sweep.py and trace how shared modules are imported and invoked in workflows, the CLI, and tests. Review the package layout and each runtime path before choosing the reorganization. Done means shared imports work cleanly in all mentioned runtimes and the try/except ImportError shims are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100