Closed Jhsmit closed 6 months ago
What about the following?
Similar to https://github.com/widgetti/solara/blob/defe64c22216b01b930b7a05744c807f5b7f6e7c/solara/__main__.py#L726 you split everything before and after --
.
Everything before --
you pass to yourself, and everything after it, you pass to solara. This way you can do
$ mypackage run --config config_file.yaml -- port 8777
Does that help you?
Yes, then how would i start solara from my entry point? something like this?
import subprocess
def run(config, *args):
subprocess.run("solara", "run", "path/to/app.py", *args)
You can do it in the same process, you can call it like we do here: https://github.com/widgetti/solara/blob/defe64c22216b01b930b7a05744c807f5b7f6e7c/solara/__main__.py#L730
Could you add (perma) links here to your code once you implemented this, I think more people would want this!
yes, if I remember when i make it public. hopefully soon
I've developed a python package which includes a solara web application. I would like my users to be able to do the following:
Which would then launch the solara web app with the specified config file.
On the python side it would be something like this:
At the moment what is do is
solara run path/to/mypackage/app.py --config config.yaml
and then catch the argument in app.py but 1) users who installmypackage
won't have direct access to the correct path since it'll be somewhere in site-packages 2) I cannot provide any--help
for the config option 3) there can be conficts between solara and mypackage options