Skip to content

Conversation

@igorpecovnik
Copy link
Member

Update shebang to use system Python interpreter

This PR updates the shebang in scripts/generate-base-files-info-json.py from:

#!/usr/bin/env python3

to

#!/usr/bin/python3

Why this change?

  • GitHub Actions runners provide /usr/bin/python3 in a consistent and predictable location.
  • Using #!/usr/bin/python3 ensures the script runs with the system Python installation instead of relying on env, which may resolve to a different interpreter depending on the workflow environment.
  • This avoids issues where installed system packages (e.g., python3-requests, python3-lxml) are not visible to a Python interpreter provided by actions/setup-python.
  • The change improves compatibility when the script is executed outside of virtual environments, CI, or custom PATH setups.

Impact

  • No functional logic changes.
  • Script execution becomes more stable and predictable in CI and local environments.
  • Helps prevent ModuleNotFoundError when system packages are used.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

The shebang line in scripts/generate-base-files-info-json.py has been modified from #!/usr/bin/env python3 to #!/usr/bin/python3. This changes the interpreter invocation method from using the environment's PATH lookup to directly referencing the absolute path of the Python interpreter. No functional code logic or behavior has been altered.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-line shebang modification with no functional impact on script execution or logic

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: updating the shebang line from #!/usr/bin/env python3 to #!/usr/bin/python3.
Description check ✅ Passed The description is directly related to the changeset, providing clear context for why the shebang is being updated and detailing the specific change and its rationale.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch deps

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 00d9780 and 959a3d6.

📒 Files selected for processing (1)
  • scripts/generate-base-files-info-json.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-04T02:29:22.901Z
Learnt from: tabrisnet
Repo: armbian/armbian.github.io PR: 88
File: scripts/generate-base-files-info-json.py:31-32
Timestamp: 2025-12-04T02:29:22.901Z
Learning: In scripts/generate-base-files-info-json.py, ensure requests.get() calls include timeouts and use response.raise_for_status() to die noisily with stack traces rather than failing silently. Uncaught exceptions with stack traces are preferred over wrapped error messages for admin-facing scripts.

Applied to files:

  • scripts/generate-base-files-info-json.py
🔇 Additional comments (1)
scripts/generate-base-files-info-json.py (1)

1-1: The shebang change is correct for this CI-only use case and should not be modified.

The script is exclusively run via GitHub Actions (.github/workflows/generate-base-files-info-json.yml), where the workflow:

  1. Uses actions/setup-python to set up Python in a non-standard location
  2. Installs dependencies as system packages via sudo apt install -y python3-requests python3-lxml
  3. Runs the script directly: ./scripts/generate-base-files-info-json.py

The hardcoded shebang #!/usr/bin/python3 ensures the script uses the system Python (/usr/bin/python3) that has access to the system-installed packages. Using #!/usr/bin/env python3 would resolve to the setup-python environment, which lacks access to system packages and would cause the script to fail.

The caching behavior in the script optimizes performance within a single CI run and is not related to local development reuse. The script has no portability requirement and is not designed for local or multi-platform execution.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@igorpecovnik igorpecovnik merged commit 616d44c into main Dec 4, 2025
8 checks passed
@igorpecovnik igorpecovnik deleted the deps branch December 4, 2025 07:30
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