Generate client and remove tests directory

This commit is contained in:
Scott Lee 2020-07-29 23:08:23 -07:00
parent 442ebc0190
commit 3e57e12757
14 changed files with 155 additions and 51 deletions

33
kubernetes/.gitlab-ci.yml Normal file
View File

@ -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

View File

@ -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.

View File

@ -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

24
kubernetes/__init__.py-e Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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
)

View File

@ -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):

2
kubernetes/setup.cfg Normal file
View File

@ -0,0 +1,2 @@
[flake8]
max-line-length=99

View File

@ -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)

View File

@ -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"

View File

@ -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"

83
setup.py-e Normal file
View File

@ -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",
],
)