Skip to content

Make src a package, add collector modules, and allow running src/main.py directly#3

Open
MahanKenway wants to merge 2 commits into
mainfrom
codex/find-issues-in-the-code-qcaoxd
Open

Make src a package, add collector modules, and allow running src/main.py directly#3
MahanKenway wants to merge 2 commits into
mainfrom
codex/find-issues-in-the-code-qcaoxd

Conversation

@MahanKenway
Copy link
Copy Markdown
Owner

Motivation

  • Fix ModuleNotFoundError: No module named 'src' when running python src/main.py and make the project importable as a package for CI and local execution.
  • Provide a structured implementation for collecting, parsing, testing, exporting, and notifying about V2Ray configs to replace the previous single-script approach.
  • Improve CI workflow to run the collector as a module and add basic project metadata and developer tooling files.

Description

  • Add package layout under src/ with modules for settings (src/config), sources (src/config/sources.py), collection (src/core/collector.py), parsing (src/core/parser.py), testing (src/core/tester.py), exporting (src/core/exporter.py), notifying (src/core/notifier.py), models (src/models), and utilities (src/utils), plus __init__.py files so src is a proper package.
  • Implement src/main.py and add a sys.path fallback so python src/main.py works when __package__ is empty, and update scripts/collector.py to prepend the repo root to sys.path and call src.main.main() for direct script invocation.
  • Improve robustness of network calls with retrying requests session, safer base64 decoding utilities, structured logging via src/utils/logger.py, and typed dataclasses for Settings and Config objects.
  • Update GitHub Actions workflow to install dependencies and run the collector via python -m src.main, add requirements.txt/requirements-dev.txt, pytest.ini, .env.example, .gitignore, license, and contributor docs.
  • Add unit tests for parsing and tester logic in tests/test_parser.py and tests/test_tester.py that exercise ConfigParser and ConfigTester behavior.

Testing

  • No automated tests were executed in this rollout; test files tests/test_parser.py and tests/test_tester.py were added but pytest was not run.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant