diff --git a/kubernetes/.gitlab-ci.yml b/kubernetes/.gitlab-ci.yml new file mode 100644 index 000000000..3c5125d39 --- /dev/null +++ b/kubernetes/.gitlab-ci.yml @@ -0,0 +1,33 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.nosetest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=client + +nosetest-2.7: + extends: .nosetest + image: python:2.7-alpine +nosetest-3.3: + extends: .nosetest + image: python:3.3-alpine +nosetest-3.4: + extends: .nosetest + image: python:3.4-alpine +nosetest-3.5: + extends: .nosetest + image: python:3.5-alpine +nosetest-3.6: + extends: .nosetest + image: python:3.6-alpine +nosetest-3.7: + extends: .nosetest + image: python:3.7-alpine +nosetest-3.8: + extends: .nosetest + image: python:3.8-alpine diff --git a/kubernetes/README.md b/kubernetes/README.md index 1ca0c3b5e..1305f5814 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: release-1.16 -- Package version: 12.0.0-snapshot +- Package version: 12.0.0a1 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/kubernetes/__init__.py b/kubernetes/__init__.py index 3cd12e801..cc1742a33 100644 --- a/kubernetes/__init__.py +++ b/kubernetes/__init__.py @@ -14,7 +14,7 @@ __project__ = 'kubernetes' # The version is auto-updated. Please do not edit. -__version__ = "12.0.0-snapshot" +__version__ = "12.0.0a1" import kubernetes.client import kubernetes.config diff --git a/kubernetes/__init__.py-e b/kubernetes/__init__.py-e new file mode 100644 index 000000000..3cd12e801 --- /dev/null +++ b/kubernetes/__init__.py-e @@ -0,0 +1,24 @@ +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__project__ = 'kubernetes' +# The version is auto-updated. Please do not edit. +__version__ = "12.0.0-snapshot" + +import kubernetes.client +import kubernetes.config +import kubernetes.dynamic +import kubernetes.watch +import kubernetes.stream +import kubernetes.utils diff --git a/kubernetes/client/__init__.py b/kubernetes/client/__init__.py index 3159d9534..7d9b48d4f 100644 --- a/kubernetes/client/__init__.py +++ b/kubernetes/client/__init__.py @@ -14,7 +14,7 @@ from __future__ import absolute_import -__version__ = "12.0.0-snapshot" +__version__ = "12.0.0a1" # import apis into sdk package from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi diff --git a/kubernetes/client/api/custom_objects_api.py b/kubernetes/client/api/custom_objects_api.py index 1186b0a0f..00ba8e206 100644 --- a/kubernetes/client/api/custom_objects_api.py +++ b/kubernetes/client/api/custom_objects_api.py @@ -2405,7 +2405,7 @@ class CustomObjectsApi(object): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/merge-patch+json']) # noqa: E501 + ['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -2574,7 +2574,7 @@ class CustomObjectsApi(object): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/merge-patch+json']) # noqa: E501 + ['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -2743,7 +2743,7 @@ class CustomObjectsApi(object): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/merge-patch+json']) # noqa: E501 + ['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -2921,7 +2921,7 @@ class CustomObjectsApi(object): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/merge-patch+json']) # noqa: E501 + ['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -3099,7 +3099,7 @@ class CustomObjectsApi(object): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/merge-patch+json']) # noqa: E501 + ['application/json-patch+json', 'application/merge-patch+json', 'application/apply-patch+yaml']) # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -3277,7 +3277,7 @@ class CustomObjectsApi(object): # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/merge-patch+json']) # noqa: E501 + ['application/json-patch+json', 'application/merge-patch+json', 'application/apply-patch+yaml']) # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 diff --git a/kubernetes/client/api_client.py b/kubernetes/client/api_client.py index ef56f4eb7..814869383 100644 --- a/kubernetes/client/api_client.py +++ b/kubernetes/client/api_client.py @@ -78,7 +78,7 @@ class ApiClient(object): self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/12.0.0-snapshot/python' + self.user_agent = 'OpenAPI-Generator/12.0.0a1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/kubernetes/client/apis/__init__.py b/kubernetes/client/apis/__init__.py deleted file mode 100644 index ca4b321de..000000000 --- a/kubernetes/client/apis/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -from __future__ import absolute_import -import warnings - -# flake8: noqa - -# alias kubernetes.client.api package and print deprecation warning -from kubernetes.client.api import * - -warnings.filterwarnings('default', module='kubernetes.client.apis') -warnings.warn( - "The package kubernetes.client.apis is renamed and deprecated, use kubernetes.client.api instead (please note that the trailing s was removed).", - DeprecationWarning -) diff --git a/kubernetes/client/configuration.py b/kubernetes/client/configuration.py index ac926fc09..e87e18f62 100644 --- a/kubernetes/client/configuration.py +++ b/kubernetes/client/configuration.py @@ -347,7 +347,7 @@ class Configuration(object): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: release-1.16\n"\ - "SDK Package Version: 12.0.0-snapshot".\ + "SDK Package Version: 12.0.0a1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/kubernetes/setup.cfg b/kubernetes/setup.cfg new file mode 100644 index 000000000..11433ee87 --- /dev/null +++ b/kubernetes/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/kubernetes/test/test_api_client.py b/kubernetes/test/test_api_client.py deleted file mode 100644 index f0a9416cf..000000000 --- a/kubernetes/test/test_api_client.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding: utf-8 - - -import atexit -import weakref -import unittest - -import kubernetes - - -class TestApiClient(unittest.TestCase): - - def test_context_manager_closes_threadpool(self): - with kubernetes.client.ApiClient() as client: - self.assertIsNotNone(client.pool) - pool_ref = weakref.ref(client._pool) - self.assertIsNotNone(pool_ref()) - self.assertIsNone(pool_ref()) - - def test_atexit_closes_threadpool(self): - client = kubernetes.client.ApiClient() - self.assertIsNotNone(client.pool) - self.assertIsNotNone(client._pool) - atexit._run_exitfuncs() - self.assertIsNone(client._pool) diff --git a/scripts/constants.py b/scripts/constants.py index 18b68ea62..b19d17105 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -18,7 +18,7 @@ import sys KUBERNETES_BRANCH = "release-1.16" # client version for packaging and releasing. -CLIENT_VERSION = "12.0.0-snapshot" +CLIENT_VERSION = "12.0.0a1" # Name of the release package PACKAGE_NAME = "kubernetes" diff --git a/setup.py b/setup.py index 22ec5b69a..e55c3ea76 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ from setuptools import setup # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -CLIENT_VERSION = "12.0.0-snapshot" +CLIENT_VERSION = "12.0.0a1" PACKAGE_NAME = "kubernetes" DEVELOPMENT_STATUS = "3 - Alpha" diff --git a/setup.py-e b/setup.py-e new file mode 100644 index 000000000..e55c3ea76 --- /dev/null +++ b/setup.py-e @@ -0,0 +1,83 @@ +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from setuptools import setup + +# Do not edit these constants. They will be updated automatically +# by scripts/update-client.sh. +CLIENT_VERSION = "12.0.0a1" +PACKAGE_NAME = "kubernetes" +DEVELOPMENT_STATUS = "3 - Alpha" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +EXTRAS = { + 'adal': ['adal>=1.0.2'] +} +REQUIRES = [] +with open('requirements.txt') as f: + for line in f: + line, _, _ = line.partition('#') + line = line.strip() + if ';' in line: + requirement, _, specifier = line.partition(';') + for_specifier = EXTRAS.setdefault(':{}'.format(specifier), []) + for_specifier.append(requirement) + else: + REQUIRES.append(line) + +with open('test-requirements.txt') as f: + TESTS_REQUIRES = f.readlines() + +setup( + name=PACKAGE_NAME, + version=CLIENT_VERSION, + description="Kubernetes python client", + author_email="", + author="Kubernetes", + license="Apache License Version 2.0", + url="https://github.com/kubernetes-client/python", + keywords=["Swagger", "OpenAPI", "Kubernetes"], + install_requires=REQUIRES, + tests_require=TESTS_REQUIRES, + extras_require=EXTRAS, + packages=['kubernetes', 'kubernetes.client', 'kubernetes.config', + 'kubernetes.watch', 'kubernetes.client.api', + 'kubernetes.stream', 'kubernetes.client.models', + 'kubernetes.utils', 'kubernetes.client.apis', + 'kubernetes.dynamic'], + include_package_data=True, + long_description="Python client for kubernetes http://kubernetes.io/", + classifiers=[ + "Development Status :: %s" % DEVELOPMENT_STATUS, + "Topic :: Utilities", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + ], +)