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 pull request includes significant changes to the Flask application structure, Docker setup, and testing framework. The most important changes involve the restructuring of the application into a modular format, updating the Docker configuration, and enhancing the testing suite.
Application Restructuring:
src/wakeonlanservice/__init__.py
: Introducedcreate_app
function to create and configure the Flask application, including setting up logging and validating environment variables.src/wakeonlanservice/app.py
: Updated to import and use thecreate_app
function to create the Flask application instance.src/wakeonlanservice/blueprints/status.py
: Refactored the originalapp.py
to use Flask blueprints for better modularity and maintainability.Docker Configuration:
docker/Dockerfile
: Updated the Dockerfile to reflect the new application structure, including changes to theCOPY
command and environment variables. [1] [2]Testing Enhancements:
tests/test_app.py
: Added tests for thecreate_app
andvalidate_env_variables
functions to ensure proper application configuration and environment variable validation.tests/test_logging_config.py
: Added tests for the logging configuration to verify correct logging levels based on the debug mode.tests/test_status.py
: Added comprehensive tests for the status blueprint, including tests for different URL status scenarios and multiple application instances.Documentation Update:
README.md
: Updated the instructions for creating the.vscode/launch.json
file to reflect the new application structure and added thePYTHONPATH
environment variable.Dependency Management:
pyproject.toml
: Added new dependencies and configurations for testing and linting, includingpytest-cov
andruff
. [1] [2]src/requirements.txt
: Removed redundant dependencies as they are now managed throughpyproject.toml
.