From f7e729bcabe410a4802cbff409886d2b4e06f586 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:37:07 +0000 Subject: [PATCH 1/2] I've updated the GitHub workflow (`.github/workflows/python-app.yml`) to: - Trigger on pushes and pull requests to both the `develop` and `prod` branches. - Ensure that tests are executed for both `develop` and `prod` environments, depending on the branch that triggered the workflow. - Enable the `flake8` linting step. - Configure the linting step to run only on pull requests to catch issues before merging. --- .github/workflows/python-app.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5696d77..fd42970 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -5,9 +5,9 @@ name: Build Status on: push: - branches: [ develop ] + branches: [ develop, prod ] pull_request: - branches: [ develop ] + branches: [ develop, prod ] jobs: build: @@ -28,12 +28,13 @@ jobs: pip install flake8 pytest-cov coveralls if [ -f requirements.txt ]; then pip install -r requirements.txt; fi -# - name: Lint with flake8 -# run: | -# # stop the build if there are Python syntax errors or undefined names -# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide -# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Lint with flake8 + if: github.event_name == 'pull_request' + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest-cov run: | From 4aa1d0316e3d497c1c142c23096369d133a651b2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 22:21:03 +0000 Subject: [PATCH 2/2] Fix: Import logging module in test_aero_calculator Imports the `logging` module in `tests/test_aero_calculator.py` to resolve F821 undefined name errors identified by flake8. --- tests/test_aero_calculator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_aero_calculator.py b/tests/test_aero_calculator.py index 766b123..1b81ced 100644 --- a/tests/test_aero_calculator.py +++ b/tests/test_aero_calculator.py @@ -1,5 +1,6 @@ import pytest import math +import logging from frispy.model import Model from frispy.discs import Discs from frispy.aero_calculator import calculate_aero_coefficients