Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump up to Python 3.13 #296

Merged
merged 6 commits into from
Feb 16, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
uses: actions/checkout@v4

- name: Install native dependencies
run: sudo apt-get update && sudo apt-get install -y libldap2-dev libsasl2-dev
run: sudo apt-get update && sudo apt-get install -y libldap2-dev libsasl2-dev heimdal-dev

- name: Install Python dependencies
uses: HassanAbouelela/actions/setup-python@setup-python_v1.6.0
with:
python_version: "3.12"
python_version: "3.13"

- name: Run pre-commit hooks
run: SKIP=ruff-lint pre-commit run --all-files
Expand Down
24 changes: 14 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
ARG python_version=3.12-slim
ARG python_version=3.13-slim

FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version AS wheel-builder

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-deploy / Build & push

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-deploy / Build & push

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

# Install build dependencies
RUN apt-get update && apt-get install --no-install-recommends -y libldap2-dev libsasl2-dev gcc && apt autoclean && rm -rf /var/lib/apt/lists/*

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
libldap2-dev \
libsasl2-dev \
gcc \
heimdal-dev \
&& apt autoclean && rm -rf /var/lib/apt/lists/*

# Install project dependencies with build tools available
COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev --with ldap --no-root

# Only the LDAP group has deps that requires gcc, so only build that for now
RUN poetry install --only ldap --no-root
# -------------------------------------------------------------------------------

FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version

Check warning on line 20 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-deploy / Build & push

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

Check warning on line 20 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-deploy / Build & push

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/
COPY --from=wheel-builder /opt/poetry/cache /opt/poetry/cache

RUN apt-get update && apt-get install --no-install-recommends -y libmagickwand-dev && rm -rf /var/lib/apt/lists/*

# Install dependencies from build cache
WORKDIR /app

# Copy the pre-built LDAP group from the build stage that required gcc
COPY --from=wheel-builder /opt/poetry/cache /opt/poetry/cache

# Install the rest of the dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev --with ldap --no-root

Expand Down
2 changes: 1 addition & 1 deletion arthur/exts/cloudflare/zones.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def select_zones(
description_content = f"The cache for `{zone_name}` couldn't be cleared.\n"
if errors := purge_attempt_response["errors"]:
for error in errors:
description_content += f"`{error["code"]}`: {error["message"]}\n"
description_content += f"`{error['code']}`: {error['message']}\n"
message = generate_error_message(description=description_content, emote=":x:")

self.disable_select()
Expand Down
2 changes: 1 addition & 1 deletion arthur/exts/directory/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ async def sync(self, ctx: commands.Context) -> None:
for user in diff_sorted:
prefix = prefixes[user.action]
diff_message += f"{prefix} {self._format_user(user.discord_user, user.ldap_user)}"
diff_message += f" ({", ".join(user.groups)})\n"
diff_message += f" ({', '.join(user.groups)})\n"

diff_message += "```\n"

Expand Down
4 changes: 2 additions & 2 deletions arthur/exts/fun/devops_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ async def rules_group(self, ctx: Context, rules: Greedy[int]) -> None:
output_rules = self.rules.keys()

if not output_rules:
await ctx.send(f":x: Rule{"s"[: len(rules) ^ 1]} not found.")
await ctx.send(f":x: Rule{'s'[: len(rules) ^ 1]} not found.")
return

output = "\n".join(
f"{key}: {value}" for key, value in self.rules.items() if key in output_rules
)
await ctx.send(
embed=discord.Embed(
title=f"Rule{"s"[: len(output_rules) ^ 1]}",
title=f"Rule{'s'[: len(output_rules) ^ 1]}",
description=output,
colour=discord.Colour.og_blurple(),
url="https://docs.pydis.wtf/onboarding/rules.html",
Expand Down
2 changes: 1 addition & 1 deletion arthur/exts/fun/motivation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def send_daily_mission(self) -> None:
continue

await self.devops_channel.send(
f"[Today's mission](https://www.youtube.com/shorts/{video["id"]["videoId"]})"
f"[Today's mission](https://www.youtube.com/shorts/{video['id']['videoId']})"
)
break
else:
Expand Down
2 changes: 1 addition & 1 deletion arthur/exts/grafana/github_team_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def sync_github_grafana_teams(self, channel: discord.TextChannel | None =
colour=discord.Colour.blue(),
)
for team in grafana_teams:
logger.debug(f"Processing {team["name"]}")
logger.debug(f"Processing {team['name']}")
try:
figures = await self._sync_teams(team)
except aiohttp.ClientResponseError as e:
Expand Down
4 changes: 2 additions & 2 deletions arthur/exts/grafana/ldap_team_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ async def sync_ldap_grafana_teams(self, channel: discord.TextChannel | None = No
colour=discord.Colour.blue(),
)
for team in grafana_teams:
logger.debug(f"Processing {team["name"]}")
logger.debug(f"Processing {team['name']}")
try:
figures = await self._sync_teams(team)
except aiohttp.ClientResponseError as e:
logger.opt(exception=e).error(f"Error whilst procesing Grafana team {team["name"]}")
logger.opt(exception=e).error(f"Error whilst procesing Grafana team {team['name']}")
if channel:
await channel.send(e)
continue
Expand Down
Loading
Loading