-
-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for briefcase run
to examples
#1995
Conversation
74c5117
to
a0c38d8
Compare
a0c38d8
to
68ac31a
Compare
- Use `ThreadingHTTPServer` since it has much better support on Windows than `HTTPServer`; this was also experienced when web support was added to Briefcase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're working on another badge for your scout blanket :-)
Very thorough - nice catch on the handful of cleanups. One question on the postitron-static example, and a request for non-empty changelog/license files ,and I think this is good to go.
examples/activityindicator/CHANGELOG
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty files are a bit weird; it would be desirable to have at least some dummy content:
See Toga releases for change notes.
examples/activityindicator/LICENSE
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LICENSE files definitely can't be empty - I'm sure someone would choose to interpret this as "this code is free for all", and decide that applies to the entire Toga repo.
Released under the same license as Toga. See the root of the Toga repository for details.
@@ -9,7 +9,7 @@ def translate_path(self, path): | |||
return str(self.server.base_path / path[1:]) | |||
|
|||
|
|||
class LocalHTTPServer(HTTPServer): | |||
class LocalHTTPServer(ThreadingHTTPServer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a required change, or just one that seemed like a good idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit has a bit of this information but this was behaving strangely on Windows. The first few times I tried to start it, it would log "Starting server..." but not start serving the static page. After messing around with it for a bit, it seemed that after waiting a while, it would start working. But even then, it would often hang when trying to shutdown the server.
This was a lot of what we encountered when we added the web server for briefcase run web
. Basically, it was a mess on Windows until we started using the ThreadingHTTPServer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - I missed that the explanatory detail was in the commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Changes
briefcase run
to work for the examples for as many platforms and output formats as reasonablebriefcase run
sincepython -m
andbriefcase dev
aren't entirely native.NOTE: This is easiest to review each commit individually.
Limitations
--target
implies all the necessary packages are already installed on the host system--target
would require adding the appropriatesystem_requires
to all thepyproject.toml
and that just seems like a lot to maintainpyproject.toml
.sed
command could be used to update these, the use-case for building these formats for these examples is weakPR Checklist: