powerful-boots-1234
07/12/2021, 1:07 PMmultiple-applications
, which seems to run into an issue with the same module name being used for two applications. With project-app/app.py and project-app-async/app.py I get the following:
./pants run project-app:project-app
15:02:53.57 [WARN] The pex_binary target project-app has the field `entry_point='app.py'`, which maps to the Python module `app`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['project-app-async/app.py:project-app-async0', 'project-app/app.py:project-app0'].
I haven't seen how to fix this without changing the name of the file and that's not really a solution. I tried to make entry_point='project-app/app.py:project-app0'
but that didn't work so the error message is a bit weird that it looks like it wants me to specify which target resolution to use but then it won't let me use the target resolution (is that even a name for this?)hundreds-father-404
07/12/2021, 2:08 PMhundreds-father-404
07/12/2021, 2:22 PMhundreds-father-404
07/12/2021, 2:28 PMLike with the sources field, file paths are relative to the BUILD file, rather than the build root.@happy-kitchen-89482 wdyt?
enough-analyst-54434
07/12/2021, 2:36 PM$ git diff
diff --git a/multirepo-1/project-app/BUILD b/multirepo-1/project-app/BUILD
index 1bdec0d..5250340 100644
--- a/multirepo-1/project-app/BUILD
+++ b/multirepo-1/project-app/BUILD
@@ -2,8 +2,11 @@ poetry_requirements()
pex_binary(
name="project-app",
- entry_point="app.py",
- zip_safe=False
+ entry_point="app",
+ zip_safe=False,
+ dependencies=[
+ ':project-app0',
+ ],
)
python_library(
enough-analyst-54434
07/12/2021, 2:37 PMpowerful-boots-1234
07/12/2021, 3:30 PMHm that definitely should have fixed it. What do you mean by didn't work?
Exception message: 1 Exception encountered:
Exception: Unmatched glob from project-app's `entry_point` field: "project-app/project-app/app.py"
powerful-boots-1234
07/12/2021, 3:34 PMValueError: ("EntryPoint must be in 'name=module:attrs [extras]' format", 'run = app:project-app0')
happy-kitchen-89482
07/12/2021, 3:47 PMpowerful-boots-1234
07/12/2021, 4:02 PMenough-analyst-54434
07/12/2021, 4:08 PMenough-analyst-54434
07/12/2021, 4:08 PMpowerful-boots-1234
07/12/2021, 4:15 PMenough-analyst-54434
07/12/2021, 4:21 PMenough-analyst-54434
07/12/2021, 4:34 PMpowerful-boots-1234
07/12/2021, 4:39 PMpowerful-boots-1234
07/12/2021, 4:40 PMnice-france-74763
07/12/2021, 5:25 PMpowerful-boots-1234
07/12/2021, 5:34 PMhundreds-father-404
07/13/2021, 12:12 AM