diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2677c249..fae84fea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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] diff --git a/README.md b/README.md index 4ce8a8ac..0c698390 100644 --- a/README.md +++ b/README.md @@ -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 💡 diff --git a/requirements.txt b/requirements.txt index bd681e09..4941d531 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/src/errbot/Dockerfile b/src/errbot/Dockerfile index 34ddd5b6..fbb9ee86 100644 --- a/src/errbot/Dockerfile +++ b/src/errbot/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-alpine +FROM python:3.11-alpine WORKDIR /app @@ -19,13 +19,13 @@ 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 @@ -33,12 +33,12 @@ 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 diff --git a/src/errbot/backend/err-backend-discord/requirements.txt b/src/errbot/backend/err-backend-discord/requirements.txt index 184d1a9a..47a3c964 100644 --- a/src/errbot/backend/err-backend-discord/requirements.txt +++ b/src/errbot/backend/err-backend-discord/requirements.txt @@ -1 +1 @@ -discord.py==2.0.1 +discord.py==2.1.0 diff --git a/src/errbot/plugins/league/league.py b/src/errbot/plugins/league/league.py index 47ac3a4d..0cb57eb3 100644 --- a/src/errbot/plugins/league/league.py +++ b/src/errbot/plugins/league/league.py @@ -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 diff --git a/src/errbot/plugins/lib/chat/chatutils.py b/src/errbot/plugins/lib/chat/chatutils.py index 7e152426..8af9311c 100644 --- a/src/errbot/plugins/lib/chat/chatutils.py +++ b/src/errbot/plugins/lib/chat/chatutils.py @@ -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) diff --git a/src/errbot/requirements.txt b/src/errbot/requirements.txt index 66a40fd1..8105ff54 100644 --- a/src/errbot/requirements.txt +++ b/src/errbot/requirements.txt @@ -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