diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a187625d5a7..96a01e35e89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,8 +38,8 @@ repos: - id: isort name: isort entry: isort --profile google - - repo: https://github.com/pre-commit/mirrors-yapf - rev: "v0.32.0" + - repo: https://github.com/google/yapf + rev: "v0.43.0" hooks: - id: yapf - repo: https://github.com/pycqa/docformatter diff --git a/api/v2alpha1/python/LICENSE b/api/v2alpha1/python/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/api/v2alpha1/python/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/api/v2alpha1/python/README.md b/api/v2alpha1/python/README.md new file mode 100644 index 00000000000..722619bbc70 --- /dev/null +++ b/api/v2alpha1/python/README.md @@ -0,0 +1,31 @@ +# Pipeline Spec + +## Generate golang proto code + +Generate golang proto code: + +```bash +make clean-go golang +``` + +## Generate Python proto package + +Generate kfp-pipeline-spec: + +Update `VERSION` in [v2alpha1/python/setup.py](https://github.com/kubeflow/pipelines/blob/master/api/v2alpha1/python/setup.py) if applicable. + +```bash +make clean-python python +``` + +## Generate both Python and golang proto code + +Generate both Python and golang proto: + +```bash +make clean all +``` + +Note, there are no prerequisites, because the generation uses a prebuilt docker image with all the tools necessary. + +Documentation: diff --git a/api/v2alpha1/python/pyproject.toml b/api/v2alpha1/python/pyproject.toml new file mode 100644 index 00000000000..aef0266d43c --- /dev/null +++ b/api/v2alpha1/python/pyproject.toml @@ -0,0 +1,53 @@ +# Copyright 2022 The Kubeflow 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. + +[build-system] +requires = ['setuptools>=61.0', 'wheel'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'kfp-pipeline-spec' +version = '2.14.6' +description = 'Kubeflow Pipelines pipeline spec' +authors = [ + {name = 'google', email = 'kubeflow-pipelines@google.com'}, +] +readme = 'README.md' +requires-python = '>=3.9.0' +license = 'Apache-2.0' +license-files = ['LICENSE'] +dependencies = [ + # Typically we can't support multiple major versions of protobuf + # The runtime protobuf package MUST be aligned with the protobuf + # libraries used to generate the code (protoc, protoc-gen-go, etc.) + # For example protobuf 5.x aligns with protoc 26.x-29.x but + # 6.x aligns with 30.x+. + # See for support tiers: + # https://protobuf.dev/support/version-support/#python + 'protobuf==6.31.1,<7.0', +] + +[dependency-groups] +dev = [] + +[project.urls] +Github = 'https://github.com/kubeflow/pipelines' + + +[tool.setuptools] +include-package-data = true + + +[tool.setuptools.packages.find] +include = ['kfp.*'] diff --git a/api/v2alpha1/python/setup.py b/api/v2alpha1/python/setup.py index 4df49b057e2..b908cbe55cb 100644 --- a/api/v2alpha1/python/setup.py +++ b/api/v2alpha1/python/setup.py @@ -1,44 +1,3 @@ -# Copyright 2022 The Kubeflow 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. - import setuptools -import os -from typing import List - -NAME = 'kfp-pipeline-spec' -VERSION = '2.14.6' - -def get_requirements(requirements_file: str) -> List[str]: - """Read requirements from requirements.in.""" - - file_path = os.path.join(os.path.dirname(__file__), requirements_file) - with open(file_path, 'r') as f: - lines = f.readlines() - lines = [line.strip() for line in lines] - lines = [line for line in lines if not line.startswith('#') and line] - return lines -setuptools.setup( - name=NAME, - version=VERSION, - description='Kubeflow Pipelines pipeline spec', - author='google', - author_email='kubeflow-pipelines@google.com', - url='https://github.com/kubeflow/pipelines', - packages=setuptools.find_namespace_packages(include=['kfp.*']), - python_requires='>=3.9.0', - install_requires=get_requirements('requirements.in'), - include_package_data=True, - license='Apache 2.0', -) +setuptools.setup() diff --git a/backend/api/v1beta1/python_http_client/pyproject.toml b/backend/api/v1beta1/python_http_client/pyproject.toml new file mode 100644 index 00000000000..a7211aaa767 --- /dev/null +++ b/backend/api/v1beta1/python_http_client/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ['setuptools>=61.0', 'wheel'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'kfp-server-api' +version = '2.14.6' +description = 'Kubeflow Pipelines API' +authors = [ + {name = 'google', email = 'kubeflow-pipelines@google.com'}, +] +readme = 'README.md' +requires-python = '>=3.9.0' +classifiers = [ + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', +] +license = 'Apache-2.0' +license-files = ['LICENSE'] +keywords = [ + 'OpenAPI', + 'OpenAPI-Generator', + 'Kubeflow Pipelines API', +] +dependencies = [ + 'certifi >= 14.05.14', + 'future; python_version<=2.7', + 'six >= 1.10', + 'python_dateutil >= 2.5.3', + 'setuptools >= 21.0.0', + 'urllib3 >= 1.15.1', +] + + +[dependency-groups] +dev = [ + 'pytest~=4.6.7', # needed for python 2.7+3.4 + 'pytest-cov>=2.8.1', + 'pytest-randomly==1.2.3', # needed for python 2.7+3.4 +] + +[project.urls] +Github = 'https://github.com/kubeflow/pipelines' + + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +exclude = ['*test*'] diff --git a/backend/api/v1beta1/python_http_client/setup.py b/backend/api/v1beta1/python_http_client/setup.py index 0f72a3b1bdf..9e0054b1497 100644 --- a/backend/api/v1beta1/python_http_client/setup.py +++ b/backend/api/v1beta1/python_http_client/setup.py @@ -1,41 +1,4 @@ # coding: utf-8 +from setuptools import setup -""" - Kubeflow Pipelines API - - This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. - - Contact: kubeflow-pipelines@google.com - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "kfp-server-api" -VERSION = "2.14.6" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] - -setup( - name=NAME, - version=VERSION, - description="Kubeflow Pipelines API", - author="google", - author_email="kubeflow-pipelines@google.com", - url="https://github.com/kubeflow/pipelines", - keywords=["OpenAPI", "OpenAPI-Generator", "Kubeflow Pipelines API"], - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache 2.0", - long_description="""\ - This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. # noqa: E501 - """ -) +setup() diff --git a/backend/api/v1beta1/python_http_client/tox.ini b/backend/api/v1beta1/python_http_client/tox.ini index 25937a6872f..92320089333 100644 --- a/backend/api/v1beta1/python_http_client/tox.ini +++ b/backend/api/v1beta1/python_http_client/tox.ini @@ -2,8 +2,8 @@ envlist = py27, py3 [testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps= + .[dev] commands= pytest --cov=kfp_server_api diff --git a/backend/api/v2beta1/python_http_client/pyproject.toml b/backend/api/v2beta1/python_http_client/pyproject.toml new file mode 100644 index 00000000000..087b3dc5595 --- /dev/null +++ b/backend/api/v2beta1/python_http_client/pyproject.toml @@ -0,0 +1,59 @@ +# Copyright 2023 The Kubeflow 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. + +[build-system] +requires = ['setuptools>=61.0', 'wheel'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'kfp-server-api' +version = '2.14.6' +description = 'Kubeflow Pipelines API' +authors = [ + {name = 'google', email = 'kubeflow-pipelines@google.com'} +] +keywords = [ + 'OpenAPI', + 'OpenAPI-Generator', + 'Kubeflow Pipelines API', +] +readme = 'README.md' +requires-python = '>=3.9.0' +license = 'Apache-2.0' +licese-files = ['LICENSE'] +dependencies = [ + 'urllib3 >= 1.15', + 'six >= 1.10', + 'certifi', + 'python-dateutil', +] + +[dependency-groups] +dev = [ + 'pytest~=4.6.7', # needed for python 2.7+3.4 + 'pytest-cov>=2.8.1', + 'pytest-randomly==1.2.3', # needed for python 2.7+3.4 +] + +[project.urls] +Github = 'https://github.com/kubeflow/pipelines' +Documentation = 'https://kfp-kubernetes.readthedocs.io/' +'Bug Tracker'= 'https://github.com/kubeflow/pipelines/issues' +Source = 'https://github.com/kubeflow/pipelines/tree/master/kubernetes_platform/python' + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +exclude = ['test.*', 'tests.*'] diff --git a/backend/api/v2beta1/python_http_client/setup.py b/backend/api/v2beta1/python_http_client/setup.py index 0f72a3b1bdf..b34ded03a1b 100644 --- a/backend/api/v2beta1/python_http_client/setup.py +++ b/backend/api/v2beta1/python_http_client/setup.py @@ -1,41 +1,5 @@ # coding: utf-8 -""" - Kubeflow Pipelines API +from setuptools import setup - This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. - - Contact: kubeflow-pipelines@google.com - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "kfp-server-api" -VERSION = "2.14.6" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] - -setup( - name=NAME, - version=VERSION, - description="Kubeflow Pipelines API", - author="google", - author_email="kubeflow-pipelines@google.com", - url="https://github.com/kubeflow/pipelines", - keywords=["OpenAPI", "OpenAPI-Generator", "Kubeflow Pipelines API"], - install_requires=REQUIRES, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache 2.0", - long_description="""\ - This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. # noqa: E501 - """ -) +setup() diff --git a/kubernetes_platform/python/LICENSE b/kubernetes_platform/python/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/kubernetes_platform/python/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/kubernetes_platform/python/pyproject.toml b/kubernetes_platform/python/pyproject.toml new file mode 100644 index 00000000000..25904feb2ba --- /dev/null +++ b/kubernetes_platform/python/pyproject.toml @@ -0,0 +1,66 @@ +# Copyright 2023 The Kubeflow 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. + +[build-system] +requires = ['setuptools>=61.0', 'wheel'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'kfp-kubernetes' +dynamic = ['version'] +description = 'Kubernetes platform configuration library and generated protos.' +authors = [ + {name = 'google', email = 'kubeflow-pipelines@google.com'} +] +readme = 'README.md' +requires-python = '>=3.9.0' +license = 'Apache-2.0' +license-files = ['LICENSE'] +dependencies = [ + # protobuf version should be identical to the one in kfp-pipeline-spec + # api/v2alpha1/python/pyroject.toml + 'protobuf==6.31.1,<7.0', + 'kfp>=2.14.0,<3', +] + +[dependency-groups] +dev = [ + 'docformatter==1.4', + 'isort==5.10.1', + 'mypy==0.941', + 'pre-commit==2.19.0', + 'pycln==2.1.1', + 'pytest==7.1.2', + 'pytest-xdist==2.5.0', + 'yapf==0.43.0', +] + +[project.urls] +Github = 'https://github.com/kubeflow/pipelines' +Documentation = 'https://kfp-kubernetes.readthedocs.io/' +'Bug Tracker'= 'https://github.com/kubeflow/pipelines/issues' +Source = 'https://github.com/kubeflow/pipelines/tree/master/kubernetes_platform/python' + +[project.scripts] +dsl-compile = 'kfp.cli.compile_:main' +kfp = 'kfp.cli.__main__:main' + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ['kfp.*'] + +[tool.setuptools.dynamic] +version = {attr = 'kfp.kubernetes.__init__.__version__'} diff --git a/kubernetes_platform/python/requirements-dev.txt b/kubernetes_platform/python/requirements-dev.txt index debfb23fe07..855511cec16 100644 --- a/kubernetes_platform/python/requirements-dev.txt +++ b/kubernetes_platform/python/requirements-dev.txt @@ -5,4 +5,4 @@ pre-commit==2.19.0 pycln==2.1.1 pytest==7.1.2 pytest-xdist==2.5.0 -yapf==0.32.0 \ No newline at end of file +yapf==0.43.0 diff --git a/kubernetes_platform/python/setup.py b/kubernetes_platform/python/setup.py index 4e30839a450..b908cbe55cb 100644 --- a/kubernetes_platform/python/setup.py +++ b/kubernetes_platform/python/setup.py @@ -1,82 +1,3 @@ -# Copyright 2023 The Kubeflow 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. - -import os -import re -from typing import List - import setuptools -NAME = 'kfp-kubernetes' - -def get_requirements(requirements_file: str) -> List[str]: - """Read requirements from requirements.in.""" - - file_path = os.path.join(os.path.dirname(__file__), requirements_file) - with open(file_path, 'r') as f: - lines = f.readlines() - lines = [line.strip() for line in lines] - lines = [line for line in lines if not line.startswith('#') and line] - return lines - -def find_version(*file_path_parts: str) -> str: - """Get version from kfp.__init__.__version__.""" - - file_path = os.path.join(os.path.dirname(__file__), *file_path_parts) - with open(file_path, 'r') as f: - version_file_text = f.read() - - version_match = re.search( - r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file_text, - re.M, - ) - if version_match: - return version_match[1] - else: - raise ValueError('Could not find version.') - - -def read_readme() -> str: - readme_path = os.path.join(os.path.dirname(__file__), 'README.md') - with open(readme_path) as f: - return f.read() - - -setuptools.setup( - name=NAME, - version=find_version('kfp', 'kubernetes', '__init__.py'), - description='Kubernetes platform configuration library and generated protos.', - long_description=read_readme(), - long_description_content_type='text/markdown', - author='google', - author_email='kubeflow-pipelines@google.com', - url='https://github.com/kubeflow/pipelines', - project_urls={ - 'Documentation': - 'https://kfp-kubernetes.readthedocs.io/', - 'Bug Tracker': - 'https://github.com/kubeflow/pipelines/issues', - 'Source': - 'https://github.com/kubeflow/pipelines/tree/master/kubernetes_platform/python', - }, - packages=setuptools.find_namespace_packages(include=['kfp.*']), - python_requires='>=3.9.0', - install_requires=get_requirements('requirements.in'), - include_package_data=True, - extras_require={ - 'dev': get_requirements('requirements-dev.txt'), - }, - license='Apache 2.0', -) +setuptools.setup() diff --git a/sdk/python/LICENSE b/sdk/python/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/sdk/python/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml new file mode 100644 index 00000000000..54428ad0308 --- /dev/null +++ b/sdk/python/pyproject.toml @@ -0,0 +1,129 @@ +# Copyright 2018-2022 The Kubeflow 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. + +[build-system] +requires = ['setuptools>=61.0', 'wheel'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'kfp' +dynamic = ['version'] +description = 'Kubeflow Pipelines SDK' +authors = [ + {name = 'The Kubeflow Authors'} +] +readme = 'README.md' +requires-python = '>=3.9.0' +license = 'Apache-2.0' +license-files = ['LICENSE'] +classifiers = [ + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', +] +dependencies = [ + # After any updates to these dependencies, requirements.txt should be regenerated running + # the following in this folder: + # pip-compile --no-emit-index-url requirements.in + + 'click==8.1.8', + 'click-option-group==0.5.7', + 'docstring-parser>=0.7.3,<1', + # Pin google-api-core version for the bug fixing in 1.31.5', + # https://github.com/googleapis/python-api-core/releases/tag/v1.31.5 + 'google-api-core>=1.31.5,<3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0', + 'google-auth>=1.6.1,<3', + # https://github.com/googleapis/python-storage/blob/main/CHANGELOG.md#221-2022-03-15 + 'google-cloud-storage>=2.2.1,<4', + # pin kfp-pipeline-spec to an exact version, since this is the contract between a given KFP + # SDK version and the BE. we don't want old version of the SDK to write new fields and to + # have the BE reject the new unsupported field (even if the new field backward compatible from a proto perspective) + 'kfp-pipeline-spec==2.14.0', + # Update the upper version whenever a new major version of the + # kfp-server-api package is released. + # Update the lower version when kfp sdk depends on new apis/fields in + # kfp-server-api + 'kfp-server-api>=2.14.0,<3', + 'kubernetes>=8.0.0,<31', + # protobuf version should be identical to the one in kfp-pipeline-spec + # api/v2alpha1/python/requirements.txt + 'protobuf==6.31.1,<7.0', + 'PyYAML>=5.3,<7', + 'requests-toolbelt>=0.8.0,<2', + 'tabulate>=0.8.6,<1', + 'urllib3<3.0.0', + + ## standard library backports ## + 'typing-extensions>=3.7.4,<5; python_version<"3.9"', +] + +[project.optional-dependencies] +# TODO: needs to be dynamically set based on KFP version +# kubernetes = [f'kfp-kubernetes=='] +kubernetes = ['kfp-kubernetes'] +notebooks = ['nbclient>=0.10,<1', 'ipykernel>=6,<7', 'jupyter_client>=7,<9'] +all = [ + 'kfp[docker,kubernetes,notebooks]' +] + +[dependency-groups] +dev = [ + 'absl-py==1.4.0', + 'docformatter==1.4', + 'docker==5.0.3', + 'isort==5.10.1', + 'mypy==0.941', + 'pip-tools==6.0.0', + 'pre-commit==2.19.0', + 'pycln==2.1.1', + 'pylint==2.17.7', + 'pytest==7.1.2', + 'pytest-cov==3.0.0', + 'pytest-xdist==2.5.0', + 'types-protobuf==3.19.15', + 'types-PyYAML==6.0.5', + 'types-requests==2.27.14', + 'types-tabulate==0.8.6', + 'yapf==0.43.0', +] + +[project.urls] +Documentation = 'https://kubeflow-pipelines.readthedocs.io/en/stable/' +'Bug Tracker' = 'https://github.com/kubeflow/pipelines/issues' +Source = 'https://github.com/kubeflow/pipelines/tree/master/sdk' +Changelog = 'https://github.com/kubeflow/pipelines/blob/master/sdk/RELEASE.md' + +[project.scripts] +dsl-compile = 'kfp.cli.compile_:main' +kfp = 'kfp.cli.__main__:main' + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +exclude = ['*test*'] + +[tool.setuptools.dynamic] +version = {attr = 'kfp.version.__version__'} diff --git a/sdk/python/requirements.txt b/sdk/python/requirements.txt index 68d2b18cd9f..27d9b1cbbd1 100644 --- a/sdk/python/requirements.txt +++ b/sdk/python/requirements.txt @@ -9,23 +9,24 @@ charset-normalizer==3.4.3 # via requests click>=8.1.8 # via - # -r requirements.in # click-option-group + # kfp (pyproject.toml) click-option-group==0.5.7 - # via -r requirements.in + # via kfp (pyproject.toml) +colorama==0.4.6 + # via click docstring-parser==0.17.0 # via -r requirements.in google-api-core==2.26.0 # via - # -r requirements.in # google-cloud-core # google-cloud-storage google-auth==2.41.1 # via - # -r requirements.in # google-api-core # google-cloud-core # google-cloud-storage + # kfp (pyproject.toml) # kubernetes google-cloud-core==2.4.3 # via google-cloud-storage @@ -46,7 +47,7 @@ kfp-pipeline-spec==2.14.6 kfp-server-api>=2.14.3,<=2.14.7 # via -r requirements.in kubernetes==30.1.0 - # via -r requirements.in + # via kfp (pyproject.toml) oauthlib==3.3.1 # via # kubernetes @@ -55,9 +56,9 @@ proto-plus==1.26.1 # via google-api-core protobuf==6.32.1 # via - # -r requirements.in # google-api-core # googleapis-common-protos + # kfp (pyproject.toml) # kfp-pipeline-spec # proto-plus pyasn1==0.6.1 @@ -72,7 +73,7 @@ python-dateutil==2.9.0.post0 # kubernetes pyyaml==6.0.3 # via - # -r requirements.in + # kfp (pyproject.toml) # kubernetes requests==2.32.5 # via @@ -84,7 +85,7 @@ requests==2.32.5 requests-oauthlib==2.0.0 # via kubernetes requests-toolbelt==1.0.0 - # via -r requirements.in + # via kfp (pyproject.toml) rsa==4.9.1 # via google-auth six==1.17.0 @@ -93,10 +94,10 @@ six==1.17.0 # kubernetes # python-dateutil tabulate==0.9.0 - # via -r requirements.in + # via kfp (pyproject.toml) urllib3==2.5.0 # via - # -r requirements.in + # kfp (pyproject.toml) # kfp-server-api # kubernetes # requests diff --git a/sdk/python/setup.py b/sdk/python/setup.py index e61b9f78d01..b908cbe55cb 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -1,111 +1,3 @@ -# Copyright 2018-2022 The Kubeflow 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. - -import os -import re -from typing import List - import setuptools - -def get_requirements(requirements_file: str) -> List[str]: - """Read requirements from requirements.in.""" - - file_path = os.path.join(os.path.dirname(__file__), requirements_file) - with open(file_path, 'r') as f: - lines = f.readlines() - lines = [line.strip() for line in lines] - lines = [line for line in lines if not line.startswith('#') and line] - return lines - - -def find_version(*file_path_parts: str) -> str: - """Get version from kfp.__init__.__version__.""" - - file_path = os.path.join(os.path.dirname(__file__), *file_path_parts) - with open(file_path, 'r') as f: - version_file_text = f.read() - - version_match = re.search( - r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file_text, - re.M, - ) - if version_match: - return version_match.group(1) - - raise RuntimeError(f'Unable to find version string in file: {file_path}.') - - -def read_readme() -> str: - readme_path = os.path.join(os.path.dirname(__file__), 'README.md') - with open(readme_path) as f: - return f.read() - - -_version = find_version('kfp', 'version.py') -docker = ['docker'] -kubernetes = [f'kfp-kubernetes=={_version}'] -notebooks = ["nbclient>=0.10,<1", "ipykernel>=6,<7", "jupyter_client>=7,<9"] - -setuptools.setup( - name='kfp', - version=_version, - description='Kubeflow Pipelines SDK', - long_description=read_readme(), - long_description_content_type='text/markdown', - author='The Kubeflow Authors', - url='https://github.com/kubeflow/pipelines', - project_urls={ - 'Documentation': - 'https://kubeflow-pipelines.readthedocs.io/en/stable/', - 'Bug Tracker': - 'https://github.com/kubeflow/pipelines/issues', - 'Source': - 'https://github.com/kubeflow/pipelines/tree/master/sdk', - 'Changelog': - 'https://github.com/kubeflow/pipelines/blob/master/sdk/RELEASE.md', - }, - install_requires=get_requirements('requirements.in'), - extras_require={ - 'all': docker + kubernetes + notebooks, - 'kubernetes': kubernetes, - 'notebooks': notebooks, - }, - packages=setuptools.find_packages(exclude=['*test*']), - classifiers=[ - 'Intended Audience :: Developers', - 'Intended Audience :: Education', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], - python_requires='>=3.9.0', - include_package_data=True, - entry_points={ - 'console_scripts': [ - 'dsl-compile = kfp.cli.compile_:main', - 'kfp=kfp.cli.__main__:main', - ] - }) +setuptools.setup()