summaryrefslogtreecommitdiff
path: root/python-grpc-robot.spec
blob: 3f54e326d465cbe930ab0dc2f316fb5bd0544bdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
%global _empty_manifest_terminate_build 0
Name:		python-grpc-robot
Version:	2.9.6
Release:	1
Summary:	Package for sending/recieving messages to/from a gRPC server.
License:	Copyright 2020-present Open Networking Foundation Original copyright 2020-present ADTRAN, Inc. 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.
URL:		https://pypi.org/project/grpc-robot/
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/34/38/a66e8bc3e83b37a5f079717292b66277ee26365c2ba063d4fff28bbbb60f/grpc_robot-2.9.6.tar.gz
BuildArch:	noarch

Requires:	python3-parsy
Requires:	python3-six
Requires:	python3-robotframework
Requires:	python3-grpcio
Requires:	python3-decorator
Requires:	python3-attrs
Requires:	python3-device-management-interface
Requires:	python3-voltha-protos

%description
# Robot gRPC package
This package allows sending/receiving messages in a gRPC event stream.

## Supported devices
This gRPC ROBOT library is intended to support different Protocol Buffer definitions. Precondition is that python files
generated from Protocol Buffer files are available in a pip package which must be installed before the library
is used.

| Supported device | Pip package                 | Pip package version | Library Name                                 |
|------------------|-----------------------------|---------------------|----------------------------------------------|
| dmi              | device-management-interface | 0.9.1               | [grpc_robot.Dmi](docs/dmi_0_9_1.html)        |
|                  |                             | 0.9.2               | [grpc_robot.Dmi](docs/dmi_0_9_2.html)        |
|                  |                             | 0.9.3               | [grpc_robot.Dmi](docs/dmi_0_9_3.html)        |
|                  |                             | 0.9.4               | [grpc_robot.Dmi](docs/dmi_0_9_4.html)        |
|                  |                             | 0.9.5               | [grpc_robot.Dmi](docs/dmi_0_9_5.html)        |
|                  |                             | 0.9.6               | [grpc_robot.Dmi](docs/dmi_0_9_6.html)        |
|                  |                             | 0.9.8               | [grpc_robot.Dmi](docs/dmi_0_9_8.html)        |
|                  |                             | 0.9.9               | [grpc_robot.Dmi](docs/dmi_0_9_9.html)        |
|                  |                             | 0.10.1              | [grpc_robot.Dmi](docs/dmi_0_10_1.html)       |
|                  |                             | 0.10.2              | [grpc_robot.Dmi](docs/dmi_0_10_2.html)       |
|                  |                             | 0.12.0              | [grpc_robot.Dmi](docs/dmi_0_12_0.html)       |
|                  |                             | 1.0.0               | [grpc_robot.Dmi](docs/dmi_1_0_0.html)        |
|                  |                             | 1.2.1               | [grpc_robot.Dmi](docs/dmi_1_2_1.html)        |
|                  |                             | 1.4.0               | [grpc_robot.Dmi](docs/dmi_1_4_0.html)        |
| voltha           | voltha-protos               | 4.0.13              | [grpc_robot.Voltha](docs/voltha_4_0_13.html) |
|                  |                             | 4.2.0               | [grpc_robot.Voltha](docs/voltha_4_2_0.html)  |

## Tools
The package also offers some keywords for convenience to work with Robot Framework.

List of keywords: 
 - [grpc_robot.Collections](docs/collections.html)
 - [grpc_robot.DmiTools](docs/dmi_tools.html)
 - [grpc_robot.VolthaTools](docs/voltha_tools.html)

The list of keywords may can be extended by request if required.

## Installation

    pip install robot-grpc

## How to use _robot-grpc_ in Robot Framework
The library has a named parameter _version_ to indicate the ProtoBuf file set to be used.

    Import Library    grpc_robot.Dmi
    Import Library    grpc_robot.Voltha
    Import Library    grpc_robot.Collections
    Import Library    grpc_robot.DmiTools
    Import Library    grpc_robot.VolthaTools
    

## How to update the grpc-robot to support newer DMI versions (e.g. 1.4.0)

1. Create a new version folder “dmi_1_4_0” in “<repo dir>/grpc-robot/grpc_robot/services/dmi”
2. Place an __init__.py and a dmi.json file in this folder:
    - In most cases the __init__.py file can be copied from the last dmi version's folder and updated to the dmi version 
        from which the new version shall derive.
    - The dmi.json file must be created. Please check chapter "How to create the dmi.json file"
3. If the new DMI version introduces new RPCs or the types of the parameter and/or the return have been changed for some 
        RPC the according keyword files from the last DMI version must be edited and placed into the new folder. It is 
        not neccessary to update the keyword files if the content of the RPC have changed. For each RPC which shall be 
        supported by the grpc-robot a keyword must be defined in the files. 
4. Update the README.md file with the new version.
5. Update the documentation string of class GrpcDmiRobot in file "<repo dir>/grpc-robot/grpc_robot/grpc_robot.py"
6. Update the tests if required.
7. Update the VERSION file for the library version
8. Create the new package and upload it to pypi.org
    - cd <repo dir>/grpc-robot
    - rm dist/*; python3 setup.py sdist bdist_wheel
    - PYTHONPATH=<repo dir>/grpc-robot source MAKEDOC
    - rm dist/*; python3 setup.py sdist bdist_wheel
    - pip uninstall -y grpc-robot; pip install dist/*.tar.gz
    - twine upload dist/*

## How to create the dmi.json file

The json file is the conversion of the ProtoBuf files content into json format which is used by the library.

1. Clone or update the repository https://github.com/opencord/device-management-interface.git. Make sure the VERSION 
        file shows the desired DMI version. If not checkout the version of interest.
2. In the command line interface run the command:
   - grpc_robot.protop -i <directory which consists of the ProtoBuf files to be converted> -o <output directory for 
        the created json file> dmi <version>

   e.g.
   - grpc_robot.protop -i ~/repositories/device-management-interface/protos/dmi -o <repo dir>/grpc-robot/grpc_robot/services/ dmi 1.4.0




%package -n python3-grpc-robot
Summary:	Package for sending/recieving messages to/from a gRPC server.
Provides:	python-grpc-robot
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-grpc-robot
# Robot gRPC package
This package allows sending/receiving messages in a gRPC event stream.

## Supported devices
This gRPC ROBOT library is intended to support different Protocol Buffer definitions. Precondition is that python files
generated from Protocol Buffer files are available in a pip package which must be installed before the library
is used.

| Supported device | Pip package                 | Pip package version | Library Name                                 |
|------------------|-----------------------------|---------------------|----------------------------------------------|
| dmi              | device-management-interface | 0.9.1               | [grpc_robot.Dmi](docs/dmi_0_9_1.html)        |
|                  |                             | 0.9.2               | [grpc_robot.Dmi](docs/dmi_0_9_2.html)        |
|                  |                             | 0.9.3               | [grpc_robot.Dmi](docs/dmi_0_9_3.html)        |
|                  |                             | 0.9.4               | [grpc_robot.Dmi](docs/dmi_0_9_4.html)        |
|                  |                             | 0.9.5               | [grpc_robot.Dmi](docs/dmi_0_9_5.html)        |
|                  |                             | 0.9.6               | [grpc_robot.Dmi](docs/dmi_0_9_6.html)        |
|                  |                             | 0.9.8               | [grpc_robot.Dmi](docs/dmi_0_9_8.html)        |
|                  |                             | 0.9.9               | [grpc_robot.Dmi](docs/dmi_0_9_9.html)        |
|                  |                             | 0.10.1              | [grpc_robot.Dmi](docs/dmi_0_10_1.html)       |
|                  |                             | 0.10.2              | [grpc_robot.Dmi](docs/dmi_0_10_2.html)       |
|                  |                             | 0.12.0              | [grpc_robot.Dmi](docs/dmi_0_12_0.html)       |
|                  |                             | 1.0.0               | [grpc_robot.Dmi](docs/dmi_1_0_0.html)        |
|                  |                             | 1.2.1               | [grpc_robot.Dmi](docs/dmi_1_2_1.html)        |
|                  |                             | 1.4.0               | [grpc_robot.Dmi](docs/dmi_1_4_0.html)        |
| voltha           | voltha-protos               | 4.0.13              | [grpc_robot.Voltha](docs/voltha_4_0_13.html) |
|                  |                             | 4.2.0               | [grpc_robot.Voltha](docs/voltha_4_2_0.html)  |

## Tools
The package also offers some keywords for convenience to work with Robot Framework.

List of keywords: 
 - [grpc_robot.Collections](docs/collections.html)
 - [grpc_robot.DmiTools](docs/dmi_tools.html)
 - [grpc_robot.VolthaTools](docs/voltha_tools.html)

The list of keywords may can be extended by request if required.

## Installation

    pip install robot-grpc

## How to use _robot-grpc_ in Robot Framework
The library has a named parameter _version_ to indicate the ProtoBuf file set to be used.

    Import Library    grpc_robot.Dmi
    Import Library    grpc_robot.Voltha
    Import Library    grpc_robot.Collections
    Import Library    grpc_robot.DmiTools
    Import Library    grpc_robot.VolthaTools
    

## How to update the grpc-robot to support newer DMI versions (e.g. 1.4.0)

1. Create a new version folder “dmi_1_4_0” in “<repo dir>/grpc-robot/grpc_robot/services/dmi”
2. Place an __init__.py and a dmi.json file in this folder:
    - In most cases the __init__.py file can be copied from the last dmi version's folder and updated to the dmi version 
        from which the new version shall derive.
    - The dmi.json file must be created. Please check chapter "How to create the dmi.json file"
3. If the new DMI version introduces new RPCs or the types of the parameter and/or the return have been changed for some 
        RPC the according keyword files from the last DMI version must be edited and placed into the new folder. It is 
        not neccessary to update the keyword files if the content of the RPC have changed. For each RPC which shall be 
        supported by the grpc-robot a keyword must be defined in the files. 
4. Update the README.md file with the new version.
5. Update the documentation string of class GrpcDmiRobot in file "<repo dir>/grpc-robot/grpc_robot/grpc_robot.py"
6. Update the tests if required.
7. Update the VERSION file for the library version
8. Create the new package and upload it to pypi.org
    - cd <repo dir>/grpc-robot
    - rm dist/*; python3 setup.py sdist bdist_wheel
    - PYTHONPATH=<repo dir>/grpc-robot source MAKEDOC
    - rm dist/*; python3 setup.py sdist bdist_wheel
    - pip uninstall -y grpc-robot; pip install dist/*.tar.gz
    - twine upload dist/*

## How to create the dmi.json file

The json file is the conversion of the ProtoBuf files content into json format which is used by the library.

1. Clone or update the repository https://github.com/opencord/device-management-interface.git. Make sure the VERSION 
        file shows the desired DMI version. If not checkout the version of interest.
2. In the command line interface run the command:
   - grpc_robot.protop -i <directory which consists of the ProtoBuf files to be converted> -o <output directory for 
        the created json file> dmi <version>

   e.g.
   - grpc_robot.protop -i ~/repositories/device-management-interface/protos/dmi -o <repo dir>/grpc-robot/grpc_robot/services/ dmi 1.4.0




%package help
Summary:	Development documents and examples for grpc-robot
Provides:	python3-grpc-robot-doc
%description help
# Robot gRPC package
This package allows sending/receiving messages in a gRPC event stream.

## Supported devices
This gRPC ROBOT library is intended to support different Protocol Buffer definitions. Precondition is that python files
generated from Protocol Buffer files are available in a pip package which must be installed before the library
is used.

| Supported device | Pip package                 | Pip package version | Library Name                                 |
|------------------|-----------------------------|---------------------|----------------------------------------------|
| dmi              | device-management-interface | 0.9.1               | [grpc_robot.Dmi](docs/dmi_0_9_1.html)        |
|                  |                             | 0.9.2               | [grpc_robot.Dmi](docs/dmi_0_9_2.html)        |
|                  |                             | 0.9.3               | [grpc_robot.Dmi](docs/dmi_0_9_3.html)        |
|                  |                             | 0.9.4               | [grpc_robot.Dmi](docs/dmi_0_9_4.html)        |
|                  |                             | 0.9.5               | [grpc_robot.Dmi](docs/dmi_0_9_5.html)        |
|                  |                             | 0.9.6               | [grpc_robot.Dmi](docs/dmi_0_9_6.html)        |
|                  |                             | 0.9.8               | [grpc_robot.Dmi](docs/dmi_0_9_8.html)        |
|                  |                             | 0.9.9               | [grpc_robot.Dmi](docs/dmi_0_9_9.html)        |
|                  |                             | 0.10.1              | [grpc_robot.Dmi](docs/dmi_0_10_1.html)       |
|                  |                             | 0.10.2              | [grpc_robot.Dmi](docs/dmi_0_10_2.html)       |
|                  |                             | 0.12.0              | [grpc_robot.Dmi](docs/dmi_0_12_0.html)       |
|                  |                             | 1.0.0               | [grpc_robot.Dmi](docs/dmi_1_0_0.html)        |
|                  |                             | 1.2.1               | [grpc_robot.Dmi](docs/dmi_1_2_1.html)        |
|                  |                             | 1.4.0               | [grpc_robot.Dmi](docs/dmi_1_4_0.html)        |
| voltha           | voltha-protos               | 4.0.13              | [grpc_robot.Voltha](docs/voltha_4_0_13.html) |
|                  |                             | 4.2.0               | [grpc_robot.Voltha](docs/voltha_4_2_0.html)  |

## Tools
The package also offers some keywords for convenience to work with Robot Framework.

List of keywords: 
 - [grpc_robot.Collections](docs/collections.html)
 - [grpc_robot.DmiTools](docs/dmi_tools.html)
 - [grpc_robot.VolthaTools](docs/voltha_tools.html)

The list of keywords may can be extended by request if required.

## Installation

    pip install robot-grpc

## How to use _robot-grpc_ in Robot Framework
The library has a named parameter _version_ to indicate the ProtoBuf file set to be used.

    Import Library    grpc_robot.Dmi
    Import Library    grpc_robot.Voltha
    Import Library    grpc_robot.Collections
    Import Library    grpc_robot.DmiTools
    Import Library    grpc_robot.VolthaTools
    

## How to update the grpc-robot to support newer DMI versions (e.g. 1.4.0)

1. Create a new version folder “dmi_1_4_0” in “<repo dir>/grpc-robot/grpc_robot/services/dmi”
2. Place an __init__.py and a dmi.json file in this folder:
    - In most cases the __init__.py file can be copied from the last dmi version's folder and updated to the dmi version 
        from which the new version shall derive.
    - The dmi.json file must be created. Please check chapter "How to create the dmi.json file"
3. If the new DMI version introduces new RPCs or the types of the parameter and/or the return have been changed for some 
        RPC the according keyword files from the last DMI version must be edited and placed into the new folder. It is 
        not neccessary to update the keyword files if the content of the RPC have changed. For each RPC which shall be 
        supported by the grpc-robot a keyword must be defined in the files. 
4. Update the README.md file with the new version.
5. Update the documentation string of class GrpcDmiRobot in file "<repo dir>/grpc-robot/grpc_robot/grpc_robot.py"
6. Update the tests if required.
7. Update the VERSION file for the library version
8. Create the new package and upload it to pypi.org
    - cd <repo dir>/grpc-robot
    - rm dist/*; python3 setup.py sdist bdist_wheel
    - PYTHONPATH=<repo dir>/grpc-robot source MAKEDOC
    - rm dist/*; python3 setup.py sdist bdist_wheel
    - pip uninstall -y grpc-robot; pip install dist/*.tar.gz
    - twine upload dist/*

## How to create the dmi.json file

The json file is the conversion of the ProtoBuf files content into json format which is used by the library.

1. Clone or update the repository https://github.com/opencord/device-management-interface.git. Make sure the VERSION 
        file shows the desired DMI version. If not checkout the version of interest.
2. In the command line interface run the command:
   - grpc_robot.protop -i <directory which consists of the ProtoBuf files to be converted> -o <output directory for 
        the created json file> dmi <version>

   e.g.
   - grpc_robot.protop -i ~/repositories/device-management-interface/protos/dmi -o <repo dir>/grpc-robot/grpc_robot/services/ dmi 1.4.0




%prep
%autosetup -n grpc-robot-2.9.6

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-grpc-robot -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 2.9.6-1
- Package Spec generated