Skip to content

Commit

Permalink
- Fix travis-ci
Browse files Browse the repository at this point in the history
- Add github actions ci
- Remove 2.7, 3.5 from ci skoczen#417
- 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.
  • Loading branch information
pastorhudson committed Mar 19, 2021
1 parent f45f189 commit e24e4c5
Show file tree
Hide file tree
Showing 9 changed files with 389 additions and 54 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 21 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
dist: xenial
language: python
python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
sudo: false
cache: pip

services:
- docker
- docker
before_install:
- sudo apt-get update
- sudo apt-get install -y libffi-dev libxml2-dev
install:
- pip install -U tox
- pip install -r will/requirements/dev.txt
- pip install tox-travis
- pip install -r will/requirements/dev.txt
script:
- tox

matrix:
include:
# - python: 2.7
# env: TOXENV=py27
# - python: 3.4
# env: TOXENV=py34
# - python: 3.5
# env: TOXENV=py35
# - python: 3.6
# env: TOXENV=py36
# - python: 3.7
# dist: xenial
# sudo: required
# env: TOXENV=py37
- python: 3.9.1
env: TOXENV=py39
- tox
- export CTAG="-$TRAVIS_COMMIT"
# - "fab docker_build"
# deploy:
# skip_cleanup: true
# provider: script
# script: "fab docker_deploy"
# on:
# branch: master
env:
matrix:
secure: SWBr2Ih6+vT0iX5CxqPT8ICmtFUcIk7MRfh21DnsGKpumz60mgRPnb+aMxagSDWrF0btGyI3vfD8nYEv6Vv+WDDCbeJCG3xExsIusiflaM1Vqo1OcUGlO55jQm1WtNub7SmiMSH8EY5GFFNfFn7CmSmU1xaM0p5q8Y0OTbZpku8=
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9.1
python-3.9.2
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@


tests_require = [
'pytest==3.8.1',
'mock',
'pytest==6.2.2',
'pytest-cov',
'pytest-runner',
'mock'
'pytest-mock',
'freezegun'
]

setup_requires = []
Expand Down Expand Up @@ -89,11 +91,10 @@
"Framework :: Robot Framework",
"Framework :: Robot Framework :: Library",
"Framework :: Robot Framework :: Tool",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
entry_points={
'console_scripts': ['generate_will_project = will.scripts.generate_will_project:main'],
},

)
)
18 changes: 11 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
[tox]
envlist = 36, flake8
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]
commands =
python setup.py test
deps =
flake8
sleekxmpp==1.3.2
-r requirements.txt

[testenv:flake8]
-rrequirements.txt
commands =
flake8
python setup.py test
flake8
7 changes: 3 additions & 4 deletions will/plugins/productivity/remind.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class RemindPlugin(WillPlugin):

@respond_to("(?:can |will you )?remind me(?P<to_string> to)? (?P<reminder_text>.*?) (at|on|in) (?P<remind_time>.*)?\??")
@respond_to(r"(?:can |will you )?remind me(?P<to_string> to)? (?P<reminder_text>.*?) (at|on|in) (?P<remind_time>.*)?\??")
def remind_me_at(self, message, reminder_text=None, remind_time=None, to_string=""):
"""remind me to ___ at ___: Set a reminder for a thing, at a time."""
parsed_time = self.parse_natural_time(remind_time)
Expand All @@ -15,14 +15,13 @@ 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,
}
self.schedule_say(formatted_reminder_text, parsed_time, message=message, notify=True)
self.say("%(reminder_text)s %(natural_datetime)s. Got it." % locals(), message=message)

@respond_to("(?:can|will you )?remind (?P<reminder_recipient>(?!me).*?)(?P<to_string> to>) ?(?P<reminder_text>.*?) (at|on|in) (?P<remind_time>.*)?\??")
@respond_to(r"(?:can|will you )?remind (?P<reminder_recipient>(?!me).*?)(?P<to_string> to>) ?(?P<reminder_text>.*?) (at|on|in) (?P<remind_time>.*)?\??")
def remind_somebody_at(self, message, reminder_recipient=None, reminder_text=None, remind_time=None, to_string=""):
"""remind ___ to ___ at ___: Set a reminder for a thing, at a time for somebody else."""
parsed_time = self.parse_natural_time(remind_time)
Expand All @@ -40,4 +39,4 @@ def remind_somebody_at(self, message, reminder_recipient=None, reminder_text=Non
}

self.schedule_say(formatted_reminder_text, parsed_time, message=message, notify=True)
self.say("%(reminder_text)s %(natural_datetime)s. Got it." % locals(), message=message)
self.say("%(reminder_text)s %(natural_datetime)s. Got it." % locals(), message=message)
29 changes: 14 additions & 15 deletions will/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
APScheduler==2.1.2
beautifulsoup4==4.6.0
bottle==0.12.19
cherrypy>=3.0.8,<9.0.0
clint==0.3.7
dill==0.2.1
CherryPy==8.9.1
clint==0.5.1
dill==0.3.3
dnspython==1.15.0
fuzzywuzzy==0.15.1
Jinja2>=2.10.1
Markdown==3.3.3
Jinja2==2.7.3
Markdown==3.3.4
MarkupSafe==0.23
more-itertools==5.0.0
# 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.1
pyasn1-modules>=0.0.5,<=0.1.5
pyasn1>=0.1.8,<=0.3.7
pyasn1-modules==0.0.5
pyasn1==0.1.7
pycrypto==2.6.1
pygerduty==0.28
pytz==2017.2
# Moved to 3.13 for python 3.7
PyYAML==5.1
pytz==2021.1
PyYAML==5.4.1
regex==2017.9.23
redis==2.10.6
requests>=2.21.0
six==1.10.0
websocket-client==0.44.0

requests==2.25.0
six==1.15.0
urllib3==1.25.10
websocket-client==0.44.0
4 changes: 4 additions & 0 deletions will/requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ nose
coverage
yappi
tox
pytest==6.2.2
pytest-cov
pytest-mock
freezegun

# Using this fork because it has all the Planning Center Endpoints
-e git://github.com/pastorhudson/pypco.git#egg=pypco
Loading

0 comments on commit e24e4c5

Please sign in to comment.