briefcase: Problem getting an app with bcrypt to run

Describe the bug

I have a very simple app I’m trying to write that uses paramiko for SSH. It crashes on startup in the simulator with an ImportError.

Steps to reproduce

This is my code:

import paramiko
import toga
from paramiko.client import (
    WarningPolicy,
)
from toga.style import Pack
from toga.style.pack import COLUMN


class RebootShow(toga.App):

    def startup(self):
        """
        Construct and show the Toga application.

        Usually, you would add your application to a main content box.
        We then create a main window (with a name matching the app), and
        show the main window.
        """
        self.reboot_show(1)
        main_box = toga.Box(style=Pack(direction=COLUMN))

        button = toga.Button(
            "Reboot Show",
            on_press=self.reboot_show,
            style=Pack(padding=5)
        )

        main_box.add(button)

        self.main_window = toga.MainWindow(title=self.formal_name)
        self.main_window.content = main_box
        self.main_window.show()

    def reboot_show(self, widget):
        client = paramiko.SSHClient()
        client.set_missing_host_key_policy(WarningPolicy)
        client.connect('******', username='boxed', password='******')
        ssh_stdin, ssh_stdout, ssh_stderr = client.exec_command("""osascript -e 'tell app "System Events" to restart'""")
        print(ssh_stdout.read(), ssh_stderr.read())


def main():
    return RebootShow()

with hostname and password censored.

Expected behavior

No crash

Screenshots

No response

Environment

  • Operating System: macOS
  • Python version: 3.9. Also tried 3.10 before.
  • Software versions:
    • Briefcase: 0.3.14
    • Toga: 0.3.1

Logs

briefcase.2023_04_16-19_52_55.run.log

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

/me facepalms… paramiko is an SSH client, so this is running osascript on the remote machine. As long as paramiko isn’t using subprocesses, it should be fine.

huh. I did rm -rf build/ and rebuilt with the -r flag. The app starts.