Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.devcontainer/
.env
.git/
.github/
.venv/
.vscode/
Expand All @@ -18,4 +17,4 @@ site/
.pre-commit-config.yaml
.gitignore
.cursorrules
.editorconfig
.editorconfig
8 changes: 8 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch the full repository history including .git

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -40,3 +45,6 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=1

5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,10 @@ RUN --mount=type=cache,target=/root/.cache pip install poetry==$POETRY_VERSION

WORKDIR /app

# Copy only the metadata files to increase build cache hit rate
COPY pyproject.toml poetry.lock ./
COPY . .
RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
poetry install --only main --no-root --no-directory

# Now install the application itself
COPY . .
RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
--mount=type=cache,target=/root/.cache \
poetry install --only main && \
Expand Down
1 change: 0 additions & 1 deletion config/settings.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ BOT_INFO:
PROD_PREFIX: "$"
DEV_PREFIX: "~" # You can enable dev mode in .env
BOT_NAME: "Tux" # This may not apply everywhere, WIP (Best to keep it as Tux for now). Help command will be changed to be less Tux-specific if you change this.
BOT_VERSION: "git" # vX.Y.Z or git
HIDE_BOT_OWNER: false # Hide bot owner and sysadmin from help command
# Available substitutions:
# {member_count} - total member count of all guilds
Expand Down
76 changes: 32 additions & 44 deletions poetry.lock

Large diffs are not rendered by default.

28 changes: 22 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
[project]
name = "tux"
version = "0.1.0"
description = "Tux is an all in one bot for the All Things Linux discord server."
authors = [{ name = "All Things Linux", email = "tux@allthingslinux.org" }]
requires-python = ">=3.13.2,<3.14"
readme = "README.md"
urls = { repository = "https://github.com/allthingslinux/tux" }
dynamic = ["dependencies"]
dynamic = ["dependencies", "version"]

[project.scripts]
tux = "tux.cli:main"

[build-system]
requires = ["poetry-core>=2.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=2.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry]
packages = [{ include = "tux" }]
version = "0.0.0"

[tool.poetry-dynamic-versioning]
enable = true
metadata = true
dirty = true
format-jinja = """
{%- if distance == 0 -%}
{{ serialize_pep440(base, stage, revision) }}
{%- elif branch == "main" -%}
{{ serialize_pep440(base, stage, revision, dev=distance, metadata=[commit]) }}
{%- else -%}
{{ serialize_pep440(base, stage, revision, dev=distance, metadata=[commit, branch_escaped]) }}
{%- endif -%}
"""

[tool.poetry.requires-plugins]
poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }

[tool.poetry.dependencies]
python = ">=3.13.2,<3.14"
Expand Down Expand Up @@ -49,7 +66,6 @@ rich = "^13.9.4"
watchdog = "^6.0.0"
arrow = "^1.3.0"
click = "^8.1.8"
single-source = "^0.4.0"
levenshtein = "^0.27.1"

[tool.poetry.group.dev.dependencies]
Expand Down Expand Up @@ -147,4 +163,4 @@ strictListInference = true
strictSetInference = true
typeCheckingMode = "strict"
venv = ".venv"
venvPath = "."
venvPath = "."
6 changes: 2 additions & 4 deletions tux/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from pathlib import Path

from single_source import get_version
from importlib import metadata

# Dynamically get the version from pyproject.toml
__version__ = get_version("tux", Path(__file__).parent.parent)
__version__: str = metadata.version("tux")