Skip to content

Auto execute in the correct directory#1410

Merged
amilcarlucas merged 1 commit into
masterfrom
update_credits
Mar 21, 2026
Merged

Auto execute in the correct directory#1410
amilcarlucas merged 1 commit into
masterfrom
update_credits

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 21, 2026 16:37
@amilcarlucas amilcarlucas merged commit 20cc4dc into master Mar 21, 2026
23 of 25 checks passed
@amilcarlucas amilcarlucas deleted the update_credits branch March 21, 2026 16:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the credits/update_credits_licenses.py helper script so it can be executed from outside the credits/ directory while still downloading license files into the intended location.

Changes:

  • Import os / pathlib.Path and change the process working directory to the script’s directory before downloading.

Comment on lines +19 to +20
os.chdir(Path(__file__).parent)

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the process working directory at import time (os.chdir(...)) creates a global side effect that can break callers (e.g., if this script is invoked from another Python process or imported for reuse). Prefer keeping the original CWD and writing downloads to an explicit output_dir derived from Path(__file__).resolve().parent (use that path when opening the output file); if you keep chdir, at least move it (and the download loop) under an if __name__ == "__main__" guard.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11790 11051 94% 89% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: e737b10 by action🐍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants