Skip to content

fix: use find_packages() in setup.py to include wifite/config sub-packages#474

Merged
kimocoder merged 2 commits intomasterfrom
copilot/update-setup-py-packages-list
Mar 19, 2026
Merged

fix: use find_packages() in setup.py to include wifite/config sub-packages#474
kimocoder merged 2 commits intomasterfrom
copilot/update-setup-py-packages-list

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 19, 2026

After PR #469 refactored config.py into a wifite/config/ package, setup.py was never updated — making wifite.config and wifite.config.parsers absent from any non-editable install, causing an immediate ImportError on launch.

Changes

  • setup.py: Replace the hardcoded packages=[...] list with find_packages(exclude=['tests', 'tests.*']) to automatically discover all sub-packages.
    • tests/ has its own __init__.py so must be explicitly excluded.
# Before
from setuptools import setup
...
packages=[
    'wifite',
    'wifite/attack',
    'wifite/attack/portal',
    'wifite/model',
    'wifite/native',
    'wifite/tools',
    'wifite/ui',
    'wifite/util',
],

# After
from setuptools import setup, find_packages
...
packages=find_packages(exclude=['tests', 'tests.*']),
# Resolves to: wifite, wifite.attack, wifite.attack.portal,
#              wifite.config, wifite.config.parsers,  ← were missing
#              wifite.model, wifite.native, wifite.tools, wifite.ui, wifite.util

Using find_packages() rather than two manual additions prevents recurrence if further sub-packages are added.

Original prompt

Problem

After PR #469 refactored the monolithic config.py into a wifite/config/ package, setup.py was never updated to include the new sub-packages. The packages=[] list is missing both wifite/config and wifite/config/parsers.

Current setup.py packages list (lines 19–28):

packages=[
    'wifite',
    'wifite/attack',
    'wifite/attack/portal',
    'wifite/model',
    'wifite/native',
    'wifite/tools',
    'wifite/ui',
    'wifite/util',
],

What wifite/config/ currently contains:

  • wifite/config/__init__.py — the main Configuration class (13,497 bytes)
  • wifite/config/defaults.py (8,382 bytes)
  • wifite/config/validators.py (10,208 bytes)
  • wifite/config/manufacturers.py (900 bytes)
  • wifite/config/parsers/ — sub-package directory

Impact

Anyone installing via pip install or python setup.py install will immediately get an ImportError on launch because the installed package won't contain wifite/config/. Note: development installs (pip install -e .) are unaffected, which is why this has gone undetected.

Ironically, setup.py itself does from wifite.config import Configuration at the top — so it's importing from the very package it fails to list for distribution.

Fix

Update setup.py to add the two missing entries:

packages=[
    'wifite',
    'wifite/attack',
    'wifite/attack/portal',
    'wifite/config',           # ADD THIS
    'wifite/config/parsers',   # ADD THIS
    'wifite/model',
    'wifite/native',
    'wifite/tools',
    'wifite/ui',
    'wifite/util',
],

The BlobSha for setup.py is b893fc680cdccf79055199d00f9a03342606ae43.

Please also consider whether find_packages() from setuptools would be a more robust long-term solution to prevent this class of omission in the future — if so, replace the manual packages=[] list with packages=find_packages() (already imported via from setuptools import setup; you'd need to add find_packages to the import). However, only do this if it is safe and won't accidentally include test or other unwanted directories.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Scan the project for issues, problems or improvements to add. Summary me the findings

Assistant: Now let me dig deeper into specific code areas — error handling, attack modules, tool detection, and open TODOs.

Assistant: Here's a comprehensive scan and summary of findings for kimocoder/wifite2:


🔍 Project Scan — Findings Summary

📊 Repository Overview

  • Language: Python | License: GPL-2.0 | Stars: 1,426 | Forks: 254
  • Fork of: derv82/wifite2 with significant independent development
  • Activity: Very active today (2026-03-19) — multiple PRs merged in the past few hours

🐛 Open Issues (2)

# Title Status
#363 aircrack-ng NOT utilizing --simd=neon CPU instruction set on Raspberry Pi 5, causing ~13x slower cracking (210 k/s vs 2800 k/s) 🔴 Reopened
#160 WPS always shows "No" on WiFi Pineapple MK7 — WPS detection broken on OpenWRT-based devices 🟡 Open since 2023

Suggestion: Issue #363 is high-impact — aircrack.py's crack_handshake() invokes aircrack-ng without passing --simd detection, so it may not auto-select NEON on ARM64. Worth probing aircrack-ng --simd-list at startup and passing the best available SIMD flag.


⚙️ Code-Level Findings

1. 🔴 Missing SIMD Auto-Detection in aircrack.py

In wifite/tools/aircrack.py, crack_handshake() builds the aircrack-ng command with no --simd flag. On platforms like the Raspberry Pi 5 (ARM64), aircrack-ng may default to generic SIMD instead of neon, causing severe performance degradation.

  • Fix: At startup or before cracking, run aircrack-ng --simd-list, detect the best available mode, and inject --simd=<best> into crack commands.

2. 🟡 setup.py Missing the New wifite/config/ Sub-package

After the recent refactor splitting config.py into a config/ package (PR #469), setup.py only lists:

packages=['wifite', 'wifite/attack', 'wifite/model', ...]

The new wifite/config and wifite/config/parsers sub-packages may not be included in packages=[], which would break installed packages. Needs verification and update.

3. 🟡 wifite.py is Very Large (1,392 lines)

The main wifite/wifite.py is a monolithic ~1400-line file. Further modularization (e.g., separating scanning logic, attack orchestration) would improve maintainability.

4. 🟡 No --simd Support, WPS Detection Inconsistency Between reaver & bully

Per docs/TODO.md, the Pixie-Dust status output and argument handling differs significantly between reaver and bully. This means users ...

This pull request was created from Copilot chat.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…ite/config/parsers

Co-authored-by: kimocoder <4252297+kimocoder@users.noreply.github.com>
@kimocoder kimocoder marked this pull request as ready for review March 19, 2026 04:11
Copilot AI review requested due to automatic review settings March 19, 2026 04:11
Copilot AI changed the title [WIP] Fix setup.py to include wifite/config package fix: use find_packages() in setup.py to include wifite/config sub-packages Mar 19, 2026
Copilot AI requested a review from kimocoder March 19, 2026 04:11
@kimocoder kimocoder merged commit c211a19 into master Mar 19, 2026
12 of 15 checks passed
@kimocoder kimocoder deleted the copilot/update-setup-py-packages-list branch March 19, 2026 04:12
Copy link
Copy Markdown

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

Updates legacy setup.py packaging so installs done via python setup.py install / non-PEP517 flows correctly include the refactored wifite/config package introduced in PR #469.

Changes:

  • Import find_packages from setuptools.
  • Replace the manual packages=[...] list with find_packages(exclude=['tests', 'tests.*']) to auto-discover wifite subpackages while excluding test packages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 15 to +19
version=Configuration.version,
author='kimocoder',
author_email='christian@aircrack-ng.org',
url='https://github.com/kimocoder/wifite2',
packages=[
'wifite',
'wifite/attack',
'wifite/attack/portal',
'wifite/model',
'wifite/native',
'wifite/tools',
'wifite/ui',
'wifite/util',
],
packages=find_packages(exclude=['tests', 'tests.*']),
Comment on lines 21 to 22
'': ['wordlist-probable.txt']
},
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