| 7 | |
| 8 | |
| 9 | def _binary_path() -> str: |
| 10 | executable = "deepnote.exe" if os.name == "nt" else "deepnote" |
| 11 | path = files("deepnote_cli").joinpath("bin", executable) |
| 12 | |
| 13 | if not path.is_file(): |
| 14 | raise FileNotFoundError( |
| 15 | f"Bundled executable not found at {path}. " |
| 16 | "This wheel may be incomplete or built incorrectly." |
| 17 | ) |
| 18 | |
| 19 | # Ensure executable bit is set on POSIX systems. |
| 20 | if os.name != "nt": |
| 21 | path_str = str(path) |
| 22 | if not os.access(path_str, os.X_OK): |
| 23 | current_mode = os.stat(path_str).st_mode |
| 24 | os.chmod(path_str, current_mode | 0o111) |
| 25 | |
| 26 | return str(path) |
| 27 | |
| 28 | |
| 29 | def main() -> int: |