Skip to content

Add GitHub Actions workflow for Python package - #5198

Closed
akdmjeau-eng wants to merge 1 commit into
secdev:masterfrom
akdmjeau-eng:master
Closed

akdmjeau-eng wants to merge 1 commit into
secdev:masterfrom
akdmjeau-eng:master

Conversation

@akdmjeau-eng

Copy link
Copy Markdown

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

Description

fixes #xxx

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 High severity · 1 Medium severity

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
@guedou guedou closed this Sep 24, 2026
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.

3 participants