Skip to content

Commit

Permalink
build: final removal of sqlite
Browse files Browse the repository at this point in the history
Migration to MongoDB complete
  • Loading branch information
natelandau committed Nov 5, 2023
1 parent 1bcd88c commit 058e08b
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 1,100 deletions.
1 change: 0 additions & 1 deletion .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ env:
VALENTINA_LOG_FILE: "/tmp/valentina.log"
VALENTINA_TEST_MONGO_URI: "mongodb://localhost:27017"
VALENTINA_TEST_MONGO_DATABASE_NAME: "valentina-test"
VALENTINA_DB_PATH: "valentina.sqlite" # TODO: Depreciated

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

env:
VALENTINA_LOG_FILE: "/tmp/valentina.log" # pass tests

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ concurrency:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
VALENTINA_LOG_FILE: "/tmp/valentina.log" # Pass tests

jobs:
build-and-push-image:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WORKDIR /app
COPY . /app

# Install git
RUN apt-get update && apt-get install -y git sqlite3 tzdata
RUN apt-get update && apt-get install -y git tzdata

# Install Poetry
RUN pip install poetry
Expand Down
12 changes: 1 addition & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
inflect = "^7.0.0"
loguru = "^0.7.2"
numpy = "^1.26.1"
peewee = "^3.17.0"
py-cord = "^2.4.1"
pydantic = "^2.4.2"
python = ">=3.11,<3.13"
Expand Down
1 change: 0 additions & 1 deletion src/valentina/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def version_callback(value: bool) -> None:
logging.getLogger("discord.webhook").setLevel(level=CONFIG["VALENTINA_LOG_LEVEL_HTTP"].upper())
logging.getLogger("discord.client").setLevel(level=CONFIG["VALENTINA_LOG_LEVEL_HTTP"].upper())
logging.getLogger("faker").setLevel(level="INFO")
logging.getLogger("peewee").setLevel(level="INFO")
for service in ["urllib3", "boto3", "botocore", "s3transfer"]:
logging.getLogger(service).setLevel(level=CONFIG["VALENTINA_LOG_LEVEL_AWS"].upper())

Expand Down
8 changes: 1 addition & 7 deletions src/valentina/models/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import discord
from discord.ext import commands
from loguru import logger
from peewee import DoesNotExist

from valentina.constants import EmbedColor
from valentina.utils import errors
Expand All @@ -20,7 +19,7 @@ def __init__(self) -> None:
self.channel: discord.TextChannel = None

@staticmethod
def _handle_known_exceptions( # noqa: C901
def _handle_known_exceptions(
ctx: discord.ApplicationContext, error: Exception
) -> tuple[str | None, str | None, bool]:
"""Handle known exceptions and return user message, log message, and traceback flag.
Expand Down Expand Up @@ -74,11 +73,6 @@ def _handle_known_exceptions( # noqa: C901
log_msg = f"ERROR: `{ctx.user.display_name}` tried to run `/{ctx.command}` and a character class was not found"
show_traceback = True

if isinstance(error, DoesNotExist):
user_msg = "Sorry I couldn't find that. Potential bug has been reported."
log_msg = f"ERROR: `{ctx.user.display_name}` tried to run `/{ctx.command}` with an invalid database ID"
show_traceback = True

if isinstance(error, errors.MessageTooLongError):
user_msg = "Message too long to send. This is a bug has been reported."
log_msg = "ERROR: Message too long to send. Check the logs for the message."
Expand Down
Loading

0 comments on commit 058e08b

Please sign in to comment.