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
47 changes: 19 additions & 28 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2.10.2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -20,10 +20,10 @@ jobs:
- 'tox.ini'

- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
if: steps.filter.outputs.python == 'true'
with:
python-version: "3.12"
python-version: "3.13"

- name: Install Dependencies
if: steps.filter.outputs.python == 'true'
Expand All @@ -44,17 +44,14 @@ jobs:
strategy:
matrix:
toxenv:
- py311-unittest
- py312-unittest
- py313-unittest
include:
- toxenv: py311-unittest
python-version: "3.11"
- toxenv: py312-unittest
python-version: "3.12"
- toxenv: py313-unittest
python-version: "3.13"

steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2.10.2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -63,7 +60,7 @@ jobs:
- 'tox.ini'

- name: Set up Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
if: steps.filter.outputs.python == 'true'
with:
python-version: "${{ matrix.python-version }}"
Expand All @@ -79,14 +76,8 @@ jobs:
run: |
tox -e ${{ matrix.toxenv }}

- name: Dump Test Coverage
if: steps.filter.outputs.python == 'true' && matrix.toxenv == 'py312-unittest'
run: |
pip install coverage
coverage xml

- name: Store Test Coverage
if: steps.filter.outputs.python == 'true' && matrix.toxenv == 'py312-unittest'
if: steps.filter.outputs.python == 'true' && matrix.toxenv == 'py313-unittest'
uses: actions/upload-artifact@v4
with:
name: coverage
Expand All @@ -101,10 +92,10 @@ jobs:
- unittest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2.10.2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -113,10 +104,10 @@ jobs:
- 'tox.ini'

- name: Setup Python
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v5
if: steps.filter.outputs.python == 'true'
with:
python-version: "3.12"
python-version: "3.13"

- name: Install Coverage & diff_cover
if: steps.filter.outputs.python == 'true'
Expand All @@ -135,7 +126,7 @@ jobs:
run: |
coverage report

# - name: Check Coverage Diff
# if: steps.filter.outputs.python == 'true'
# run: |
# diff-cover ./coverage.xml --compare-branch=origin/main --fail-under=100
- name: Coverage Diff
if: steps.filter.outputs.python == 'true'
run: |
diff-cover coverage.xml --compare-branch=origin/main || true
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.13.11
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:alpine AS base
FROM python:3.13-alpine AS base

RUN apk update && apk upgrade

Expand Down
8 changes: 5 additions & 3 deletions am_bot/cogs/starboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ async def on_raw_reaction_add(
"inline": False,
}
],
"color": 3375061
if self._last_message.embeds[0].color == 16769024
else 16769024,
"color": (
3375061
if self._last_message.embeds[0].color == 16769024
else 16769024
),
"timestamp": datetime.utcnow()
.replace(tzinfo=timezone.utc)
.isoformat(),
Expand Down
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "am_bot"
authors = [
{name = "ARKModding", email = "no-reply@arkmodding.net"},
]
requires-python = ">=3.8"
requires-python = ">=3.10"
readme = "README.md"
classifiers = []
dynamic = [
Expand Down Expand Up @@ -40,21 +40,24 @@ exclude_dirs = [

[tool.black]
line-length = 79
target-version = ['py312']
target-version = ['py313']
include = '\.pyi?$'

[tool.isort]
profile = "black"
line_length = 79
lines_after_imports = 2
skip = [".tox", "venv"]
skip = [".tox", "venv", ".venv"]

[tool.ruff]
exclude = [
"venv",
".venv",
"__init__.py",
]
line-length = 79

[tool.ruff.lint]
select = [
"B",
"C",
Expand All @@ -63,6 +66,9 @@ select = [
"W",
]

[tool.coverage.run]
relative_files = true

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
description = {file = ["README.md"]}
Expand Down
9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
skipsdist=True
# Run these envs when tox is invoked without -e
envlist=lint,py{38,39,310,311,312}-unittest
envlist=lint,py{310,311,312,313}-unittest


[testenv]
Expand All @@ -22,11 +22,10 @@ envlist=lint,py{38,39,310,311,312}-unittest
recreate=False

basepython=
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
py313: python3.13

deps=
lint: {[lint-config]deps}
Expand Down Expand Up @@ -56,7 +55,7 @@ deps=
commands=
black . --check
isort --check-only --diff .
ruff . --no-fix
ruff check . --no-fix
bandit -r am_bot


Expand All @@ -74,6 +73,8 @@ deps=
commands=
coverage erase
coverage run -m pytest {posargs}
coverage xml -o {toxinidir}/coverage.xml
coverage report


[testenv:lint]
Expand Down
Loading