From b2f2f5ad23fe6697254a72d890a4dde375f3a807 Mon Sep 17 00:00:00 2001 From: mbohlool Date: Wed, 23 Nov 2016 13:34:52 -0800 Subject: [PATCH 1/2] Update formatting with scripts/update-pep8.sh --- kubernetes/config/incluster_config.py | 1 + kubernetes/config/incluster_config_test.py | 4 ++-- scripts/preprocess_spec.py | 1 - scripts/update-pep8.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kubernetes/config/incluster_config.py b/kubernetes/config/incluster_config.py index d0b21afd3..b4cc3c99d 100644 --- a/kubernetes/config/incluster_config.py +++ b/kubernetes/config/incluster_config.py @@ -36,6 +36,7 @@ class ConfigException(Exception): class InClusterConfigLoader(object): + def __init__(self, host_env_name, port_env_name, token_filename, cert_filename, environ=os.environ): self._host_env_name = host_env_name diff --git a/kubernetes/config/incluster_config_test.py b/kubernetes/config/incluster_config_test.py index e69f7d4d8..7f7405e4f 100644 --- a/kubernetes/config/incluster_config_test.py +++ b/kubernetes/config/incluster_config_test.py @@ -18,8 +18,8 @@ import unittest from kubernetes.client import configuration -from .incluster_config import (ConfigException, InClusterConfigLoader, - _SERVICE_HOST_ENV_NAME, _SERVICE_PORT_ENV_NAME) +from .incluster_config import (_SERVICE_HOST_ENV_NAME, _SERVICE_PORT_ENV_NAME, + ConfigException, InClusterConfigLoader) _TEST_TOKEN = "temp_token" _TEST_HOST = "127.0.0.1" diff --git a/scripts/preprocess_spec.py b/scripts/preprocess_spec.py index 8dc6226ca..bf8d9509d 100644 --- a/scripts/preprocess_spec.py +++ b/scripts/preprocess_spec.py @@ -18,7 +18,6 @@ import os.path import sys from collections import OrderedDict - # these four constants are shown as part of this example in []: # "[watch]Pod[List]" is the deprecated version of "[list]Pod?[watch]=True" WATCH_OP_PREFIX = "watch" diff --git a/scripts/update-pep8.sh b/scripts/update-pep8.sh index a12d8bedf..8b3b35a79 100755 --- a/scripts/update-pep8.sh +++ b/scripts/update-pep8.sh @@ -46,7 +46,7 @@ SAVEIFS=$IFS trap "IFS=$SAVEIFS" EXIT SIGINT IFS=, -SOURCES="${CLIENT_ROOT}/util/*.py,${SCRIPT_ROOT}/*.py,${CLIENT_ROOT}/examples/*.py" +SOURCES="${SCRIPT_ROOT}/../setup.py,${CLIENT_ROOT}/config/*.py,${CLIENT_ROOT}/watch/*.py,${SCRIPT_ROOT}/*.py,${CLIENT_ROOT}/../examples/*.py" echo "--- Updating tools" pip install --upgrade pep8 From f6e417df603f4c755376a1d32c31cc3fd73ed8fc Mon Sep 17 00:00:00 2001 From: mbohlool Date: Wed, 23 Nov 2016 13:36:33 -0800 Subject: [PATCH 2/2] Add ipaddress as a dependency. urllib3 will fix ssl ipaddress hostnames if this package exists --- requirements.txt | 1 + setup.py | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 11f73df26..49d541add 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ setuptools >= 21.0.0 urllib3 >= 1.19.1 pyyaml >= 3.12 oauth2client >= 4.0.0 +ipaddress >= 1.0.17 diff --git a/setup.py b/setup.py index b44abed29..0fa6de8d5 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,8 @@ # limitations under the License. import sys -from setuptools import setup, find_packages + +from setuptools import find_packages, setup NAME = "kubernetes" VERSION = "1.0.0-alpha.1" @@ -25,7 +26,14 @@ VERSION = "1.0.0-alpha.1" # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.19", "six >= 1.10", "certifi", "python-dateutil", "pyyaml", "oauth2client"] +REQUIRES = [ + "urllib3 >= 1.19", + "six >= 1.10", + "certifi", + "python-dateutil", + "pyyaml", + "oauth2client", + "ipaddress"] setup( name=NAME, @@ -38,7 +46,7 @@ setup( keywords=["Swagger", "OpenAPI", "Kubernetes"], install_requires=REQUIRES, packages=['kubernetes', 'kubernetes.client', 'kubernetes.config', - 'kubernetes.watch', 'kubernetes.client.apis', + 'kubernetes.watch', 'kubernetes.client.apis', 'kubernetes.client.models'], include_package_data=True, long_description="""\