Skip to content

Commit

Permalink
ci: automate tests with python 3.12 (#77)
Browse files Browse the repository at this point in the history
* ci: automate tests with python 3.12

* build: remove depreciated update script

* build(deps): update ruff
  • Loading branch information
natelandau authored Oct 2, 2023
1 parent 132af28 commit 6cd48f5
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 190 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
python-version: ["3.11", "3.12"]
steps:
- name: Harden Security Runner
uses: step-security/harden-runner@v2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ repos:
entry: yamllint --strict --config-file .yamllint.yml

- repo: "https://github.com/charliermarsh/ruff-pre-commit"
rev: "v0.0.291"
rev: "v0.0.292"
hooks:
- id: ruff
args: ["--extend-ignore", "I001,D301,D401", "--preview"]
Expand Down
52 changes: 26 additions & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
py-cord = "^2.4.1"
python = "^3.11"
python-dotenv = "^1.0.0"
rich = "^13.6.0"
semver = "^3.0.1"
typer = { extras = ["all"], version = "^0.9.0" }
rich = "^13.6.0"

[tool.poetry.group.test.dependencies]
dirty-equals = "^0.6.0"
Expand All @@ -48,7 +48,7 @@
pdoc = "^14.0.0"
poethepoet = "^0.22.1"
pre-commit = "^3.4.0"
ruff = "^0.0.291"
ruff = "^0.0.292"
shellcheck-py = "^0.9.0.5"
types-aiofiles = "^23.2.0.0"
typos = "^1.16.11"
Expand Down Expand Up @@ -297,7 +297,7 @@
help = "Lint this package"

[[tool.poe.tasks.lint.sequence]]
shell = "ruff --no-fix src/"
shell = "ruff --preview --no-fix src/"

[[tool.poe.tasks.lint.sequence]]
shell = "black --check src/ tests/"
Expand Down
150 changes: 0 additions & 150 deletions scripts/update_dependencies.py

This file was deleted.

6 changes: 3 additions & 3 deletions src/valentina/cogs/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ async def massban(
return

# Confirm the action
title = f"Mass ban {count} {p.plural_noun('member',count)} from this guild"
title = f"Mass ban {count} {p.plural_noun('member', count)} from this guild"
is_confirmed, confirmation_response_msg = await confirm_action(
ctx, title, description=reason, hidden=hidden
)
Expand Down Expand Up @@ -604,7 +604,7 @@ async def purge_bot_messages(
count = len(await purge(limit=limit, reason=reason, check=lambda m: m.author.bot))
await present_embed(
ctx,
title=f"Purged `{count}` bot {p.plural_noun('message',count)} in this channel",
title=f"Purged `{count}` bot {p.plural_noun('message', count)} in this channel",
level="warning",
ephemeral=True,
)
Expand Down Expand Up @@ -646,7 +646,7 @@ async def purge_containing(
)
await present_embed(
ctx,
title=f"Purged `{count}` {p.plural_noun('message',count)} containing `{phrase}` in this channel",
title=f"Purged `{count}` {p.plural_noun('message', count)} containing `{phrase}` in this channel",
level="warning",
ephemeral=True,
)
Expand Down
6 changes: 3 additions & 3 deletions src/valentina/models/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ def get_text(self, with_title: bool = True, with_help: bool = True) -> str:
msg += f"""\
```python
Total Rolls: {'.':.<{25 - 12}} {self.total_rolls}
Critical Success Rolls: {'.':.<{25 -23}} {self.criticals:<3} ({self.criticals / self.total_rolls * 100:.2f}%)
Critical Success Rolls: {'.':.<{25 - 23}} {self.criticals:<3} ({self.criticals / self.total_rolls * 100:.2f}%)
Successful Rolls: {'.':.<{25 - 17}} {self.successes:<3} ({self.successes / self.total_rolls * 100:.2f}%)
Failed Rolls: {'.':.<{25 - 13}} {self.failures:<3} ({self.failures / self.total_rolls * 100:.2f}%)
Botched Rolls: {'.':.<{25 - 14}} {self.botches:<3} ({self.botches / self.total_rolls * 100:.2f}%)
Average Difficulty: {'.':.<{25 -19}} {self.average_difficulty}
Average Pool Size: {'.':.<{25 -18}} {self.average_pool}
Average Difficulty: {'.':.<{25 - 19}} {self.average_difficulty}
Average Pool Size: {'.':.<{25 - 18}} {self.average_pool}
```
"""

Expand Down
2 changes: 1 addition & 1 deletion src/valentina/utils/changelog_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def get_embed_personality(self) -> discord.Embed:
discord.Embed: The changelog embed.
"""
# Create and populate the embed description
description = f"Valentina, your {random.choice(['honored','admired','distinguished','celebrated','hallowed','prestigious','acclaimed','favorite','friendly neighborhood','prized', 'treasured', 'number one','esteemed','venerated','revered','feared'])} {random.choice(BOT_DESCRIPTIONS)}, has {random.choice(['been granted new powers', 'leveled up','spent experience points','gained new abilities','been bitten by a radioactive spider', 'spent willpower points', 'been updated','squashed bugs and gained new features',])}!\n"
description = f"Valentina, your {random.choice(['honored', 'admired', 'distinguished', 'celebrated', 'hallowed', 'prestigious', 'acclaimed', 'favorite', 'friendly neighborhood', 'prized', 'treasured', 'number one', 'esteemed', 'venerated', 'revered', 'feared'])} {random.choice(BOT_DESCRIPTIONS)}, has {random.choice(['been granted new powers', 'leveled up', 'spent experience points', 'gained new abilities', 'been bitten by a radioactive spider', 'spent willpower points', 'been updated', 'squashed bugs and gained new features',])}!\n"

# Loop through each version in the changelog
for version, data in self.changelog_dict.items():
Expand Down
4 changes: 2 additions & 2 deletions src/valentina/views/roll_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ def _add_trait_fields(self, embed: discord.Embed) -> discord.Embed:
if self.trait_one and self.trait_two:
embed.add_field(
name="**Rolled Traits**",
value=f"{self.trait_one.name}: `{self.trait_one_value} {p.plural_noun('die',self.trait_one_value)}`\n{self.trait_two.name}: `{self.trait_two_value} {p.plural_noun('die',self.trait_two_value)}`",
value=f"{self.trait_one.name}: `{self.trait_one_value} {p.plural_noun('die', self.trait_one_value)}`\n{self.trait_two.name}: `{self.trait_two_value} {p.plural_noun('die', self.trait_two_value)}`",
inline=False,
)
elif self.trait_one:
embed.add_field(
name="**Rolled Traits**",
value=f"{self.trait_one.name}: `{self.trait_one_value} {p.plural_noun('die',self.trait_one_value)}`",
value=f"{self.trait_one.name}: `{self.trait_one_value} {p.plural_noun('die', self.trait_one_value)}`",
inline=False,
)

Expand Down

0 comments on commit 6cd48f5

Please sign in to comment.