Skip to content

Commit

Permalink
fix: poetry needs to know about fred sooner to give him a version (2.…
Browse files Browse the repository at this point in the history
…22.10)
  • Loading branch information
Borketh committed Sep 26, 2024
1 parent 05cfda3 commit 0138bb7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ FROM python:3.12-alpine AS build
WORKDIR /deps

RUN pip --no-cache-dir install --progress-bar=off "poetry==1.8"
RUN apk update; apk add g++ git re2-dev
RUN apk update
RUN apk add g++ git re2-dev
COPY pyproject.toml .
COPY poetry.lock .
RUN poetry install -nvvv --only main --no-root
RUN poetry install -nvvv --only main --no-root --compile
COPY fred ./fred/
RUN poetry install -nvvv --only-root --compile
RUN mv $(poetry env info --path) ./venv

FROM runtime
Expand Down
6 changes: 5 additions & 1 deletion fred/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import nextcord
from sqlobject import SQLObject, IntCol, BoolCol, JSONCol, BigIntCol, StringCol, FloatCol, sqlhub
from sqlobject.dberrors import DuplicateEntryError


class PermissionRoles(SQLObject):
Expand Down Expand Up @@ -282,7 +283,10 @@ def migrate():
for migration in valid_migrations:
sqlhub.processConnection.query(migration.read_text())

Misc.create_or_change("migration_rev", _migration_rev(migrations_filenames[0]))
try:
Misc.create_or_change("migration_rev", _migration_rev(migrations_filenames[0]))
except DuplicateEntryError as e:
print(f"UNABLE TO RUN MIGRATION DUE TO {e}")


def _migration_rev(filepath: pathlib.Path) -> int:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fred"
version = "2.22.8"
version = "2.22.10"
description = "A Discord bot for the Satisfactory Modding Discord "
authors = ["Feyko <[email protected]>", "Mircea Roata <[email protected]>", "Borketh <[email protected]>"]
license = "MIT License"
Expand Down

0 comments on commit 0138bb7

Please sign in to comment.