Conversation
This commit modernizes the entire Malwarehouse codebase from Python 2.7 to Python 3.9+: ### Core Changes: - Updated all print statements to print() functions - Replaced file() built-in with open() using proper binary mode - Changed exception handling from 'except Exception, e' to 'except Exception as e' - Updated .iteritems() to .items() for dictionary iteration - Replaced ConfigParser.SafeConfigParser with configparser.ConfigParser - Updated metaclass syntax from __metaclass__ to metaclass= parameter ### Library Modernization: - Replaced urllib2 with requests library for HTTP operations - Removed poster library dependency (replaced with requests) - Updated to ppdeep from pydeep for fuzzy hashing - Pinned modern versions of SQLAlchemy and python-magic ### New Files: - Added requirements.txt for pip-based dependency management ### Documentation: - Updated README.md to reflect Python 3.9+ requirement - Added installation instructions using pip - Updated library documentation with modern package names
Additional fixes found during testing: - Fixed MetaData() constructor to not accept engine parameter (SQLAlchemy 2.0) - Fixed engine.url.database access for SQLAlchemy 2.0 compatibility - Fixed print statement in extensions/plugins/__init__.py - Updated pydeep import to ppdeep in utils.py All tests now pass successfully.
This commit adds a complete testing framework to ensure code quality and prevent regressions: ### Test Coverage (72% overall): - Database operations (88% coverage) - Hash calculations (MD5, SHA256) - Malware sample processing (59% coverage) - Plugin system (81-100% coverage) - Utility functions (79% coverage) - VirusTotal integration (62% coverage - mocked) ### Test Files: - tests/test_db_controller.py - Database controller tests (6 tests) - tests/test_malware_sample.py - Sample handling tests (6 tests) - tests/test_utils.py - Utility function tests (8 tests) - tests/test_plugins.py - Plugin system tests (9 tests) - tests/test_config.cfg - Test configuration - tests/test_rules.yar - Test YARA rules - tests/README.md - Testing documentation ### Test Infrastructure: - pytest.ini - Pytest configuration with coverage settings - run_tests.sh - Convenient test runner script - requirements.txt - Added pytest, pytest-cov, pytest-mock, coverage ### CI/CD: - .github/workflows/ci.yml - GitHub Actions workflow - Tests on Python 3.9, 3.10, 3.11, 3.12 - Tests on Ubuntu and macOS - Linting with flake8 - Code coverage reporting ### Other Improvements: - Updated .gitignore for test artifacts and Python best practices - Comprehensive test documentation All 29 tests passing ✅
This was referenced Nov 18, 2025
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 commit modernizes the entire Malwarehouse codebase from Python 2.7 to Python 3.9+:
Core Changes:
Library Modernization:
New Files:
Documentation: