Return
(m, um)
| 1239 | |
| 1240 | |
| 1241 | def buildmodule(m, um): |
| 1242 | """ |
| 1243 | Return |
| 1244 | """ |
| 1245 | outmess(' Building module "%s"...\n' % (m['name'])) |
| 1246 | ret = {} |
| 1247 | mod_rules = defmod_rules[:] |
| 1248 | vrd = capi_maps.modsign2map(m) |
| 1249 | rd = dictappend({'f2py_version': f2py_version}, vrd) |
| 1250 | funcwrappers = [] |
| 1251 | funcwrappers2 = [] # F90 codes |
| 1252 | for n in m['interfaced']: |
| 1253 | nb = None |
| 1254 | for bi in m['body']: |
| 1255 | if bi['block'] not in ['interface', 'abstract interface']: |
| 1256 | errmess('buildmodule: Expected interface block. Skipping.\n') |
| 1257 | continue |
| 1258 | for b in bi['body']: |
| 1259 | if b['name'] == n: |
| 1260 | nb = b |
| 1261 | break |
| 1262 | |
| 1263 | if not nb: |
| 1264 | print( |
| 1265 | 'buildmodule: Could not find the body of interfaced routine "%s". Skipping.\n' % (n), file=sys.stderr) |
| 1266 | continue |
| 1267 | nb_list = [nb] |
| 1268 | if 'entry' in nb: |
| 1269 | for k, a in nb['entry'].items(): |
| 1270 | nb1 = copy.deepcopy(nb) |
| 1271 | del nb1['entry'] |
| 1272 | nb1['name'] = k |
| 1273 | nb1['args'] = a |
| 1274 | nb_list.append(nb1) |
| 1275 | for nb in nb_list: |
| 1276 | # requiresf90wrapper must be called before buildapi as it |
| 1277 | # rewrites assumed shape arrays as automatic arrays. |
| 1278 | isf90 = requiresf90wrapper(nb) |
| 1279 | # options is in scope here |
| 1280 | if options['emptygen']: |
| 1281 | b_path = options['buildpath'] |
| 1282 | m_name = vrd['modulename'] |
| 1283 | outmess(' Generating possibly empty wrappers"\n') |
| 1284 | Path(f"{b_path}/{vrd['coutput']}").touch() |
| 1285 | if isf90: |
| 1286 | # f77 + f90 wrappers |
| 1287 | outmess(f' Maybe empty "{m_name}-f2pywrappers2.f90"\n') |
| 1288 | Path(f'{b_path}/{m_name}-f2pywrappers2.f90').touch() |
| 1289 | outmess(f' Maybe empty "{m_name}-f2pywrappers.f"\n') |
| 1290 | Path(f'{b_path}/{m_name}-f2pywrappers.f').touch() |
| 1291 | else: |
| 1292 | # only f77 wrappers |
| 1293 | outmess(f' Maybe empty "{m_name}-f2pywrappers.f"\n') |
| 1294 | Path(f'{b_path}/{m_name}-f2pywrappers.f').touch() |
| 1295 | api, wrap = buildapi(nb) |
| 1296 | if wrap: |
| 1297 | if isf90: |
| 1298 | funcwrappers2.append(wrap) |
nothing calls this directly
no test coverage detected