File tree Expand file tree Collapse file tree 7 files changed +54
-74
lines changed
Expand file tree Collapse file tree 7 files changed +54
-74
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ sdk/js/package-lock.json
77sdk /python /dist /
88sdk /python /libopenstorage_openstorage.egg-info /
99sdk /python /setup.py
10+ api.proto
Original file line number Diff line number Diff line change @@ -2,15 +2,18 @@ APIDIR := ../..
22VEDIR := build
33PYTHON := python3
44PIP := pip3
5+ PATCH :=
56all : grpc
67
78ifndef APIVER
89 $(error Must provide an APIVER value)
910endif
1011
1112grpc :
13+ -sudo rm -rf $(VEDIR ) > /dev/null 2>&1
1214 $(PYTHON ) -m venv $(VEDIR )
1315 bash -c " source $( VEDIR) /bin/activate && \
16+ $(PIP ) install --upgrade pip && \
1417 $(PIP ) install -r requirements.txt && \
1518 $(PYTHON ) -m grpc_tools.protoc \
1619 -I$(APIDIR ) \
@@ -34,10 +37,17 @@ grpc:
3437 --grpc_python_out=. \
3538 $(GOPATH ) /src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api/http.proto"
3639 sed -i -e " s#^import api_pb2 as api__pb2#from openstorage import api_pb2 as api__pb2#" openstorage/api_pb2_grpc.py
37- sed -e " s#%%APIVER%%#$( APIVER) #" setup.py.tmpl > setup.py
40+ sed -e " s#%%APIVER%%#$( APIVER) $( PATCH ) #" setup.py.tmpl > setup.py
3841 bash -c " source $( VEDIR) /bin/activate && \
3942 $(PYTHON ) setup.py sdist bdist_egg"
4043
44+ release :
45+ $(PYTHON ) -m venv release
46+ bash -c " source release/bin/activate && \
47+ python3 -m pip install --upgrade pip && \
48+ python3 -m pip install --upgrade twine"
49+
50+
4151clean :
4252 sudo rm -rf $(VEDIR ) setup.py dist libopenstorage_openstorage.egg-info
4353
Original file line number Diff line number Diff line change 1- # Python gRPC Client Library
1+ # Python gRPC Client Library for OpenStorage SDK
22
3- # Build
4-
5- Type ` make ` .
6-
7- # Installing
8-
9- Installing through pip is now supported:
10-
11- ```
12- python3 -m venv sdk
13- source sdk/bin/activate
14- pip3 install libopenstorage-openstorage
15- ```
16-
17- > NOTE: Python 2.7 is no longer supported. This is for Python3 only.
3+ For more information please see https://libopenstorage.github.io
184
195# Example
206
217``` python
22- #
23- # More info: https://grpc.io/docs/quickstart/python.html
24- #
258import grpc
269
2710from openstorage import api_pb2
4831 ))
4932 print (' Volume id is {0} ' .format(v_resp.volume_id))
5033except grpc.RpcError as e:
51- print (' Failed: code={0} msg={1} ' .format(e.code(), e.details()))(build)
34+ print (' Failed: code={0} msg={1} ' .format(e.code(), e.details()))
5235```
5336
54- # PyPi
55-
56- See https://dzone.com/articles/executable-package-pip-install
57-
58-
Original file line number Diff line number Diff line change 1+ # Pypi Release
2+
3+ * Read https://packaging.python.org/en/latest/tutorials/packaging-projects/
4+
5+ * Type: ` make release ` to setup the venv
6+ * Type: ` source release/bin/activate `
7+
8+ Then follow the documentation from the page above to push your change to the
9+ testpypi server.
10+
11+ Once you have tested that you can install from testpypi, then you can push
12+ to normal pypi with the command:
13+
14+ ```
15+ python3 -m twine upload dist/*
16+ ```
17+
18+ > NOTE: You will need to setup your $HOME/.pypirc with the API tokens for both
19+ > the testpypi and pypi servers.
20+
21+
22+ ## Patch Number
23+
24+ If during the testing you find an error and fix it, then you will want to add
25+ a PATCH number of ".1", and so on to the value of PATCH in the Makefile. This is
26+ due to pypi or testpypi not allowing uploads to get overwritten.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11cachetools == 5.2.0
2- certifi == 2022.6.15
3- charset-normalizer == 2.1.0
4- google-auth == 2.9.1
5- grpcio == 1.26.0
6- grpcio-tools == 1.26.0
2+ certifi == 2022.6.15.1
3+ charset-normalizer == 2.1.1
4+ google-auth == 2.11.0
5+ grpcio == 1.48.1
6+ grpcio-tools == 1.48.1
77idna == 3.3
88kubernetes == 24.2.0
9- oauthlib == 3.2.0
9+ oauthlib == 3.2.1
1010protobuf == 3.20.1
1111pyasn1 == 0.4.8
1212pyasn1-modules == 0.2.8
@@ -16,5 +16,5 @@ requests==2.28.1
1616requests-oauthlib == 1.3.1
1717rsa == 4.9
1818six == 1.16.0
19- urllib3 == 1.26.11
20- websocket-client == 1.3.3
19+ urllib3 == 1.26.12
20+ websocket-client == 1.4.1
Original file line number Diff line number Diff line change 11import setuptools
22
3- with open(" pypi.md" , " r" ) as fh:
4- long_description = fh.read ()
3+ def read(fname):
4+ with open(fname, " r" ) as fh:
5+ return fh.read ()
56
67setuptools.setup (
78 name= " libopenstorage-openstorage" ,
89 version= " %% APIVER%% " ,
910 author= " Portworx" ,
1011 author_email= " lpabon@purestorage.com" ,
1112 description= " OpenStorage SDK Python gRPC Client Library" ,
12- long_description= long_description ,
13+ long_description= read( " README.md " ) ,
1314 long_description_content_type= " text/markdown" ,
1415 url= " https://github.com/libopenstorage/openstorage-sdk-clients" ,
1516 packages= setuptools.find_packages (),
@@ -19,6 +20,6 @@ setuptools.setup(
1920 " License :: OSI Approved :: Apache Software License" ,
2021 " Operating System :: OS Independent" ,
2122 ],
22- python_requires= '>= 3.0 ',
23+ python_requires= '>= 3.5 ',
2324)
2425
You can’t perform that action at this time.
0 commit comments