File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,11 @@ pub enum Command {
7979
8080#[ derive( clap:: Args , Debug ) ]
8181pub struct Componentize {
82- /// The name of a Python module containing the app to wrap
82+ /// The name of a Python module containing the app to wrap.
83+ ///
84+ /// Note that this should not match (any of) the world name(s) you are targeting since `componentize-py` will
85+ /// generate code using those name(s), and Python doesn't know how to load two top-level modules with the same
86+ /// name.
8387 pub app_name : String ,
8488
8589 /// Specify a directory containing the app and/or its dependencies. May be specified more than once.
Original file line number Diff line number Diff line change @@ -312,6 +312,13 @@ pub async fn componentize(
312312 . chain ( main_world)
313313 . collect :: < IndexSet < _ > > ( ) ;
314314
315+ if worlds
316+ . iter ( )
317+ . any ( |& id| app_name == resolve. worlds [ id] . name . to_snake_case ( ) . escape ( ) )
318+ {
319+ bail ! ( "App name `{app_name}` conflicts with world name; please rename your application module." ) ;
320+ }
321+
315322 let summary = Summary :: try_new (
316323 & resolve,
317324 & worlds,
You can’t perform that action at this time.
0 commit comments