Compare commits
69 Commits
Author | SHA1 | Date | |
---|---|---|---|
aee86f1536 | |||
|
eba62c57ef | ||
3025ed01ca | |||
|
dcf779abf0 | ||
cd30fd17d6 | |||
5c21664677 | |||
|
d92f162a2c | ||
76268dc29c | |||
|
626af46844 | ||
67c4133f3a | |||
|
85896108f4 | ||
78965ce0e9 | |||
9ad9bf7fba | |||
|
a3494c9009 | ||
|
638fe15334 | ||
7e940f5c0d | |||
|
6fe8639e7f | ||
505df4b39c | |||
|
ef8d86f145 | ||
b0459e919d | |||
|
38474bb2f3 | ||
c882c3c25a | |||
|
0e6f4b085f | ||
fbcfbe85c5 | |||
|
b939145f14 | ||
395d2787bb | |||
|
6e1b78f7c9 | ||
eeaaedd4f4 | |||
|
db60a889bc | ||
8c8db1aab8 | |||
|
2ef2d496f6 | ||
053364d5f4 | |||
71297a50fd | |||
|
b629176e31 | ||
769e7f165a | |||
|
8a48ca3488 | ||
7629c6185c | |||
|
b877aecc3d | ||
ef5da07184 | |||
|
da14f6c5c7 | ||
d29793edad | |||
283cf7b1a1 | |||
|
8fd9b0dd1f | ||
b909b9218c | |||
ffd096945d | |||
|
1cd3172b33 | ||
14b32b6171 | |||
|
8ca22ad0cc | ||
aa3b77565f | |||
|
47393ced5c | ||
339ef24f1d | |||
|
08c44da305 | ||
65b3ddfda2 | |||
|
6f470a80e4 | ||
cc13ba82a9 | |||
|
7ccefdc894 | ||
182de6c8cc | |||
|
faa898f3e1 | ||
1c5a1db991 | |||
|
2936ee7f82 | ||
57f2cb51c1 | |||
677e015df2 | |||
fb310dff1f | |||
0ef1aa19d3 | |||
|
2f3ed90c85 | ||
8e5dae82f8 | |||
|
69ffcdf8c6 | ||
7893499305 | |||
b0f10a7933 |
@ -4,14 +4,14 @@ on: [push]
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: python:3.12.3
|
container: python:3.12.6
|
||||||
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 flake8 .
|
- run: poetry run ruff check .
|
||||||
- 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@v5
|
- uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: ${{ gitea.ref_name == 'master' || gitea.ref_type == 'tag' }}
|
push: ${{ gitea.ref_name == gitea.event.repository.default_branch || 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.3
|
container: python:3.12.6
|
||||||
needs: [lint]
|
needs: [lint]
|
||||||
if: gitea.ref_type == 'tag'
|
if: gitea.ref_type == 'tag'
|
||||||
env:
|
env:
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -107,8 +107,10 @@ 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/#use-with-ide
|
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
||||||
.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__/
|
||||||
@ -158,4 +160,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/
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
FROM python:3.12.3 as build
|
FROM python:3.12.6 as build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pip install poetry && poetry build
|
RUN pip install poetry && poetry build
|
||||||
|
|
||||||
FROM python:3.12.3
|
FROM python:3.12.6
|
||||||
|
|
||||||
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
|
||||||
|
@ -8,13 +8,12 @@ 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()
|
||||||
|
|
||||||
@ -80,7 +79,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 = ProxyHeadersMiddleware(app.asgi_app, "*") # type: ignore
|
app.asgi_app = ProxyFixMiddleware(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]:
|
||||||
|
1327
poetry.lock
generated
1327
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "divent"
|
name = "divent"
|
||||||
version = "4.1.3"
|
version = "4.1.4"
|
||||||
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,31 +12,26 @@ repository = "https://git.crystalyx.net/Xefir/Divent"
|
|||||||
divent = 'divent.bot:run'
|
divent = 'divent.bot:run'
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.8.1,<4.0.0"
|
python = ">=3.8,<4.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]
|
||||||
black = "^24.4.2"
|
djlint = "^1.35.2"
|
||||||
djlint = "^1.34.1"
|
mypy = "^1.11.2"
|
||||||
flake8 = "^7.0.0"
|
ruff = "^0.6.5"
|
||||||
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user