From 1e81424a98d9025fc942a80e86aa77291fbb4540 Mon Sep 17 00:00:00 2001 From: Ron Hudson <3606628+pastorhudson@users.noreply.github.com> Date: Thu, 18 Mar 2021 16:26:37 -0400 Subject: [PATCH 1/5] Travis Fix, Github Actions, heroku fix - Fix travis-ci - Add github actions ci - Remove 2.7, 3.5 from ci - Add 3.6, 3.7, 3.8, 3.9 to ci - Various requirements changes to support current python & fix tests - Fix flake8 errors - Bumped Heroku to python-3.9.2. I tested heroku with 3.6, 3.7, 3.8, 3.9 all with the new slack_update and it worked. Travis is migrating away from travis-ci.org to travis-ci.com and changing how the free tier works. I would support moving away from travis and embracing github actions. But it doesn't hurt anything to run both for now. --- .github/workflows/python-app.yml | 27 +++++++++++++++++++++++++++ .travis.yml | 5 ++--- runtime.txt | 2 +- setup.py | 2 +- tox.ini | 9 ++++++++- will/plugins/productivity/remind.py | 1 - will/requirements/base.txt | 25 +++++++++++++------------ will/requirements/dev.txt | 2 +- will/tests/test_plugin.py | 2 ++ 9 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/python-app.yml mode change 100755 => 100644 setup.py diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 00000000..dd05b523 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,27 @@ +name: Python package + +on: + - push + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install -r will/requirements/dev.txt + pip install tox tox-gh-actions + - name: Test with tox + run: tox \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 5694b3b2..02a3be66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ dist: xenial language: python python: - - '2.7' - - '3.4' - - '3.5' - '3.6' - '3.7' + - '3.8' + - '3.9' sudo: false services: - docker diff --git a/runtime.txt b/runtime.txt index d56a3d02..9a604613 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-2.7.3 \ No newline at end of file +python-3.9.2 \ No newline at end of file diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index 6cdb833c..6b4af517 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ tests_require = [ 'mock', - 'pytest==4.6.6', + 'pytest==6.2.2', 'pytest-cov', 'pytest-runner', 'pytest-mock', diff --git a/tox.ini b/tox.ini index 582d6121..7dcc2e49 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,13 @@ [tox] -envlist = py27, py34, py35, py36, py37 +envlist = py36, py37, py38, py39 +[gh-actions] +python = + 2.7: py27 + 3.6: py36 + 3.7: py37 + 3.8: py38, mypy + 3.9: py39 [testenv] deps = diff --git a/will/plugins/productivity/remind.py b/will/plugins/productivity/remind.py index c43f92c0..b5085450 100644 --- a/will/plugins/productivity/remind.py +++ b/will/plugins/productivity/remind.py @@ -15,7 +15,6 @@ def remind_me_at(self, message, reminder_text=None, remind_time=None, to_string= formatted_to_string = "" formatted_reminder_text = "%(mention_handle)s, you asked me to remind you%(to_string)s %(reminder_text)s" % { "mention_handle": message.sender.mention_handle, - "from_handle": message.sender.handle, "reminder_text": reminder_text, "to_string": formatted_to_string, } diff --git a/will/requirements/base.txt b/will/requirements/base.txt index 69a4f9b9..865bafc9 100644 --- a/will/requirements/base.txt +++ b/will/requirements/base.txt @@ -1,28 +1,29 @@ APScheduler==2.1.2 beautifulsoup4==4.6.0 -bottle==0.12.7 -CherryPy==3.6.0 -clint==0.3.7 -dill==0.2.1 +bottle==0.12.19 +CherryPy==8.9.1 +clint==0.5.1 +dill==0.3.3 dnspython==1.15.0 fuzzywuzzy==0.15.1 Jinja2==2.7.3 -Markdown==2.3.1 +Markdown==3.3.4 MarkupSafe==0.23 # Temporary fork of natural, until python 3 support is merged: https://github.com/tehmaze/natural/pull/13 +# Temporary fork of natural, until python 3 support is merged: https://github.com/tehmaze/natural/pull/13 # natural==0.2.1 will-natural==0.2.1.1 parsedatetime==1.1.2 -python-Levenshtein==0.12.0 +python-Levenshtein==0.12.1 pyasn1-modules==0.0.5 pyasn1==0.1.7 pycrypto==2.6.1 pygerduty==0.28 -pytz==2017.2 -PyYAML==3.13 +pytz==2021.1 +PyYAML==5.4.1 regex==2017.9.23 redis==2.10.6 -requests==2.20.0 -six==1.10.0 -urllib3==1.24.3 -websocket-client==0.44.0 +requests==2.25.0 +six==1.15.0 +urllib3==1.25.10 +websocket-client==0.44.0 \ No newline at end of file diff --git a/will/requirements/dev.txt b/will/requirements/dev.txt index 2cae7f8a..68a2b4cd 100644 --- a/will/requirements/dev.txt +++ b/will/requirements/dev.txt @@ -10,7 +10,7 @@ nose coverage yappi tox -pytest==4.6.6 +pytest==6.2.2 pytest-cov pytest-mock freezegun diff --git a/will/tests/test_plugin.py b/will/tests/test_plugin.py index c5232efa..8f7cef1a 100644 --- a/will/tests/test_plugin.py +++ b/will/tests/test_plugin.py @@ -135,6 +135,8 @@ def test_get_backend_service_as_parameter(message, plugin, io_backend, all_io_ba # freeze_time to mock datetime.datetime.now() method which is invoked # when creating an event or message. # https://github.com/spulec/freezegun + + @freeze_time(WILLS_BIRTHDAY) def test_say_with_room_arg(plugin, content, say_event, source_message, outgoing_topic): room = "test" From 99a2f8b6ba1586218f56396ddb6b29d3920e7102 Mon Sep 17 00:00:00 2001 From: Ron Hudson <3606628+pastorhudson@users.noreply.github.com> Date: Fri, 19 Mar 2021 13:04:51 -0400 Subject: [PATCH 2/5] Removed duplicate comment --- will/requirements/base.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/will/requirements/base.txt b/will/requirements/base.txt index 35fe24dd..9048ae01 100644 --- a/will/requirements/base.txt +++ b/will/requirements/base.txt @@ -10,7 +10,6 @@ Jinja2==2.7.3 Markdown==3.3.4 MarkupSafe==0.23 # Temporary fork of natural, until python 3 support is merged: https://github.com/tehmaze/natural/pull/13 -# Temporary fork of natural, until python 3 support is merged: https://github.com/tehmaze/natural/pull/13 # natural==0.2.1 will-natural==0.2.1.1 parsedatetime==1.1.2 From 4755e1e2b8ed30d0c03c5f9f8ceb41a83cee140a Mon Sep 17 00:00:00 2001 From: Ron Hudson <3606628+pastorhudson@users.noreply.github.com> Date: Fri, 19 Mar 2021 13:06:11 -0400 Subject: [PATCH 3/5] Removed redundant pip installs --- .github/workflows/python-app.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index dd05b523..25532ab8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -20,8 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pip install -r will/requirements/dev.txt - pip install tox tox-gh-actions + pip install tox-gh-actions - name: Test with tox run: tox \ No newline at end of file From af880d5a22ab5b3de55949450e72b4e8497aa4ba Mon Sep 17 00:00:00 2001 From: Ron Hudson <3606628+pastorhudson@users.noreply.github.com> Date: Fri, 19 Mar 2021 22:08:59 -0400 Subject: [PATCH 4/5] - Pin natural to github version - exclude flake8 for natural --- tox.ini | 2 +- will/requirements/base.txt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 7dcc2e49..a50fb8a6 100644 --- a/tox.ini +++ b/tox.ini @@ -16,4 +16,4 @@ deps = -rrequirements.txt commands = python setup.py test - flake8 + flake8 --extend-exclude=./src/natural/* diff --git a/will/requirements/base.txt b/will/requirements/base.txt index 9048ae01..8d35aa80 100644 --- a/will/requirements/base.txt +++ b/will/requirements/base.txt @@ -9,9 +9,10 @@ fuzzywuzzy==0.15.1 Jinja2==2.7.3 Markdown==3.3.4 MarkupSafe==0.23 +# Pin natural to repo since release is not updated +-egit+git://github.com/tehmaze/natural.git#egg=natural # Temporary fork of natural, until python 3 support is merged: https://github.com/tehmaze/natural/pull/13 -# natural==0.2.1 -will-natural==0.2.1.1 +# will-natural==0.2.1.1 parsedatetime==1.1.2 python-Levenshtein==0.12.1 pyasn1-modules==0.0.5 From c6c7e9cc2faceed3f181d14450681fb89bbaf2b6 Mon Sep 17 00:00:00 2001 From: Ron Hudson <3606628+pastorhudson@users.noreply.github.com> Date: Fri, 19 Mar 2021 22:25:40 -0400 Subject: [PATCH 5/5] Pin natural to github commit --- will/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/will/requirements/base.txt b/will/requirements/base.txt index 8d35aa80..50b9fbbf 100644 --- a/will/requirements/base.txt +++ b/will/requirements/base.txt @@ -10,7 +10,7 @@ Jinja2==2.7.3 Markdown==3.3.4 MarkupSafe==0.23 # Pin natural to repo since release is not updated --egit+git://github.com/tehmaze/natural.git#egg=natural +-egit+git://github.com/tehmaze/natural.git@4d41ed6708965420ad884339e0e9ca5f089b2202#egg=natural # Temporary fork of natural, until python 3 support is merged: https://github.com/tehmaze/natural/pull/13 # will-natural==0.2.1.1 parsedatetime==1.1.2