Skip to content

Conversation

@gpotter2
Copy link
Member

@gpotter2 gpotter2 commented Jul 29, 2025

  • improve autoargparse to be usable from a script
  • add infrastructure to support bash autocompletion
  • rework the extensions loading

fixes #4780

@codecov
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 32.55814% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.01%. Comparing base (e20f373) to head (1fc3d7e).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
scapy/config.py 28.20% 28 Missing ⚠️
scapy/utils.py 0.00% 17 Missing ⚠️
scapy/main.py 56.66% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4806      +/-   ##
==========================================
- Coverage   81.02%   81.01%   -0.01%     
==========================================
  Files         365      365              
  Lines       89027    89060      +33     
==========================================
+ Hits        72138    72156      +18     
- Misses      16889    16904      +15     
Files with missing lines Coverage Δ
scapy/main.py 69.36% <56.66%> (-0.72%) ⬇️
scapy/utils.py 74.19% <0.00%> (-0.39%) ⬇️
scapy/config.py 80.61% <28.20%> (+0.03%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gpotter2 gpotter2 changed the title Improve AutoArgparse logic Improve AutoArgparse & rework extensions Jul 29, 2025
@gpotter2 gpotter2 requested a review from Copilot July 30, 2025 01:20
Copy link
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

This PR improves the AutoArgparse decorator to support usage from scripts and adds infrastructure for bash autocompletion, while reworking the extensions loading system for Python 3.8+.

  • Enhanced AutoArgparse with a _parseonly mode for generating bash autocompletion metadata
  • Added bash autocompletion infrastructure with XDG-compliant directory detection and file copying utilities
  • Refactored extensions loading to be more explicit and moved it to the interactive session startup

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
scapy/utils.py Enhanced AutoArgparse to support parseonly mode and improved parameter processing for bash completion
scapy/main.py Added bash autocompletion infrastructure and moved extension loading to interactive session startup
scapy/config.py Refactored ExtsManager to load specific extensions explicitly instead of auto-discovering all installed packages
Comments suppressed due to low confidence (1)

scapy/utils.py:3897

  • [nitpick] The parameter name _parseonly uses a leading underscore which typically indicates a private/internal parameter, but this could be confusing since it's part of the public function signature. Consider renaming to parseonly or parse_only_mode.
) -> Optional[Tuple[List[str], List[str]]]:

@gpotter2 gpotter2 merged commit 5739035 into secdev:master Jul 30, 2025
24 checks passed
@gpotter2 gpotter2 deleted the autoargp branch July 30, 2025 01:42
@gpotter2 gpotter2 added this to the 2.7.0 milestone Nov 2, 2025
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.

Add a way to disable scanning the system for Scapy extensions

1 participant