-
-
Notifications
You must be signed in to change notification settings - Fork 474
Description
What is the problem or limitation you are having?
While I was working on the integration of the .pth files for a remote debug feature, I dived deep into the different platforms supported by briefcase. I realized how differently all platforms work.
What surprised me the most is why briefcase does not use the official site-packages folder at all, but always works with an app and app_packages folder. As I understand it, this is only to enable the three cases to be executed independently of one another:
briefcase run --update: Update the application’s source codebriefcase run --update-requirements: Update application requirementsbriefcase run --update-support: Update application support package
Is this generally correct or am I missing something?
Describe the solution you'd like
If this is the only reason, isn't there a way to use the official site-packages folder and still keep the CLI parameters the same for the users? For example, just change the logic like this:
briefcase run --update: Create a .whl of the current app code (e.g.helloworld-0.0.1-py3-none-any.whl) and then do apip install helloworld-0.0.1-py3-none-any.whl --target {site_packages_folder}to update only the app code.briefcase run --update-requirements: Updates all other packages specified in pyproject.toml underrequiresviapip install -r requirements.txt --target {site_packages_folder}. The app code remains the same, because it is not listed underrequires.briefcase run --update-support: Copies thesite-packagesfolder to a temporary location, then replaces the old with the new support package and then copies the savedsite-packagesfolder back to the original location.
I know that this would be a lot of work, because besides briefcase itself all briefcase templates would have to be adapted. But using the site-packages folder would be closer to the default behavior of Python and from my point of view a significant improvement.
Describe alternatives you've considered
Leave everything as it is. It works, but it's more complicated to understand, as many specific adjustments are required. Furthermore, adding .pth files is more complicated than necessary, as on some platforms they're only found in the site-packages folder and not in app_packages (see here).
Additional context
This topic has already been discussed here and here, but I couldn't find an explicit ticket for this proposal. I also found the comments here and here on this topic, but they don't offer much added value.