Skip to content

Commit 4ebca4b

Browse files
author
Francesco Faraone
authored
Merge pull request #40 from cloudblue/bump_markdown_renderer_and_drop_py36_support
bump markdown renderer to 2.0 and drop support for python 3.6
2 parents 1567581 + 821b2ae commit 4ebca4b

File tree

6 files changed

+245
-320
lines changed

6 files changed

+245
-320
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
17+
python-version: ['3.7', '3.8', '3.9', '3.10']
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v2

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Python
1313
uses: actions/setup-python@v2
1414
with:
15-
python-version: '3.x'
15+
python-version: '3.10'
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ play with the CloudBlue Connect API using a python REPL like [jupyter](https://j
1717

1818
## Install
1919

20-
`Connect Python OpenAPI Client` requires python 3.6 or later and has the following dependencies:
20+
`Connect Python OpenAPI Client` requires python 3.7 or later.
2121

22-
* connect-markdown-renderer>=1,<2
23-
* pyyaml>=5,<6
24-
* requests>=2,<3
2522

2623
`Connect Python OpenAPI Client` can be installed from [pypi.org](https://pypi.org/project/connect-openapi-client/) using pip:
2724

connect/client/help_formatter.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,19 @@
55
#
66
import inflect
77

8-
from cmr import render
9-
10-
from connect.client.models import Action, Collection, NS, Resource, ResourceSet
8+
from connect.client.models import (
9+
Action,
10+
AsyncAction,
11+
AsyncCollection,
12+
AsyncNS,
13+
AsyncResource,
14+
AsyncResourceSet,
15+
Collection,
16+
NS,
17+
Resource,
18+
ResourceSet,
19+
)
20+
from connect.utils.terminal.markdown import render
1121

1222

1323
_COL_HTTP_METHOD_TO_METHOD = {
@@ -186,19 +196,19 @@ def format(self, obj):
186196
if not self._specs:
187197
return render('**No OpenAPI specs available.**')
188198

189-
if isinstance(obj, NS):
199+
if isinstance(obj, (NS, AsyncNS)):
190200
return self.format_ns(obj)
191201

192-
if isinstance(obj, Collection):
202+
if isinstance(obj, (Collection, AsyncCollection)):
193203
return self.format_collection(obj)
194204

195-
if isinstance(obj, Resource):
205+
if isinstance(obj, (Resource, AsyncResource)):
196206
return self.format_resource(obj)
197207

198-
if isinstance(obj, Action):
208+
if isinstance(obj, (Action, AsyncAction)):
199209
return self.format_action(obj)
200210

201-
if isinstance(obj, ResourceSet):
211+
if isinstance(obj, (ResourceSet, AsyncResourceSet)):
202212
return self.format_resource_set(obj)
203213

204214
return self.format_client()

0 commit comments

Comments
 (0)