diff options
author | 2022-12-12 22:07:20 +0400 | |
---|---|---|
committer | 2022-12-12 22:07:20 +0400 | |
commit | 9c728dff2351a0170b372fec76e2b5e15f8846f3 (patch) | |
tree | 930b4087edbd2cd8bf00cbdfc0a79dfdddf72646 /dev | |
parent | Merge pull request #162 from python-discord/handle-thread-close-on-interactin (diff) | |
parent | Matrix test both 3.10 and 3.11 in CI (diff) |
Merge pull request #151 from python-discord/Python-3.11v9.2.0
Python 3.11 support
Diffstat (limited to 'dev')
-rw-r--r-- | dev/Dockerfile | 11 | ||||
-rw-r--r-- | dev/bot/__main__.py | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/dev/Dockerfile b/dev/Dockerfile index 0b35724a..49d03ffd 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -1,16 +1,17 @@ -FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.10-slim +ARG python_version=3.11 +FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:$python_version-slim # Install project dependencies WORKDIR /app COPY pyproject.toml poetry.lock ./ -RUN poetry install --no-root +RUN poetry install --no-root --only dev,main # Copy the source code in last to optimize rebuilding the image COPY . . # Install again, this time with the root project -RUN poetry install +RUN poetry install --only-root -ENTRYPOINT ["python"] -CMD ["-m", "bot"] +ENTRYPOINT ["poetry"] +CMD ["run", "python", "-m", "bot"] diff --git a/dev/bot/__main__.py b/dev/bot/__main__.py index 1b1a551a..e28be36b 100644 --- a/dev/bot/__main__.py +++ b/dev/bot/__main__.py @@ -31,4 +31,5 @@ async def main() -> None: async with bot: await bot.start(os.getenv("BOT_TOKEN")) -asyncio.run(main()) +if os.getenv("IN_CI", "").lower() != "true": + asyncio.run(main()) |