MCPcopy Create free account
hub / github.com/numpy/numpy / get_api_versions

Function get_api_versions

numpy/core/setup_common.py:63–82  ·  view source on GitHub ↗

Return current C API checksum and the recorded checksum. Return current C API checksum and the recorded checksum for the given version of the C API version.

(apiversion, codegen_dir)

Source from the content-addressed store, hash-verified

61
62
63def get_api_versions(apiversion, codegen_dir):
64 """
65 Return current C API checksum and the recorded checksum.
66
67 Return current C API checksum and the recorded checksum for the given
68 version of the C API version.
69
70 """
71 # Compute the hash of the current API as defined in the .txt files in
72 # code_generators
73 sys.path.insert(0, codegen_dir)
74 try:
75 m = __import__('genapi')
76 numpy_api = __import__('numpy_api')
77 curapi_hash = m.fullapi_hash(numpy_api.full_api)
78 apis_hash = m.get_versions_hash()
79 finally:
80 del sys.path[0]
81
82 return curapi_hash, apis_hash[apiversion]
83
84def check_api_version(apiversion, codegen_dir):
85 """Emits a MismatchCAPIWarning if the C API version needs updating."""

Callers 1

check_api_versionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected