Skip to content

Refactor project structure, enhance CLI, and improve documentation - #4

Merged
msalexms merged 5 commits into
mainfrom
refactor/project-modernization
Apr 27, 2026
Merged

Refactor project structure, enhance CLI, and improve documentation#4
msalexms merged 5 commits into
mainfrom
refactor/project-modernization

Conversation

@msalexms

Copy link
Copy Markdown
Owner

This pull request introduces significant improvements to project configuration, development workflow, and documentation, while also removing an outdated script. The main changes focus on establishing modern Python packaging and dependency management with pyproject.toml, setting up continuous integration (CI) with GitHub Actions, and providing clear environment and configuration templates for easier setup. Additionally, a comprehensive skill document for code review and commit best practices is added. The legacy run_analyzer.py script is removed, reflecting a shift to a more modular and maintainable structure.

Project configuration and packaging:

  • Added a pyproject.toml file to define project metadata, dependencies, development and test requirements, and tool configurations for ruff, mypy, and pytest, enabling modern Python packaging and streamlined development workflows.
  • Renamed and updated the configuration file to config/default.yml, with revised default values for RTL-TCP and receiver parameters.

Development workflow and CI:

  • Introduced a GitHub Actions workflow (.github/workflows/ci.yml) that runs linting, type checks, and tests (across Python 3.9–3.12), and uploads coverage reports to Codecov.

Environment and documentation:

  • Added an .env.example file with all relevant environment variables for RTL-SDR Analyzer setup, providing a template for user configuration.
  • Added a detailed skill document (.opencode/skills/code-review-commit/SKILL.md) outlining best practices for code review, branch management, and Conventional Commits, tailored for React and git workflows (in Spanish).

Codebase cleanup:

  • Removed the legacy scripts/run_analyzer.py script, indicating a move away from a monolithic entry point in favor of a more modular CLI and configuration-driven approach.
  • Cleaned up unnecessary imports from src/__init__.py and src/core/__init__.py, further streamlining the codebase. [1] [2]

Alejandro Martín added 5 commits April 27, 2026 11:26
Replaces legacy flat structure with modern src-layout packaging.
Migrates from raw requirements.txt to pyproject.toml with entry points.
Introduces Pydantic Settings for validated configuration management.
Replaces argparse CLI with Typer supporting subcommands.
Implements dependency injection via Analyzer orchestrator.
Adds structured logging with structlog and single setup entry point.
Extracts constants and adds full type hints across all modules.
Converts event dataclasses to frozen Pydantic models.
Introduces VisualizationStrategy protocol for GUI/headless modes.
Adds EventBus pub/sub and CSV/JSON exporters for detections.
Expands test suite to 60 tests with 85% coverage.
Adds CI workflow with lint, typecheck and test matrix.
Updates README with new installation and usage instructions.
…ation

Adds detailed command explanations with all CLI options and defaults.
Includes 6 practical examples for different use cases (FM radio,
walkie-talkies, GSM, debug mode, remote server, custom configs).
Documents configuration cascade (YAML → env vars → CLI flags).
Adds signal patterns reference table and headless mode output examples.
read_samples() now truncates odd-length buffers to prevent reshape errors.
HeadlessVisualization no longer catches KeyboardInterrupt internally,
allowing the Analyzer's signal handler to cleanly break the loop on Ctrl+C.
- Remove SIGINT signal handler to let KeyboardInterrupt raise immediately,
  enabling instant Ctrl+C response without waiting for socket timeouts.
- Keep SIGTERM handler for daemon mode compatibility.
- Add exporter tracking in Analyzer with automatic close() in finally block.
- Add CLI validation requiring --export-path when --export-format is set
  and vice versa, preventing silent export failures.
@msalexms
msalexms merged commit c10ada4 into main Apr 27, 2026
0 of 6 checks passed
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.

1 participant