Filename suffix for shared libraries is defined in pep-3149. The pep claims to only address posix systems, but the recommended sysconfig.get_config_var('EXT_SUFFIX') also seems to give the right string on Windows. If use_so_versioning is false, we return only the last comp
(use_so_versioning=True)
| 3136 | |
| 3137 | |
| 3138 | def _so_suffix(use_so_versioning=True): |
| 3139 | ''' |
| 3140 | Filename suffix for shared libraries is defined in pep-3149. The |
| 3141 | pep claims to only address posix systems, but the recommended |
| 3142 | sysconfig.get_config_var('EXT_SUFFIX') also seems to give the |
| 3143 | right string on Windows. |
| 3144 | |
| 3145 | If use_so_versioning is false, we return only the last component of |
| 3146 | the suffix, which removes any version number, for example changing |
| 3147 | `.cp312-win_amd64.pyd` to `.pyd`. |
| 3148 | ''' |
| 3149 | # Example values: |
| 3150 | # linux: .cpython-311-x86_64-linux-gnu.so |
| 3151 | # macos: .cpython-311-darwin.so |
| 3152 | # openbsd: .cpython-310.so |
| 3153 | # windows .cp311-win_amd64.pyd |
| 3154 | # |
| 3155 | # Only Linux and Windows seem to identify the cpu. For example shared |
| 3156 | # libraries in numpy-1.25.2-cp311-cp311-macosx_11_0_arm64.whl are called |
| 3157 | # things like `numpy/core/_simd.cpython-311-darwin.so`. |
| 3158 | # |
| 3159 | ret = sysconfig.get_config_var('EXT_SUFFIX') |
| 3160 | if not use_so_versioning: |
| 3161 | # Use last component only. |
| 3162 | ret = os.path.splitext(ret)[1] |
| 3163 | return ret |
| 3164 | |
| 3165 | |
| 3166 | def get_soname(path): |
no outgoing calls
no test coverage detected
searching dependent graphs…