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 {
79
79
80
80
#[ derive( clap:: Args , Debug ) ]
81
81
pub 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.
83
87
pub app_name : String ,
84
88
85
89
/// 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(
312
312
. chain ( main_world)
313
313
. collect :: < IndexSet < _ > > ( ) ;
314
314
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
+
315
322
let summary = Summary :: try_new (
316
323
& resolve,
317
324
& worlds,
You can’t perform that action at this time.
0 commit comments