diff --git a/polyaxon_client/api_config.py b/polyaxon_client/api_config.py index e519ea0869..55a84369a8 100644 --- a/polyaxon_client/api_config.py +++ b/polyaxon_client/api_config.py @@ -14,6 +14,7 @@ class ApiConfig(object): def __init__(self, host=None, + port=None, http_port=None, ws_port=None, token=None, @@ -39,10 +40,15 @@ def __init__(self, raise PolyaxonClientException( 'Api config requires at least a host if not running in-cluster.') - self.http_port = http_port or settings.HTTP_PORT or (settings.DEFAULT_HTTPS_PORT - if self.use_https - else settings.DEFAULT_HTTP_PORT) - self.ws_port = ws_port or settings.WS_PORT or self.http_port + self.port = port + if port: + self.http_port = port + self.ws_port = port + else: + self.http_port = http_port or settings.HTTP_PORT or (settings.DEFAULT_HTTPS_PORT + if self.use_https + else settings.DEFAULT_HTTP_PORT) + self.ws_port = ws_port or settings.WS_PORT or self.http_port self.version = version or settings.API_VERSION self.internal_header = None diff --git a/polyaxon_client/client.py b/polyaxon_client/client.py index 9cac2009cd..db33b7fbaa 100644 --- a/polyaxon_client/client.py +++ b/polyaxon_client/client.py @@ -26,6 +26,7 @@ def __init__(self, api_config=None, host=None, token=None, + port=None, http_port=None, ws_port=None, use_https=False, @@ -38,6 +39,7 @@ def __init__(self, timeout=None): self._api_config = api_config or ApiConfig(host=host, + port=port, http_port=http_port, ws_port=ws_port, token=token, diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index af75bb021c..c928e82b34 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -1,3 +1,3 @@ -r requirements-base.txt --e git+https://github.com/polyaxon/polyaxon-schemas.git@master#egg=polyaxon-schemas==0.5.0rc2 +-e git+https://github.com/polyaxon/polyaxon-schemas.git@master#egg=polyaxon-schemas==0.5.0rc5 diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 16ed82d0ff..5b90e52043 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,3 +1,3 @@ -r requirements-base.txt -polyaxon-schemas==0.5.0rc2 +polyaxon-schemas==0.5.0rc5 diff --git a/setup.py b/setup.py index 7ca5af0b58..9295267972 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def run_tests(self): setup(name='polyaxon-client', - version='0.5.0rc2', + version='0.5.0rc5', description='Python client to interact with Polyaxon API.', long_description=read_readme(), long_description_content_type="text/markdown", @@ -55,7 +55,7 @@ def run_tests(self): 'kubernetes', ], install_requires=[ - "polyaxon-schemas==0.5.0rc2", + "polyaxon-schemas==0.5.0rc5", "polystores>=0.1.9", "psutil==5.4.7", "requests>=2.20.0",