by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Tom
    @t-arn
    @freakboy3742 I would like to write iOS apps with Python, but I don't want to buy a Mac. I know that it is possible to write Xamarin iOS apps on a Windows PC and build therm
    ...build them in the cloud, e.g. with appcenter.ms You only need a Mac once when you upload the app the first time to AppStore or TestFlight. Snx
    And this one time, you can use MacInCloud. Is this also possible with BeeWare
    Tom
    @t-arn
    ...I mean, is it possible to create an iOS Python app on Windows and build it in the cloud with BeeWare?
    Russell Keith-Magee
    @freakboy3742
    @t-arn Sure - Github Actions, for example, ships with an Xcode install, so you could use Briefcase in a CI environment to generate and build an iOS binary. Briefcase can’t currently automate the process of pushing that binary to the App Store, but that’s something that we want to add.
    Tom
    @t-arn
    Do you know if it works with other cloud services as well? I prefer BitBucket or appcenter.ms. And how do you get Briefcase into those cloud services? Does it only work for cloud services that support BeeWare explicitly?
    Russell Keith-Magee
    @freakboy3742
    So, you’ll need a CI service that provides Mac hosting. Github actions does; Travis CI does; azure cloud does; can’t speak to any others.
    As for “briefcase support” - it’s a pip installable package, so as long as you can set up a Python environment and pip install briefcase, you’re set.
    Anushka Trivedi
    @opheliagame
    Hey I'm trying to build an app and I need to access app data for it. I see that there is a resources module inside the app module. Should I keep the files inside that, and then how should I access them?
    @freakboy3742 would it make sense to use tensorflow, keras as dependencies of the app and then making an android version?
    MarkoTammeorg
    @MarkoTammeorg
    Hi,
    MarkoTammeorg
    @MarkoTammeorg
    Hi, I need some help with an issue. I'm trying to package a binary on Linux using docker. I manage to run the command "docker run - it - v..." and then then install the rest of the necessary requirements but then after I try to create a briefcase I get an ERROR : Could not find dependency:libcrypto. So. 1.0.0
    MarkoTammeorg
    @MarkoTammeorg
    I should have mentioned, I'm working on Ubuntu 20.04
    Tom
    @t-arn
    @freakboy3742 Thank you! Wouldn't that be a good subject for a tutorial? :-)
    Russell Keith-Magee
    @freakboy3742
    @opheliagame The Resources folder is a convenient location; but you can use any file location you want. If you want to store user configuration, cache or log files, you might want to use the app.paths attribute; that gives a number of operating-system level paths for storing files. As for “how” - you can use any normal Python file system operations.
    @opheliagame I’d be very hesitant to recommend any package with binary modules for mobile distribution at this point. It’s certainly possible to get them to work, but it’s not simple - you need to know a lot about Android tooling. You definitely can’t “just pip install” something like Keras or Tensorflow.
    @MarkoTammeorg If you’re seeing that error, it means there’s some discrepancy between your build environment and the support package. We’ve seen a lot of that on Linux; and so, we’ve recently modified the Linux build to internally use Docker by default.
    It will be in the 0.3.1 release; but if you install from Github, you can get those features right now. It manages docker in the background, so as an end developer you only need to run “briefcase build” etc.
    Russell Keith-Magee
    @freakboy3742
    @t-arn Completely agreed! Are you volunteering :-)
    In all seriousness - it’s on our list; we’ve just got a lot of stuff on that list :-)
    Russell Keith-Magee
    @freakboy3742
    @t-arn And beeware/briefcase#400 logs it as a feature request
    Russell Keith-Magee
    @freakboy3742
    Hey folks: there’s an ongoing discussion about a possible API to retrieve elements in a Toga GUI by ID: beeware/toga#930 - if that sounds like something you might have opinions about, we’d love to hear them.
    dgelessus
    @dgelessus

    ... hey, wouldn't this be the perfect use case for Python 3.8's assignment expressions?

    In [5]: self.content = Box( 
       ...:     children=[ 
       ...:         (self.sub_box := Box()), 
       ...:     ], 
       ...: )                                                                                           
      File "<ipython-input-5-f6395d37c8f1>", line 3
        (self.sub_box := Box()),
         ^
    SyntaxError: cannot use assignment expressions with attribute

    ... oh.

    Russell Keith-Magee
    @freakboy3742
    awww… :-(
    Tollis Hunt
    @MrSassyBritches

    aight folks, i used the briefcase tool to bootstrap my and this was generated

    My first application
    """
    import toga
    from toga.style import Pack
    from toga.style.pack import COLUMN, ROW
    
    
    class ControlPanel(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.
            """
            main_box = toga.Box()
    
            self.main_window = toga.MainWindow(title=self.formal_name)
            self.main_window.content = main_box
            self.main_window.show()

    But its telling me there is no module toga.style
    ModuleNotFoundError: No module named 'toga.style'

    Russell Keith-Magee
    @freakboy3742
    @MrSassyBritches Ok - the code you’re showing is for Toga 0.3 (which is what briefcase uses by default); however, the “no module named toga.style” error means your environment has Toga 0.2
    Tollis Hunt
    @MrSassyBritches
    oh boy
    alright let me do some sluething
    Russell Keith-Magee
    @freakboy3742
    This usually means you’ve either manually installed Toga and not provided the --pre argument, or you haven’t specified a explicit version of toga in your requirements.
    Usually, pip install -U --pre toga will fix it in your local environment.
    Tollis Hunt
    @MrSassyBritches
    im using pycharm so would i be looking for this one specifically?
    image.png
    Russell Keith-Magee
    @freakboy3742
    No - dev19 is the most recent version.
    Tollis Hunt
    @MrSassyBritches
    ha the sorting is messed up in this
    thanks
    Tollis Hunt
    @MrSassyBritches
    what does it mean to need a formal name i checked the the toml file, it has one.
    Russell Keith-Magee
    @freakboy3742
    Well, the short answer is that “you need a formal name” - but it’s impossible to clarify more without knowing what you’re doing - e.g., which tutorial you’re following.
    Based on the errors you’re getting, you’re not doing the Briefcase tutorial or the Toga tutorial - so… what instructions are you following?
    Russell Keith-Magee
    @freakboy3742
    The short answer is "the error message you’re getting is 100% correct - but the reason you’re seeing it “depends”.
    Tollis Hunt
    @MrSassyBritches
    lol alright
    depends on what?
    Russell Keith-Magee
    @freakboy3742
    Ok - so you’re doing the briefcase tutorial.
    So: the question becomes - how did you get toga 0.2 installed? Because if you’re following that tutorial, you shouldn’t have installed toga manually at all.
    I’m going to guess you’re trying to use the run button in Pycharm
    Which won’t work.
    Tollis Hunt
    @MrSassyBritches
    ah
    Russell Keith-Magee
    @freakboy3742
    You really do need to follow the tutorial as it’s written.
    axel-kah
    @axel-kah

    Hi,
    I've worked with pyinstaller + pyqt before and wanted to give beeware/toga/briefcase a shot and worked through the beeware tutorial yesterday. I did manage to build the tutorial app on Linux Mint 19.3 with briefcase 0.3.0 eventually but the briefcase create and briefcase build steps were not smooth at all. The rest is really well written though.
    I first tried option 3 (using docker as instructed) but was facing the issue that briefcase build was bailing out because the linuxdeploy AppImage was seemingly not executable inside a docker container (not a permission problem, and known to the linuxdeploy team).
    Then I tried option 4 (building the support package using docker). It worked but it was not obvious from the docs what to do with the build output. Found an issue which hinted at copying stuff into the project folder. Felt very hackish and could not find docs mentioning how to cleanly integrate custom build support packages.
    Then I found a message from @freakboy3742 mentioning that in the git master docker is called in the background when using briefcase on linux. Sounded like a nice idea and tried it out. Unfortunately it bailed out on me almost at the very end of the briefcase create call when adding the user:

    Step 12/16 : ARG HOST_UID
     ---> Running in 063a424d6a86
    Removing intermediate container 063a424d6a86
     ---> 4657e96c180d
    Step 13/16 : ARG HOST_GID
     ---> Running in a59336d3cdb7
    Removing intermediate container a59336d3cdb7
     ---> 4fede95af7ee
    Step 14/16 : RUN groupadd --gid $HOST_GID briefcase || true
     ---> Running in bb37131e7a73
    groupadd: GID '0' already exists
    Removing intermediate container bb37131e7a73
     ---> a94d6f409c76
    Step 15/16 : RUN useradd --uid $HOST_UID --gid $HOST_GID brutus --home /home/brutus
     ---> Running in 55dc8b2957d8
    useradd: UID 0 is not unique
    The command '/bin/sh -c useradd --uid $HOST_UID --gid $HOST_GID brutus --home /home/brutus' returned a non-zero code: 4
    
    Error building Docker container for helloworld.

    Is that feature known to be broken or can I do anything to debug this?

    Russell Keith-Magee
    @freakboy3742
    @axel-kah That’s a new bug - can’t say I’ve seen that one before.