SDK - Added version (#2374)
This commit is contained in:
parent
7b6957ae06
commit
8025511c30
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -38,9 +40,24 @@ REQUIRES = [
|
|||
'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,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
import unittest
|
||||
|
||||
class KfpTestCase(unittest.TestCase):
|
||||
def test_kfp_version(self):
|
||||
import kfp
|
||||
self.assertTrue(len(kfp.__version__) > 0)
|
||||
Loading…
Reference in New Issue