File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11sudo : required
2- language : generic
2+ language : python
3+ python :
4+ - " 3.6"
35services :
46 - docker
57env :
911script :
1012 - ./ci/run_tests_in_docker.sh $PYTHON_IMAGE
1113
12- deploy :
13- provider : pypi
14- user : " $TWINE_USER"
15- password : " $TWINE_PASSWORD"
16- distributions : " sdist bdist_wheel"
17- on :
18- tags : true
14+ jobs :
15+ include :
16+ - stage : deploy
17+ skript : skip
18+ deploy :
19+ provider : pypi
20+ user : " $TWINE_USER"
21+ password : " $TWINE_PASSWORD"
22+ distributions : " sdist bdist_wheel"
23+ on :
24+ tags : true
Original file line number Diff line number Diff line change 11import enum
22import typing
3+ import collections
34
45
56Stream = typing .AsyncIterator
@@ -43,14 +44,16 @@ def response_type(self):
4344
4445 @staticmethod
4546 def from_annotations (request_annotation , response_annotation ):
46- if issubclass (request_annotation , Stream ):
47+ if (hasattr (request_annotation , "__origin__" ) and
48+ issubclass (request_annotation .__origin__ , collections .abc .AsyncIterator )):
4749 request_type = request_annotation .__args__ [0 ]
4850 request_stream = True
4951 else :
5052 request_type = request_annotation
5153 request_stream = False
5254
53- if issubclass (response_annotation , Stream ):
55+ if (hasattr (response_annotation , "__origin__" ) and
56+ issubclass (response_annotation .__origin__ , collections .abc .AsyncIterator )):
5457 response_type = response_annotation .__args__ [0 ]
5558 response_stream = True
5659 else :
You can’t perform that action at this time.
0 commit comments