Skip to content

Commit

Permalink
Update actions to Node 20 & Deps update (#197)
Browse files Browse the repository at this point in the history
* Cause chaos, update actions to Node 20

* Updating deps, update actions with matching dep versions

* Fix up some new typing issues

* Remember to check style challenge (very hard)
  • Loading branch information
JamesDearlove authored Mar 9, 2024
1 parent 547c804 commit b7ebf6d
Show file tree
Hide file tree
Showing 9 changed files with 869 additions and 794 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Login against the Docker registry
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -32,7 +32,7 @@ jobs:
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run black
id: runBlack
uses: psf/black@stable
with:
options: "--check --verbose"
src: "./uqcsbot"
version: "23.3.0"
version: "23.12.1"

- name: Convert logs to artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always() && (steps.runBlack.outcome == 'failure')
with:
name: "black-logs"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
PYTHON_VERSION: '3.10'
POETRY_VERSION: '1.4.2'
POETRY_VERSION: '1.7.1'

jobs:
tests:
Expand All @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Local action that tries to cache as much of python & poetry as possible
- name: Setup environment
Expand All @@ -34,7 +34,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

# Local action that tries to cache as much of python & poetry as possible
- name: Setup environment
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/setup-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
# Get python
# ------
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

Expand All @@ -25,7 +25,7 @@ runs:
# ------
- name: Check for cached poetry binary
id: cached-poetry-binary
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.local
# poetry depends on OS, python version, and poetry version
Expand All @@ -50,7 +50,7 @@ runs:
# ------
- name: Check for cached dependencies
id: cached-poetry-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: '**/.venv'
# poetry dependencies depend on OS, python version, poetry version, and repository lockfile
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1 \
POETRY_VERSION=1.4.2 \
POETRY_VERSION=1.7.1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_CACHE_DIR='/var/cache/pypoetry'

Expand Down
1,611 changes: 840 additions & 771 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ license = "MIT"

[tool.poetry.dependencies]
python = "^3.10"
"discord.py" = "^2.2.3"
"discord.py" = "^2.3.2"
icalendar = "^5.0"
"python-dateutil" = "^2.8"
"python-dateutil" = "^2.9"
pytz = "^2023.3"
requests = "^2.28"
requests = "^2.31"
beautifulsoup4 = "^4.12"
APScheduler = "^3.10"
SQLAlchemy = {version = "^2.0.12", extras = ["postgresql_psycopg2binary"]}
humanize = "^4.3"
aiohttp = "^3.8"
SQLAlchemy = {version = "^2.0.28", extras = ["postgresql_psycopg2binary"]}
humanize = "^4.9"
aiohttp = "^3.9"
aio-mc-rcon = "^3.2.0"
PyYAML = "^6.0"
mcstatus = "^11.1.0"
Expand All @@ -25,10 +25,10 @@ mcstatus = "^11.1.0"
botdev = "dev.cli:main"

[tool.poetry.group.dev.dependencies]
pytest = "^7.3.1"
pytest = "^7.4.4"
pytest-datafiles = "^3.0.0"
python-dotenv = "^1.0.0"
black = "^23.3.0"
black = "^23.12.0"
pyright = "^1.1.316"
types-requests = "^2.30.0.0"
types-beautifulsoup4 = "^4.12.0.4"
Expand Down
5 changes: 4 additions & 1 deletion uqcsbot/dominos_coupons.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ async def dominoscoupons(
try:
coupons = _get_coupons(number_of_coupons, ignore_expiry, keywords.split())
except RequestException as error:
resp_content = (
error.response.content if error.response else "No response error given."
)
logging.warning(
f"Could not connect to dominos coupon site ({COUPONESE_DOMINOS_URL}): {error.response.content}"
f"Could not connect to dominos coupon site ({COUPONESE_DOMINOS_URL}): {resp_content}"
)
await interaction.edit_original_response(
content=f"Sadly could not reach the coupon website (<{COUPONESE_DOMINOS_URL}>)..."
Expand Down
5 changes: 4 additions & 1 deletion uqcsbot/holidays.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def get_holiday_page() -> bytes | None:
response = requests.get(HOLIDAY_URL)
return response.content
except RequestException as e:
logging.warning(e.response.content)
resp_content = e.response.content if e.response else "No response error given."
logging.warning(
f"(RequestException) Could not fetch {HOLIDAY_URL}: {resp_content}"
)


class Holidays(commands.Cog):
Expand Down

0 comments on commit b7ebf6d

Please sign in to comment.