Skip to content

Commit

Permalink
SDK - Added version (#2374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark-kun authored and k8s-ci-robot committed Oct 14, 2019
1 parent 7b6957a commit 8025511
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sdk/python/kfp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '0.1.31.2'

from . import components
from . import containers
from . import dsl
Expand Down
21 changes: 19 additions & 2 deletions sdk/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import re
from setuptools import setup

NAME = 'kfp'
VERSION = '0.1.31'
#VERSION = .... Change the version in kfp/__init__.py

REQUIRES = [
'urllib3>=1.15,<1.25', #Fixing the version conflict with the "requests" package
Expand All @@ -38,9 +40,24 @@
'Deprecated',
]

def find_version(*file_path_parts):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, *file_path_parts), 'r') as fp:
version_file_text = fp.read()

version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file_text,
re.M,
)
if version_match:
return version_match.group(1)

raise RuntimeError("Unable to find version string.")

setup(
name=NAME,
version=VERSION,
version=find_version("kfp", "__init__.py"),
description='KubeFlow Pipelines SDK',
author='google',
install_requires=REQUIRES,
Expand Down
6 changes: 6 additions & 0 deletions sdk/python/tests/test_kfp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import unittest

class KfpTestCase(unittest.TestCase):
def test_kfp_version(self):
import kfp
self.assertTrue(len(kfp.__version__) > 0)

0 comments on commit 8025511

Please sign in to comment.