Skip to content

Commit

Permalink
Merge pull request #159 from GrantBirki/update-python-packages
Browse files Browse the repository at this point in the history
Dependency Upgrades
GrantBirki authored Nov 25, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 0b22f81 + 355ef9b commit 8c33202
Showing 8 changed files with 46 additions and 57 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -83,25 +83,14 @@ jobs:
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # pin@v2

- name: Set up Python 3.9
uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # pin@v2
- name: Set up Python 3.11
uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # pin@v2.3.3
with:
python-version: 3.9

# Cache the requirements.txt file to speed up CI jobs
# Cache is disabled for now as it needs to be fixed
# - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2
# id: cache
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
python-version: 3.11
cache: 'pip' # caching pip dependencies

- name: Install dependencies
# if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "cache miss - installing dependencies"
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
@@ -113,8 +102,7 @@ jobs:
# Use this step for validating json files commit to the repo
- name: JSON Validation
working-directory: src/errbot
run: |
python -mjson.tool plugins/league/responses.json > /dev/null
run: python -mjson.tool plugins/league/responses.json > /dev/null

build:
needs: [changes, test]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@

[**Click here**](https://discord.com/api/oauth2/authorize?client_id=943402285680189511&permissions=36734976&scope=bot) to invite errbot to your Discord server!

> Note: The public version of errbot is no longer available. If you wish to use errbot, you must self host it on your own
> ⚠️ Note: The public version of errbot is no longer available. If you wish to use errbot, you must self host it on your own
## About 💡

23 changes: 12 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
errbot==6.1.9
discord.py==1.6.0
discord.py==2.1.0
requests-mock==1.9.3
pytest==7.0.1
pytest-cov==3.0.0
pytest-env==0.6.2
riotwatcher==3.1.3
riotwatcher==3.2.4
PyNaCl==1.4.0
pynamodb==5.1.0
boto3==1.18.29
yt-dlp==2022.7.18
pynamodb==5.3.2
boto3==1.26.16
yt-dlp==2022.11.11
youtube-search-python==1.6.6
spotipy==2.19.0
spotipy==2.21.0
gTTS==2.2.3
validators==0.18.2
psutil==5.8.0
sentry-sdk==1.9.6
selenium==4.1.0
validators==0.20.0
psutil==5.9.4
sentry-sdk==1.11.1
selenium==4.6.0
PyVirtualDisplay==2.2
Pillow==9.0.1
Pillow==9.3.0
qrcode==7.3.1
scdl==2.7.3
22 changes: 11 additions & 11 deletions src/errbot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-alpine
FROM python:3.11-alpine

WORKDIR /app

@@ -19,26 +19,26 @@ RUN pip install -r requirements.txt
# create nonroot errbot user and switch to it
RUN adduser -D errbot -u 10001
RUN chown -R errbot:errbot /app
RUN chown -R errbot:errbot /usr/local/lib/python3.9/site-packages/errbot
RUN chown -R errbot:errbot /usr/local/lib/python3.11/site-packages/errbot
USER errbot

# replace default errbot files with our custom ones
COPY --chown=errbot:errbot package/core.py /usr/local/lib/python3.9/site-packages/errbot/core.py
COPY --chown=errbot:errbot package/core_plugins/help.py /usr/local/lib/python3.9/site-packages/errbot/core_plugins/help.py
COPY --chown=errbot:errbot package/core_plugins/acls.py /usr/local/lib/python3.9/site-packages/errbot/core_plugins/acls.py
COPY --chown=errbot:errbot package/core.py /usr/local/lib/python3.11/site-packages/errbot/core.py
COPY --chown=errbot:errbot package/core_plugins/help.py /usr/local/lib/python3.11/site-packages/errbot/core_plugins/help.py
COPY --chown=errbot:errbot package/core_plugins/acls.py /usr/local/lib/python3.11/site-packages/errbot/core_plugins/acls.py

# init errbot
RUN errbot --init

# cleanup unused default errbot plugins
RUN \
rm -rf plugins/err-example \
rm /usr/local/lib/python3.9/site-packages/errbot/core_plugins/chatRoom.* \
rm /usr/local/lib/python3.9/site-packages/errbot/core_plugins/flows.* \
rm /usr/local/lib/python3.9/site-packages/errbot/core_plugins/webserver.* \
rm /usr/local/lib/python3.9/site-packages/errbot/core_plugins/backup.* \
rm /usr/local/lib/python3.9/site-packages/errbot/core_plugins/plugins.* \
rm /usr/local/lib/python3.9/site-packages/errbot/core_plugins/textcmds.*
rm /usr/local/lib/python3.11/site-packages/errbot/core_plugins/chatRoom.* \
rm /usr/local/lib/python3.11/site-packages/errbot/core_plugins/flows.* \
rm /usr/local/lib/python3.11/site-packages/errbot/core_plugins/webserver.* \
rm /usr/local/lib/python3.11/site-packages/errbot/core_plugins/backup.* \
rm /usr/local/lib/python3.11/site-packages/errbot/core_plugins/plugins.* \
rm /usr/local/lib/python3.11/site-packages/errbot/core_plugins/textcmds.*

# for discord / other backends
COPY --chown=errbot:errbot backend /app/backend
2 changes: 1 addition & 1 deletion src/errbot/backend/err-backend-discord/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
discord.py==2.0.1
discord.py==2.1.0
6 changes: 2 additions & 4 deletions src/errbot/plugins/league/league.py
Original file line number Diff line number Diff line change
@@ -568,9 +568,7 @@ def get_summoner_match_list(self, summoner_puuid):
[i] API CALL
"""
try:
return LOL_WATCHER.match_v5.matchlist_by_puuid(
RIOT_REGION_V5, summoner_puuid
)
return LOL_WATCHER.match.matchlist_by_puuid(RIOT_REGION_V5, summoner_puuid)
except Exception as err:
ErrHelper().capture(err)
raise
@@ -581,7 +579,7 @@ def get_match_data(self, match_id):
[i] API CALL
"""
try:
return LOL_WATCHER.match_v5.by_id(RIOT_REGION_V5, match_id)
return LOL_WATCHER.match.by_id(RIOT_REGION_V5, match_id)
except Exception as err:
ErrHelper().capture(err)
raise
4 changes: 3 additions & 1 deletion src/errbot/plugins/lib/chat/chatutils.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,9 @@
}

BACKEND = os.environ["BACKEND"]
BOT_ADMINS = os.environ.get("BOT_ADMINS", "").split(",")

# Get the bot admins and strip out any '@' symbols
BOT_ADMINS = [x.strip("@") for x in os.environ.get("BOT_ADMINS", "").split(",")]

# Get the allow listed servers for the Discord server lock
server_lock_env = os.environ.get("SERVER_LOCK_ALLOW_LIST", None)
22 changes: 11 additions & 11 deletions src/errbot/requirements.txt
Original file line number Diff line number Diff line change
@@ -2,47 +2,47 @@
errbot==6.1.9

# league
riotwatcher==3.1.3
riotwatcher==3.2.4

# errbot[discord]
PyNaCl==1.4.0

# DynamoDB
pynamodb==5.1.0
pynamodb==5.3.2

# AWS
boto3==1.18.29
boto3==1.26.16

# yt-dlp / youtube-dl
yt-dlp==2022.7.18
yt-dlp==2022.11.11

# soundcloud downloader
scdl==2.7.1
scdl==2.7.3

# youtube string searching
youtube-search-python==1.6.6

# spotipy
spotipy==2.19.0
spotipy==2.21.0

# text to speech
gTTS==2.2.3

# validators
validators==0.18.2
validators==0.20.0

# psutil
psutil==5.8.0
psutil==5.9.4

# sentry
sentry-sdk==1.9.6
sentry-sdk==1.11.1

# selenium
selenium==4.1.0
selenium==4.6.0
PyVirtualDisplay==2.2

# Pillow
Pillow==9.0.1
Pillow==9.3.0

# QR Code generator
qrcode==7.3.1

0 comments on commit 8c33202

Please sign in to comment.