Make src a package, add collector modules, and allow running src/main.py directly#3
Open
MahanKenway wants to merge 2 commits into
Open
Make src a package, add collector modules, and allow running src/main.py directly#3MahanKenway wants to merge 2 commits into
MahanKenway wants to merge 2 commits into
Conversation
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.
Motivation
ModuleNotFoundError: No module named 'src'when runningpython src/main.pyand make the project importable as a package for CI and local execution.Description
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__.pyfiles sosrcis a proper package.src/main.pyand add asys.pathfallback sopython src/main.pyworks when__package__is empty, and updatescripts/collector.pyto prepend the repo root tosys.pathand callsrc.main.main()for direct script invocation.requestssession, safer base64 decoding utilities, structured logging viasrc/utils/logger.py, and typed dataclasses forSettingsandConfigobjects.python -m src.main, addrequirements.txt/requirements-dev.txt,pytest.ini,.env.example,.gitignore, license, and contributor docs.tests/test_parser.pyandtests/test_tester.pythat exerciseConfigParserandConfigTesterbehavior.Testing
tests/test_parser.pyandtests/test_tester.pywere added butpytestwas not run.Codex Task