Add GitHub Actions workflow for Python package - #5198
Closed
akdmjeau-eng wants to merge 1 commit into
Closed
akdmjeau-eng wants to merge 1 commit into
akdmjeau-eng wants to merge 1 commit into
Conversation
This workflow installs Python dependencies, runs linting with flake8, and executes tests with pytest across multiple Python versions.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The workflow does not run the repository tests, does not enforce lint failures, duplicates existing CI, and lacks explicit least-privilege permissions.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds a GitHub Actions workflow for Python 3.9–3.11 package linting and testing.
Changes:
- Adds a Python-version matrix on Ubuntu.
- Installs lint and test dependencies.
- Runs flake8 and pytest.
| File | Review summary |
|---|---|
.github/workflows/python-package.yml |
Critical (4 votes): pytest does not execute Scapy’s test suite. Moderate (4 votes): --exit-zero makes lint failures non-blocking. Nit (1 vote): duplicates existing CI. Moderate (1 vote): should declare least-privilege token permissions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+30
to
+40
| python -m pip install flake8 pytest | ||
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
| - name: Lint with flake8 | ||
| run: | | ||
| # stop the build if there are Python syntax errors or undefined names | ||
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
| - name: Test with pytest | ||
| run: | | ||
| pytest |
| # stop the build if there are Python syntax errors or undefined names | ||
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This workflow installs Python dependencies, runs linting with flake8, and executes tests with pytest across multiple Python versions.
Description
fixes #xxx