Skip to content

Use site-packages folder instead of app and app_packages #2195

@timrid

Description

@timrid

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:

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 a pip 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 under requires via pip install -r requirements.txt --target {site_packages_folder}. The app code remains the same, because it is not listed under requires.
  • briefcase run --update-support: Copies the site-packages folder to a temporary location, then replaces the old with the new support package and then copies the saved site-packages folder 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, or improvements to existing features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions