| 203 | |
| 204 | @classmethod |
| 205 | def wheel( |
| 206 | cls, |
| 207 | destination, # type: str |
| 208 | wheel, # type: Union[Wheel, InstallableWheel] |
| 209 | ): |
| 210 | # type: (...) -> InstallPaths |
| 211 | |
| 212 | data = os.path.join( |
| 213 | destination, "{wheel_prefix}.data".format(wheel_prefix=wheel.wheel_prefix) |
| 214 | ) |
| 215 | |
| 216 | if wheel.root_is_purelib: |
| 217 | purelib = destination |
| 218 | platlib = os.path.join(data, "platlib") |
| 219 | path_names = ("headers", "scripts", "platlib", "data", "purelib") |
| 220 | else: |
| 221 | purelib = os.path.join(data, "purelib") |
| 222 | platlib = destination |
| 223 | path_names = ("headers", "scripts", "purelib", "data", "platlib") |
| 224 | |
| 225 | return cls( |
| 226 | purelib=purelib, |
| 227 | platlib=platlib, |
| 228 | headers=os.path.join(data, "headers"), |
| 229 | scripts=os.path.join(data, "scripts"), |
| 230 | data=os.path.join(data, "data"), |
| 231 | path_names=path_names, |
| 232 | ) |
| 233 | |
| 234 | purelib = attr.ib() # type: str |
| 235 | platlib = attr.ib() # type: str |