8000 Rename parameter async into async_req to support Python 3.7 by roycaihw · Pull Request #568 · kubernetes-client/python · GitHub
[go: up one dir, main page]

Skip to content

Rename parameter async into async_req to support Python 3.7 #568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# v7.0.0a1
**NOTE:**
- We are doing an Alpha release for v7.0.0 because there will be an **ACTION REQUIRED** API breaking change in this client to support Python 3.7, which substitutes the currently being-used `async` reserved keyword [kubernetes-client/gen#67](https://github.com/kubernetes-client/gen/pull/67)
**Breaking Change:**
- **ACTION REQUIRED** Rename the currently being-used `async` parameter to `async_req` to support Python 3.7 because it's a reserved keyword in Python 3.7 [kubernetes-client/gen#67](https://github.com/kubernetes-client/gen/pull/67)

**Bug Fix:**
- Watch now properly deserializes custom resource objects and updates resource version [kubernetes-client/python-base#64](https://github.com/kubernetes-client/python-base/pull/64)
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ supported versions of Kubernetes clusters.

#### Compatibility matrix

| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | Kubernetes 1.10 |
|--------------------|----------------|----------------|----------------|----------------|----------------|----------------|-----------------|
| client-python 1.0 | + | ✓ | - | - |- |- | |
| client-python 2.0 | + | + | ✓ | - |- |- | |
| client-python 3.0 | + | + | + | ✓ |- |- | |
| client-python 4.0 | + | + | + | + |✓ |- | |
| client-python 5.0 | + | + | + | + |+ |✓ | |
| client-python 6.0 | + | + | + | + |+ |+ |✓ |
| client-python HEAD | + | + | + | + |+ |+ |✓ |
| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | Kubernetes 1.10 | Kubernetes 1.11 |
|--------------------|----------------|----------------|----------------|----------------|----------------|----------------|-----------------|-----------------|
| client-python 1.0 | + | ✓ | - | - |- |- | | |
| client-python 2.0 | + | + | ✓ | - |- |- | | |
| client-python 3.0 | + | + | + | ✓ |- |- | | |
| client-python 4.0 | + | + | + | + |✓ |- | | |
| client-python 5.0 | + | + | + | + |+ |✓ | | |
| client-python 6.0 | + | + | + | + |+ |+ |✓ | |
| client-python 7.0 | + | + | + | + |+ |+ |+ |✓ |
| client-python HEAD | + | + | + | + |+ |+ |+ |✓ |

Key:

Expand Down Expand Up @@ -119,6 +120,7 @@ between client-python versions.
| 5.0 | Kubernetes main repo, 1.9 branch | ✓ |
| 6.0 Alpha/Beta | Kubernetes main repo, 1.10 branch | ✗ |
| 6.0 | Kubernetes main repo, 1.10 branch | ✓ |
| 7.0 Alpha/Beta | Kubernetes main repo, 1.11 branch | ✓ |


Key:
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def __deserialize(self, data, klass):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True,
_request_timeout=None):
"""
Expand All @@ -298,7 +298,7 @@ def call_api(self, resource_path, method,
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param async bool: execute request asynchronously
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code and headers
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
Expand All @@ -313,7 +313,7 @@ def call_api(self, resource_path, method,
If parameter async is False or missing,
then the method will return the response directly.
"""
if not async:
if not async_req:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
Expand Down
18 changes: 9 additions & 9 deletions kubernetes/client/apis/admissionregistration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def get_api_group(self, **kwargs):
"""
get information of a group
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_api_group(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_group(async_req=True)
>>> result = thread.get()

:param async bool
:param async_req bool
:return: V1APIGroup
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_api_group_with_http_info(**kwargs)
else:
(data) = self.get_api_group_with_http_info(**kwargs)
Expand All @@ -59,18 +59,18 @@ def get_api_group_with_http_info(self, **kwargs):
"""
get information of a group
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_api_group_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_group_with_http_info(async_req=True)
>>> result = thread.get()

:param async bool
:param async_req bool
:return: V1APIGroup
If the method is called asynchronously,
returns the request thread.
"""

all_params = []
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
Expand Down Expand Up @@ -117,7 +117,7 @@ def get_api_group_with_http_info(self, **kwargs):
files=local_var_files,
response_type='V1APIGroup',
auth_settings=auth_settings,
async=params.get('async'),
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
Expand Down
Loading
0