Compare commits

..

No commits in common. "master" and "4.1.3" have entirely different histories.

6 changed files with 752 additions and 623 deletions

View File

@ -4,14 +4,14 @@ on: [push]
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: python:3.12.6 container: python:3.12.3
steps: steps:
- run: apt-get update - run: apt-get update
- run: apt-get install -y git nodejs - run: apt-get install -y git nodejs
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: Gr1N/setup-poetry@v9 - uses: Gr1N/setup-poetry@v9
- run: poetry install - run: poetry install
- run: poetry run ruff check . - run: poetry run flake8 .
- run: poetry run mypy . - run: poetry run mypy .
- run: poetry run djlint . - run: poetry run djlint .
@ -35,15 +35,15 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v6 - uses: docker/build-push-action@v5
with: with:
push: ${{ gitea.ref_name == gitea.event.repository.default_branch || gitea.ref_type == 'tag' }} push: ${{ gitea.ref_name == 'master' || gitea.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
pypi: pypi:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: python:3.12.6 container: python:3.12.3
needs: [lint] needs: [lint]
if: gitea.ref_type == 'tag' if: gitea.ref_type == 'tag'
env: env:

6
.gitignore vendored
View File

@ -107,10 +107,8 @@ ipython_config.py
#pdm.lock #pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control. # in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control # https://pdm.fming.dev/#use-with-ide
.pdm.toml .pdm.toml
.pdm-python
.pdm-build/
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/ __pypackages__/
@ -160,4 +158,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear # and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder. # option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/ .idea/

View File

@ -1,10 +1,10 @@
FROM python:3.12.6 as build FROM python:3.12.3 as build
WORKDIR /app WORKDIR /app
COPY . . COPY . .
RUN pip install poetry && poetry build RUN pip install poetry && poetry build
FROM python:3.12.6 FROM python:3.12.3
COPY --from=build /app/dist /tmp/dist COPY --from=build /app/dist /tmp/dist
RUN pip install /tmp/dist/*.whl && rm -rf /tmp/dist RUN pip install /tmp/dist/*.whl && rm -rf /tmp/dist

View File

@ -8,12 +8,13 @@ from typing import Dict, Optional, Union
from disnake import Asset, Client, Guild, Intents, Member, User from disnake import Asset, Client, Guild, Intents, Member, User
from disnake.guild_scheduled_event import GuildScheduledEvent from disnake.guild_scheduled_event import GuildScheduledEvent
from dotenv import load_dotenv from dotenv import load_dotenv
from hypercorn.middleware import ProxyFixMiddleware
from ics import Calendar, ContentLine, Event from ics import Calendar, ContentLine, Event
from ics.alarm import DisplayAlarm from ics.alarm import DisplayAlarm
from oauthlib.oauth2 import OAuth2Error from oauthlib.oauth2 import OAuth2Error
from quart import Quart, redirect, render_template, request, session, url_for from quart import Quart, redirect, render_template, request, session, url_for
from requests_oauthlib import OAuth2Session # type: ignore from requests_oauthlib import OAuth2Session # type: ignore
from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware
load_dotenv() load_dotenv()
@ -79,7 +80,7 @@ client = Discord(intents=intents)
app = Quart(__name__) app = Quart(__name__)
app.config["SECRET_KEY"] = OAUTH2_CLIENT_SECRET app.config["SECRET_KEY"] = OAUTH2_CLIENT_SECRET
app.config["EXPLAIN_TEMPLATE_LOADING"] = QUART_DEBUG app.config["EXPLAIN_TEMPLATE_LOADING"] = QUART_DEBUG
app.asgi_app = ProxyFixMiddleware(app.asgi_app) # type: ignore app.asgi_app = ProxyHeadersMiddleware(app.asgi_app, "*") # type: ignore
def get_guild_by_id(guild_id: str) -> Optional[Guild]: def get_guild_by_id(guild_id: str) -> Optional[Guild]:

1329
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "divent" name = "divent"
version = "4.1.4" version = "4.1.3"
description = "The discord scheduled event calendar generator" description = "The discord scheduled event calendar generator"
authors = ["Xéfir Destiny <xefir@crystalyx.net>"] authors = ["Xéfir Destiny <xefir@crystalyx.net>"]
license = "WTFPL" license = "WTFPL"
@ -12,26 +12,31 @@ repository = "https://git.crystalyx.net/Xefir/Divent"
divent = 'divent.bot:run' divent = 'divent.bot:run'
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.8,<4.0" python = ">=3.8.1,<4.0.0"
disnake = "^2.9.2" disnake = "^2.9.2"
ics = "0.8.0.dev0" ics = "0.8.0.dev0"
python-dotenv = "^1.0.1" python-dotenv = "^1.0.1"
quart = "^0.19.6" quart = "^0.19.6"
requests-oauthlib = "^2.0.0" requests-oauthlib = "^2.0.0"
uvicorn = "^0.29.0"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
djlint = "^1.35.2" black = "^24.4.2"
mypy = "^1.11.2" djlint = "^1.34.1"
ruff = "^0.6.5" flake8 = "^7.0.0"
flake8-alphabetize = "^0.0.21"
flake8-black = "^0.3.6"
flake8-pyproject = "^1.2.3"
mypy = "^1.10.0"
types-oauthlib = "^3.2.0" types-oauthlib = "^3.2.0"
[tool.flake8]
max-line-length = 88
[build-system] [build-system]
requires = ["poetry-core>=1.0.0"] requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"
[tool.ruff.lint]
select = ["E", "F", "I"]
[tool.djlint] [tool.djlint]
extension = "j2" extension = "j2"
profile = "jinja" profile = "jinja"