1RDOPKG-ADV-REQUIRE(7) RDOPKG-ADV-REQUIRE(7)
2
3
4
6 rdopkg-adv-requirements - rdopkg adventures: requirements management
7
9 This is a story about managing requirements of an RDO package using
10 rdopkg.
11
13 rdopkg contains actions to help you with requirements management,
14 namely:
15
16 · rdopkg reqdiff shows diff of requirements.txt between versions
17
18 · rdopkg reqcheck compares requirements.txt with .spec Requires
19
20 · rdopkg query queries RDO repos for version of a supplied package
21
22 · rdopkg reqquery queries RDO repos for versions of requirements.txt
23
24 This document will give you some examples of how to use these commands.
25
26 Please make sure you have the latest rdopkg, at least 0.28.
27
28 Let’s explore python-openstackclient RDO package. All commands are run
29 in its distgit with patches and upstream remotes set up:
30
31 $ cd python-openstackclient
32 $ git fetch --all
33 $ git remote -v
34 openstack git@github.com:openstack/python-openstackclient.git (fetch)
35 openstack git@github.com:openstack/python-openstackclient.git (push)
36 origin ssh://jruzicka@pkgs.fedoraproject.org/python-openstackclient (fetch)
37 origin ssh://jruzicka@pkgs.fedoraproject.org/python-openstackclient (push)
38 patches git@github.com:redhat-openstack/python-openstackclient.git (fetch)
39 patches git@github.com:redhat-openstack/python-openstackclient.git (push)
40
41 Let’s assume we see the package for the first time and we want to check
42 whether its requirements are met.
43
44 $ rdopkg pkgenv
45 Package: python-openstackclient
46 Version: 1.0.3
47 Upstream: 1.1.0
48 OS dist: RDO
49
50 Dist-git branch: master
51 Local patches branch: master-patches
52 Remote patches branch: patches/master-patches
53 Remote upstream branch: openstack/master
54
55 RDO release/dist guess: kilo/f22
56
57 Now we know that
58
59 · package is at version 1.0.3 while upstream is at 1.1.0
60
61 · rdopkg was able to detect the upstream remote/branch (automagic
62 works)
63
64 · master branch currently corresponds to Kilo release (see rdopkg
65 info)
66
67 so we can start inspecting the requirements.
68
70 rdopkg reqdiff
71
72 reqdiff shows a human friendly summary of changes to requirements.txt
73 file between two git refs (usually version tags).
74
75 When patches and upstream remotes are set correctly, the action can be
76 run without arguments and rdopkg will do a diff between current and
77 latest upstream versions:
78
79 $ rdopkg reqdiff
80 requirements.txt diff between 1.0.3 and 1.1.0:
81
82 ADDED:
83 os-client-config
84
85 CHANGED:
86 cliff >=1.10.0 (was >=1.7.0)
87 oslo.config >=1.9.3 (was >=1.9.0)
88 oslo.i18n >=1.5.0 (was >=1.3.0)
89 oslo.serialization >=1.4.0 (was >=1.2.0)
90 oslo.utils >=1.4.0 (was >=1.2.0)
91 python-novaclient >=2.22.0 (was >=2.18.0,!=2.21.0)
92 stevedore >=1.3.0 (was >=1.1.0)
93
94 With one argument, diff between current package version and supplied
95 git ref is done:
96
97 $ rdopkg reqdiff 1.1.0
98 requirements.txt diff between 1.0.3 and 1.1.0:
99 ...
100
101 Finally, we can supply two git refs to get requirements.txt diff
102 between them:
103
104 $ rdopkg reqdiff 0.4.0 1.0.0
105 requirements.txt diff between 0.4.0 and 1.0.0:
106
107 ADDED:
108 Babel >=1.3
109 cliff-tablib >=1.0
110 oslo.i18n >=1.0.0
111 oslo.serialization >=1.0.0
112 oslo.utils >=1.0.0
113 python-neutronclient >=2.3.6,<3
114 stevedore >=1.1.0
115
116 CHANGED:
117 cliff >=1.7.0 (was >=1.4.3)
118 python-cinderclient >=1.1.0 (was >=1.0.6)
119 python-glanceclient >=0.14.0 (was >=0.9.0)
120 python-keystoneclient >=0.11.1 (was >=0.9.0)
121 python-novaclient >=2.18.0 (was >=2.17.0)
122 requests >=2.2.0,!=2.4.0 (was >=1.1)
123
124 REMOVED:
125 keyring >=2.1
126 pycrypto >=2.6
127
128 Note that reqdiff is automatically shown during rdopkg new-version.
129
131 rdopkg reqcheck
132
133 reqcheck is used to check whether requires defined in requirements.txt
134 are met in the .spec file. Human friendly summary is printed.
135
136 $ rdopkg reqcheck
137
138 VERSION NOT ENFORCED:
139 python-babel >=1.3
140 python-cliff >=1.7.0
141 python-oslo-i18n >=1.3.0
142 python-oslo-serialization >=1.2.0
143 python-oslo-utils >=1.2.0
144 python-pbr >=0.6,!=0.7,<1.0
145 python-cinderclient >=1.1.0
146 python-glanceclient >=0.15.0
147 python-keystoneclient >=1.1.0
148 python-neutronclient >=2.3.11,<3
149 python-novaclient >=2.18.0,!=2.21.0
150 python-requests >=2.2.0,!=2.4.0
151 python-six >=1.9.0
152 python-stevedore >=1.1.0
153
154 MISSING:
155 python-cliff-tablib >=1.0
156 python-oslo-config >=1.9.0
157
158 Human brain superpowers are used to evaluate the report and fix the
159 .spec file if needed.
160
162 rdopkg query
163
164 Is package X available in RDO? At which version? rdopkg query was
165 created to answer these recurring questions.
166
167 We can query a specific release/dist:
168
169 $ rdopkg query kilo/f22 python-novaclient
170 kilo/f22
171 python-novaclient-2.23.0-1.fc23 @ RDO Kilo f22
172 python-novaclient-2.20.0-1.fc22 @ Fedora 22
173
174 We now see that python-novaclient-2.20.0-1 is present in base Fedora 22
175 repo but newer python-novaclient-2.23.0-1 is available from RDO Kilo
176 f22 repo.
177
178 We can also query a package across all dists of an RDO release. We
179 might want to use -v/--verbose to see what’s happening in the
180 background:
181
182 $ rdopkg query -v kilo python-novaclient
183
184 repoquery --nvr --repofrompath=rdopkg_RDO_Kilo_f22,...
185 RDO Kilo f22: python-novaclient-2.23.0-1.fc23
186 repoquery --nvr --repofrompath=rdopkg_Fedora_22_Updates,...
187 ...
188
189 kilo/f22
190 python-novaclient-2.23.0-1.fc23 @ RDO Kilo f22
191 python-novaclient-2.20.0-1.fc22 @ Fedora 22
192 kilo/f21
193 python-novaclient-2.23.0-1.fc23 @ RDO Kilo f21
194 python-novaclient-2.17.0-3.fc21 @ Fedora 21
195 kilo/el7
196 python-novaclient-2.23.0-1.el7 @ RDO Kilo el7
197
198 See rdopkg info to get supported release/dist combinations.
199
201 rdopkg reqquery
202
203 reqquery queries versions of requirements.txt or .spec Requires in RDO
204 repos and provides colorful report to easily check whether dependencies
205 are available and in correct versions.
206
207 Simplest use case without arguments queries all requirements.txt of
208 current package version in autodetected release/dist:
209
210 $ rdopkg reqquery
211 Autodetected filter: kilo/f22
212 Querying requirements file from git: 1.0.3 -- requirements.txt
213
214 kilo/f22
215 pbr
216 nvr: python-pbr-0.10.8-1.fc22
217 need: >=0.6,!=0.7,<1.0
218 state: OK
219 python-novaclient
220 nvr: python-novaclient-2.23.0-1.fc23
221 need: >=2.18.0,!=2.21.0
222 state: OK
223 cliff-tablib
224 nvr: python-cliff-tablib not available
225 need: >=1.0
226 state: not met
227 ...
228
229 We can also select the release/dist filter manually (see rdopkg info):
230
231 $ rdopkg reqquery kilo/el7
232
233 By default, current version requirements.txt are used, but we can
234 select a different requirements source:
235
236 · git ref (version):
237
238 $ rdopkg reqquery -R 1.2.3
239
240 · file:
241
242 $ rdopkg reqquery -r path/to/requirements.txt
243
244 · from current .spec file:
245
246 $ rdopkg reqquery -s
247
248 As it usually takes quite some time to repoquery all the repos, we
249 might want to run with -v/--verbose, dump to requirements.yml with
250 -d/--dump and then view the report with -l/--load:
251
252 $ rdopkg reqquery -v -d
253 Autodetected filter: kilo/f22
254 Querying requirements file from git: 1.0.3 -- requirements.txt
255
256 repoquery --nvr --repofrompath=...
257 RDO Kilo f22: N/A
258 ...
259
260 $ rdopkg reqquery -l
261
263 See rdopkg ACTION -h to get options for each ACTION.
264
265 See rdopkg(1) manual for more information.
266
267
268
269 08/21/2020 RDOPKG-ADV-REQUIRE(7)