From e0c7e3abce531764656686410b0fb45c9ddea944 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Mar 2021 19:17:55 -0800 Subject: [PATCH 1/5] Update actions/setup-python requirement to v2.2.1 (#50) Updates the requirements on [actions/setup-python](https://github.com/actions/setup-python) to permit the latest version. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/commits/3105fb18c05ddd93efea5f9e0bef7a03a6e9e7df) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish-to-test-pypi.yml | 2 +- .github/workflows/run_tests.yml | 4 ++-- .github/workflows/run_tests_matrix.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index fc248a7..4dfeb09 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2.2.1 with: python-version: 3.9 - name: Install pypa/build diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index e71a49f..a2bcabb 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v2.2.1 with: python-version: 3.9 - name: Install dependencies @@ -39,7 +39,7 @@ jobs: clean: false fetch-depth: 20 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v2.2.1 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/run_tests_matrix.yml b/.github/workflows/run_tests_matrix.yml index 77a32c8..5d879b0 100644 --- a/.github/workflows/run_tests_matrix.yml +++ b/.github/workflows/run_tests_matrix.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v2.2.1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies, discord.py version ${{ matrix.discordpy-version }} @@ -46,7 +46,7 @@ jobs: clean: false fetch-depth: 20 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v2.2.1 with: python-version: 3.9 - name: Install dependencies @@ -65,7 +65,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2.2.1 with: python-version: 3.9 - name: Install pypa/build From 960cb11935bf980c49b76a7087345e8dc2df994e Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Fri, 2 Apr 2021 14:40:33 -0400 Subject: [PATCH 2/5] validate target id to make sure that the bot does not target itself (#56) --- distest/bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distest/bot.py b/distest/bot.py index 1b617f8..e1467bf 100644 --- a/distest/bot.py +++ b/distest/bot.py @@ -49,6 +49,9 @@ def _find_target(self, server: discord.Guild) -> discord.Member: to look for the target user in :rtype: discord.Member """ + if self.user.id == self._target_name: + print("The tester cannot run tests on itself. Make sure your target id is set correctly.") + raise Exception("Cannot run tests on self.") for member in server.members: if self._target_name == member.id: if member.status == discord.Status.offline: From 4917debdc1098dad709e05e91d7989c2da2024bf Mon Sep 17 00:00:00 2001 From: Cobular <22972550+JakeCover@users.noreply.github.com> Date: Fri, 2 Apr 2021 11:55:58 -0700 Subject: [PATCH 3/5] Bump versions and add caching to test action --- .github/workflows/run_tests_matrix.yml | 10 ++++++++++ requirements.txt | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests_matrix.yml b/.github/workflows/run_tests_matrix.yml index 5d879b0..96b9ac2 100644 --- a/.github/workflows/run_tests_matrix.yml +++ b/.github/workflows/run_tests_matrix.yml @@ -5,6 +5,9 @@ on: workflow_dispatch: push: branches: [ develop, master, release/** ] + # Runs a schedule to keep the cache fresh, caches last 7 days. + schedule: + - cron: "0 4 * * 6" jobs: build-matrix: @@ -22,6 +25,13 @@ jobs: uses: actions/setup-python@v2.2.1 with: python-version: ${{ matrix.python-version }} + - name: Cache pip dependancies for python version + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pyv${{ matrix.python-version }}-dv${{ matrix.discordpy-version }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pyv${{ matrix.python-version }}-dv${{ matrix.discordpy-version }}pip- - name: Install dependencies, discord.py version ${{ matrix.discordpy-version }} run: | python -m pip install --upgrade pip diff --git a/requirements.txt b/requirements.txt index 5e60516..b1c9443 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ discord.py~=1.6.0 -Sphinx~=3.4.0 +Sphinx~=3.5.3 black==20.8b1 -furo==2020.12.30b24 \ No newline at end of file +furo==2021.3.20b30 \ No newline at end of file From 5a9d6e6e14b4f8746c9a4aa384373c51b135e78b Mon Sep 17 00:00:00 2001 From: Cobular <22972550+JakeCover@users.noreply.github.com> Date: Fri, 2 Apr 2021 12:23:26 -0700 Subject: [PATCH 4/5] Hopefully speed up actions even more, last one saved a minute and a half --- .github/workflows/run_tests_matrix.yml | 1 - README.md | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_tests_matrix.yml b/.github/workflows/run_tests_matrix.yml index 96b9ac2..6def964 100644 --- a/.github/workflows/run_tests_matrix.yml +++ b/.github/workflows/run_tests_matrix.yml @@ -35,7 +35,6 @@ jobs: - name: Install dependencies, discord.py version ${{ matrix.discordpy-version }} run: | python -m pip install --upgrade pip - pip install -r requirements.txt pip install discord.py==${{ matrix.discordpy-version }} pip install . diff --git a/README.md b/README.md index 3418f66..03b4dec 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Distest -[![CodeFactor](https://www.codefactor.io/repository/github/jakecover/distest/badge/?style=flat-square)](https://www.codefactor.io/repository/github/jakecover/distest/overview/?style=flat-square) -[![Build Status](https://img.shields.io/travis/JakeCover/distest/develop.svg?style=flat-square)](https://travis-ci.org/JakeCover/distest) -[![PyPi Version](https://img.shields.io/pypi/v/distest.svg?style=flat-square)](https://pypi.org/project/distest) +[![CodeFactor](https://www.codefactor.io/repository/github/jakecover/distest/badge/)](https://www.codefactor.io/repository/github/jakecover/distest/overview/?style=flat-square) +[![PyPi Version](https://img.shields.io/pypi/v/distest.svg)](https://pypi.org/project/distest) +![PyPI - Downloads](https://img.shields.io/pypi/dm/distest) [![Discord Server](https://img.shields.io/discord/523301176309972993.svg?label=Discord)](https://discord.gg/Dah7RHH) +[![Run Tests Matrix](https://github.com/JakeCover/distest/actions/workflows/run_tests_matrix.yml/badge.svg?branch=master)](https://github.com/JakeCover/distest/actions/workflows/run_tests_matrix.yml) A small library used to write automated test for Discord bots. From 4dbf96e69ca7aad00d35d1515939c2b87944a85d Mon Sep 17 00:00:00 2001 From: Cobular <22972550+JakeCover@users.noreply.github.com> Date: Fri, 2 Apr 2021 12:31:07 -0700 Subject: [PATCH 5/5] Increment version --- __about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__about__.py b/__about__.py index 43c4ab0..22049ab 100644 --- a/__about__.py +++ b/__about__.py @@ -1 +1 @@ -__version__ = "0.6.1" +__version__ = "0.6.2"