Skip to content

Commit

Permalink
build for any version of kubernetes-client-python
Browse files Browse the repository at this point in the history
  • Loading branch information
lexdene committed May 29, 2023
1 parent 4e50d83 commit 2d7819c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dist
__pycache__
venv/

kubernetes-client-python/
kubernetes-stubs/
kubernetes_ext/
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
fork of [kubernetes-stubs](https://pypi.org/project/kubernetes-stubs)

origin readme: [origin readme](README-origin.md)

## how to build for a new version of kubernetes-client-python

run:

VERSION=23.3.0
bash scripts/release.sh $VERSION
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[tool.poetry]
name = "kubernetes-stubs-elephant-fork"
version = "22.6.0post1"
description = "Type stubs for the Kubernetes Python API client"
authors = ["Nikhil Benesch <nikhil.benesch@gmail.com>", "Rami Chowdhury <rami.chowdhury@gmail.com>", "Elephant Liu"]
license = "Apache-2.0"
readme = "README.md"

# version will be updated by build script
version = "0.0.0"

packages = [
{ include = "kubernetes_ext" },
{ include = "kubernetes-stubs" },
Expand Down
28 changes: 28 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
set -e

VERSION=$1
echo 'version:' $VERSION

# clean up
rm -rf kubernetes-client-python \
kubernetes-stubs \
kubernetes_ext \
dist

# install
pip install --upgrade pip wheel setuptools
pip install -r scripts/requirements.txt

mkdir -p kubernetes-client-python/scripts
pushd kubernetes-client-python/scripts
wget https://github.com/kubernetes-client/python/raw/v${VERSION}/scripts/swagger.json
popd

poetry run python codegen

./bin/fmt

# Is there any better way to update version from command line?
toml set --toml-path pyproject.toml tool.poetry.version "${VERSION}.dev0"

poetry build
8 changes: 8 additions & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
poetry==1.1.7

black~=21.6b0
isort~=5.9.2
inflection~=0.5.1
click<8.1

toml-cli

0 comments on commit 2d7819c

Please sign in to comment.