From cdfd750727b1b0aaa8a5ae0f6063fc86e6728cc4 Mon Sep 17 00:00:00 2001 From: Tomasz Prus Date: Sun, 26 Feb 2023 12:01:40 +0100 Subject: [PATCH] Fix snapshot version to be compliant with PEP440. --- kubernetes/README.md | 2 +- kubernetes/__init__.py | 2 +- kubernetes/client/__init__.py | 2 +- kubernetes/client/api_client.py | 2 +- kubernetes/client/configuration.py | 2 +- scripts/constants.py | 2 +- scripts/release.sh | 8 +++++++- setup.py | 2 +- 8 files changed, 14 insertions(+), 8 deletions(-) diff --git a/kubernetes/README.md b/kubernetes/README.md index 3b95eec5c..361e96880 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: release-1.26 -- Package version: 26.0.0-snapshot +- Package version: 26.0.0+snapshot - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/kubernetes/__init__.py b/kubernetes/__init__.py index 22f8f5d89..ebb69d03d 100644 --- a/kubernetes/__init__.py +++ b/kubernetes/__init__.py @@ -14,7 +14,7 @@ __project__ = 'kubernetes' # The version is auto-updated. Please do not edit. -__version__ = "26.0.0-snapshot" +__version__ = "26.0.0+snapshot" from . import client from . import config diff --git a/kubernetes/client/__init__.py b/kubernetes/client/__init__.py index ae2808dd8..fda1b12f4 100644 --- a/kubernetes/client/__init__.py +++ b/kubernetes/client/__init__.py @@ -14,7 +14,7 @@ from __future__ import absolute_import -__version__ = "26.0.0-snapshot" +__version__ = "26.0.0+snapshot" # import apis into sdk package from kubernetes.client.api.well_known_api import WellKnownApi diff --git a/kubernetes/client/api_client.py b/kubernetes/client/api_client.py index 8f2a182ed..5db948cd8 100644 --- a/kubernetes/client/api_client.py +++ b/kubernetes/client/api_client.py @@ -78,7 +78,7 @@ class ApiClient(object): self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/26.0.0-snapshot/python' + self.user_agent = 'OpenAPI-Generator/26.0.0+snapshot/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/kubernetes/client/configuration.py b/kubernetes/client/configuration.py index e7d24d442..2b9dd96a5 100644 --- a/kubernetes/client/configuration.py +++ b/kubernetes/client/configuration.py @@ -350,7 +350,7 @@ class Configuration(object): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: release-1.26\n"\ - "SDK Package Version: 26.0.0-snapshot".\ + "SDK Package Version: 26.0.0+snapshot".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/scripts/constants.py b/scripts/constants.py index ed4e14fcd..ee96d9a7d 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -18,7 +18,7 @@ import sys KUBERNETES_BRANCH = "release-1.26" # client version for packaging and releasing. -CLIENT_VERSION = "26.0.0-snapshot" +CLIENT_VERSION = "26.0.0+snapshot" # Name of the release package PACKAGE_NAME = "kubernetes" diff --git a/scripts/release.sh b/scripts/release.sh index 55b8a321a..dce27298d 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -61,7 +61,7 @@ # branch # # Usage: -# $ KUBERNETES_BRANCH=release-1.19 CLIENT_VERSION=19.0.0-snapshot DEVELOPMENT_STATUS="3 - Alpha" scripts/release.sh +# $ KUBERNETES_BRANCH=release-1.19 CLIENT_VERSION=19.0.0+snapshot DEVELOPMENT_STATUS="3 - Alpha" scripts/release.sh set -o errexit set -o nounset @@ -94,6 +94,12 @@ KUBERNETES_BRANCH=${KUBERNETES_BRANCH:-$(python3 "scripts/constants.py" KUBERNET CLIENT_VERSION=${CLIENT_VERSION:-$(python3 "scripts/constants.py" CLIENT_VERSION)} DEVELOPMENT_STATUS=${DEVELOPMENT_STATUS:-$(python3 "scripts/constants.py" DEVELOPMENT_STATUS)} +# Simple check if version is compliant with https://peps.python.org/pep-0440/ +if [[ ! "$CLIENT_VERSION" =~ ^[0-9A-Za-z+.]+$ ]]; then + echo "!!! Invalid client version $CLIENT_VERSION" + exit 1 +fi + # Create a local branch STARTINGBRANCH=$(git symbolic-ref --short HEAD) declare -r STARTINGBRANCH diff --git a/setup.py b/setup.py index 6c24dff4f..04bc04cd3 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ from setuptools import setup # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -CLIENT_VERSION = "26.0.0-snapshot" +CLIENT_VERSION = "26.0.0+snapshot" PACKAGE_NAME = "kubernetes" DEVELOPMENT_STATUS = "3 - Alpha"