Skip to content
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

Packaging monorepo's sources #735

Open
koltyakov opened this issue Feb 6, 2024 · 0 comments
Open

Packaging monorepo's sources #735

koltyakov opened this issue Feb 6, 2024 · 0 comments

Comments

@koltyakov
Copy link

koltyakov commented Feb 6, 2024

I'm struggling configuring PyOxidizer for a monorepo scenario.

My project has the following structure:

  • proj1
    • cli
    • lib
      • module1
      • module2
      • ...
    • ui
    • pyoxidizer.bzl
    • ... [lot of things]
  • proj2
  • ...

The intention is to bundle executable for the proj1's CLI. CLI code imports some submodules, e.g. proj1.lib.module1.

exe.read_package_root doesn't seem to be a lot help. E.g.:

exe.add_python_resources(exe.read_package_root(
  path = ".",
  packages = ["cli"],
))

exe.add_python_resources(exe.read_package_root(
  path = "./lib",
  packages = ["module1"],
))

will end up copying cli and module1 packages to the top level, where from proj1.lib.module1 imports won't be resolved.

The only workaround worked was copying needed modules to a temp folder:

  • dist
    • proj1
      • cli
      • lib
        • module1
exe.add_python_resources(exe.read_package_root(
  path = "./dist",
  packages = ["proj1"],
))

Which seems too dirty and needs an extra configuration layer before running pyoxidizer build.

Would appreciate an example if it's feasible to package sources for such case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant