Skip to content

Commit

Permalink
Add another missing import annotations and drop python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnySc2 committed Sep 15, 2023
1 parent e6a8549 commit 0a0334b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/earthly_project_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.10', '3.11']
runs-on: ${{ matrix.os }}

steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test_fastapi_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.10', '3.11']
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -86,7 +86,6 @@ jobs:
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
jobs: |
test_backend_py3.9
test_backend_py3.10
test_backend_py3.11
Expand Down
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.6
ARG NODEVERSION=19 # 14, 16, 18, 19
ARG PYTHONVERSION=3.11 # 3.8 to 3.11
ARG PYTHONVERSION=3.11 # 3.10 to 3.11
ARG NIMVERSION=2.0.0
FROM alpine:3.15 # Is only used for formatting, so image can be as small as possible

Expand Down
1 change: 1 addition & 0 deletions fastapi_server/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install-dev:
RUN poetry install
COPY . /root/fastapi_server

# TODO Remove as svelte is no longer used
install-integration:
FROM nikolaik/python-nodejs:python${PYTHONVERSION}-nodejs${NODEVERSION}-slim
WORKDIR /root/fastapi_server
Expand Down
7 changes: 1 addition & 6 deletions fastapi_server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dedent_closing_brackets = true
allow_split_before_dict_value = false

[tool.ruff]
target-version = 'py38'
target-version = 'py310'
line-length = 120
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
Expand All @@ -87,11 +87,6 @@ select = [
# "A", # flake8-builtins
]

[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
# Remove once support for py3.8 and 3.9 is dropped
keep-runtime-typing = true

[tool.ruff.pep8-naming]
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
classmethod-decorators = ["pydantic.validator", "classmethod"]
2 changes: 2 additions & 0 deletions fastapi_server/routes/htmx_chat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
from collections import OrderedDict
from typing import Annotated
Expand Down
4 changes: 3 additions & 1 deletion fastapi_server/test/base_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import contextlib
from typing import Generator
from collections.abc import Generator

import pytest
from fastapi.testclient import TestClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pathlib import Path
from test.base_test import BaseTest

Expand Down

0 comments on commit 0a0334b

Please sign in to comment.