Five scripts repeat the same try/except import of ghcall

Open Beginner friendly
#1,283 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
tooling

Research direction

Read the import blocks in scripts/check_contributors.py, check_traction.py, check_issue_refs.py, draft_metrics_row.py, and update_weekly_issue.py, then inspect tests/test_declared_dependencies.py. Choose one shared way to support both test imports and script execution, and remove the special case. Done when none of the five scripts uses the try/except import and the dependency test no longer lists scripts as local.

Written by the indexing model from the issue text.

Description

enhancement good first issue tooling

Where: scripts/check_contributors.py, check_traction.py, check_issue_refs.py, draft_metrics_row.py, update_weekly_issue.py.

Current gap: Each begins with try: from scripts.ghcall import ... except ImportError: from ghcall import ... so it works both imported by tests and run as a script, and tests/test_declared_dependencies.py needed a special case to treat scripts and every scripts/*.py stem as local.

Suggested approach: Pick one mechanism (for example putting the repository root on sys.path in one shared line, or making scripts runnable with python -m) and remove the repetition and the test special case.

Done when: no script has the try/except and the dependency test no longer lists scripts as local.

Dominant language
HTML
Stars
47
Forks
45
Avg merge
2h 50m
Merged PRs (30d)
85

Getting set up

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.

More from yakew7/Fair-Code

All issues in yakew7/Fair-Code

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.