From d4d33cf16fd609097eefd79e6f3aedf0b7225d3c Mon Sep 17 00:00:00 2001 From: Moosems <95927277+Moosems@users.noreply.github.com> Date: Sat, 11 May 2024 13:12:12 -0400 Subject: [PATCH] Seperate workflows and run isort --- .../workflows/{formatting.yml => black.yaml} | 8 +++----- .github/workflows/isort.yml | 18 ++++++++++++++++++ .github/workflows/ruff.yaml | 18 ++++++++++++++++++ .github/workflows/tests.yml | 18 ++++++++++++++++++ main.py | 6 +++--- 5 files changed, 60 insertions(+), 8 deletions(-) rename .github/workflows/{formatting.yml => black.yaml} (56%) create mode 100644 .github/workflows/isort.yml create mode 100644 .github/workflows/ruff.yaml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/formatting.yml b/.github/workflows/black.yaml similarity index 56% rename from .github/workflows/formatting.yml rename to .github/workflows/black.yaml index 7ee23db..5c4a053 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/black.yaml @@ -9,12 +9,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.11.1 - name: Code Formatting (App) run: | - pip install ruff black isort pytest + pip install black pip install -r requirements.txt - black --diff . - isort --diff . - ruff check . # Should all be different files so we get different errors + black -check . diff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml new file mode 100644 index 0000000..7a2df47 --- /dev/null +++ b/.github/workflows/isort.yml @@ -0,0 +1,18 @@ +name: Code Formatting + +on: push + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.11.1 + + - name: Code Formatting (App) + run: | + pip install isort + pip install -r requirements.txt + isort --check . diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml new file mode 100644 index 0000000..7de34a9 --- /dev/null +++ b/.github/workflows/ruff.yaml @@ -0,0 +1,18 @@ +name: Code Formatting + +on: push + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.11.1 + + - name: Code Formatting (App) + run: | + pip install ruff + pip install -r requirements.txt + ruff check . diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..230cf52 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,18 @@ +name: Code Formatting + +on: push + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.11.1 + + - name: Code Formatting (App) + run: | + pip install pytest + pip install -r requirements.txt + pytest . diff --git a/main.py b/main.py index 5da9b9a..da05732 100644 --- a/main.py +++ b/main.py @@ -6,17 +6,17 @@ from tkinter.ttk import Button, Combobox, Entry, Frame, Label from webbrowser import open as openwebpage +from dialogs import Messagebox from platformdirs import user_data_dir from pyowm import OWM -from pyowm.commons.exceptions import APIRequestError, InvalidSSLCertificateError +from pyowm.commons.exceptions import (APIRequestError, + InvalidSSLCertificateError) from pyowm.commons.exceptions import NotFoundError as OWMNotFoundError from pyowm.commons.exceptions import TimeoutError from requests import Response from requests import get as requests_get from sv_ttk import set_theme -from dialogs import Messagebox - VERSION = "0.1" # Create constant