Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mahenzon committed Feb 24, 2021
2 parents c8c102a + 6faa492 commit f87b2e2
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 36 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ jobs:
unit-tests:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions aioalice/types/alice_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
class AliceRequest(AliceObject):
"""AliceRequest is a request from Alice API"""
original_request = attrib(type=WebRequest)
meta = attrib(convert=ensure_cls(Meta))
request = attrib(convert=ensure_cls(Request))
session = attrib(convert=ensure_cls(Session))
meta = attrib(converter=ensure_cls(Meta))
request = attrib(converter=ensure_cls(Request))
session = attrib(converter=ensure_cls(Session))
version = attrib(type=str)

def _response(self, response):
Expand Down
4 changes: 2 additions & 2 deletions aioalice/types/alice_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
class AliceResponse(AliceObject):
"""AliceResponse is a response to Alice API"""

response = attrib(convert=ensure_cls(Response))
session = attrib(convert=ensure_cls(BaseSession))
response = attrib(converter=ensure_cls(Response))
session = attrib(converter=ensure_cls(BaseSession))
version = attrib(type=str)
8 changes: 4 additions & 4 deletions aioalice/types/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class Card(AliceObject):
image_id = attrib(default=None, type=str)
title = attrib(default=None, type=str)
description = attrib(default=None, type=str)
button = attrib(default=None, convert=ensure_cls(MediaButton))
button = attrib(default=None, converter=ensure_cls(MediaButton))

# for ItemsList
header = attrib(default=None, convert=ensure_cls(CardHeader))
items = attrib(default=None, convert=ensure_cls(Image)) # List of Image objects
header = attrib(default=None, converter=ensure_cls(CardHeader))
items = attrib(default=None, converter=ensure_cls(Image)) # List of Image objects

footer = attrib(default=None, convert=ensure_cls(CardFooter))
footer = attrib(default=None, converter=ensure_cls(CardFooter))

@type.validator
def check(self, attribute, value):
Expand Down
2 changes: 1 addition & 1 deletion aioalice/types/card_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
class CardFooter(AliceObject):
"""This object represents a card's footer"""
text = attrib(type=str)
button = attrib(default=None, convert=ensure_cls(MediaButton))
button = attrib(default=None, converter=ensure_cls(MediaButton))
2 changes: 1 addition & 1 deletion aioalice/types/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Entity(AliceObject):
"""Entity object"""
type = attrib(type=str)
tokens = attrib(convert=ensure_cls(EntityTokens))
tokens = attrib(converter=ensure_cls(EntityTokens))
value = attrib(factory=dict)

@type.validator
Expand Down
2 changes: 1 addition & 1 deletion aioalice/types/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class Image(AliceObject):
image_id = attrib(type=str)
title = attrib(type=str)
description = attrib(type=str)
button = attrib(default=None, convert=ensure_cls(MediaButton))
button = attrib(default=None, converter=ensure_cls(MediaButton))
2 changes: 1 addition & 1 deletion aioalice/types/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ class Meta(AliceObject):
locale = attrib(type=str)
timezone = attrib(type=str)
client_id = attrib(type=str)
interfaces = attrib(default=None, convert=ensure_cls(Interfaces))
interfaces = attrib(default=None, converter=ensure_cls(Interfaces))
flags = attrib(factory=list)
2 changes: 1 addition & 1 deletion aioalice/types/natural_language_understanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
class NaturalLanguageUnderstanding(AliceObject):
"""Natural Language Understanding object"""
tokens = attrib(factory=list)
entities = attrib(factory=list, convert=ensure_cls(Entity))
entities = attrib(factory=list, converter=ensure_cls(Entity))
2 changes: 1 addition & 1 deletion aioalice/types/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Request(AliceObject):
original_utterance = attrib(default='', type=str) # Can be none if payload passed
markup = attrib(default=None)
payload = attrib(default=None)
nlu = attrib(default=None, convert=ensure_cls(NaturalLanguageUnderstanding))
nlu = attrib(default=None, converter=ensure_cls(NaturalLanguageUnderstanding))

@type.validator
def check(self, attribute, value):
Expand Down
4 changes: 2 additions & 2 deletions aioalice/types/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class Response(AliceObject):

text = attrib(type=str)
tts = attrib(default=None, type=str)
card = attrib(default=None, convert=ensure_cls(Card))
buttons = attrib(default=None, convert=ensure_cls(Button))
card = attrib(default=None, converter=ensure_cls(Card))
buttons = attrib(default=None, converter=ensure_cls(Button))
end_session = attrib(default=False, type=bool)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aiohttp>=3.3.2
attrs==18.1.0
attrs==20.3.0
19 changes: 4 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,9 @@ def get_description():
return f.read()


def get_requirements(filename=None):
"""
Read requirements from 'requirements.txt'
:return: requirements
:rtype: list
"""
if filename is None:
filename = 'requirements.txt'

file = WORK_DIR / filename

install_reqs = parse_requirements(str(file), session='hack')
return [str(ir.req) for ir in install_reqs]
requirements_filepath = WORK_DIR / "requirements.txt"
with open(requirements_filepath) as fp:
install_requires = fp.read()


setup(
Expand All @@ -68,5 +57,5 @@ def get_requirements(filename=None):
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries :: Application Frameworks',
],
install_requires=get_requirements()
install_requires=install_requires,
)

0 comments on commit f87b2e2

Please sign in to comment.