Replies: 3 comments 1 reply
-
I'd move |
Beta Was this translation helpful? Give feedback.
-
Moving |
Beta Was this translation helpful? Give feedback.
-
After testing this in a dummy project, I found some unexpected behavior. To answer your question, the script is placed as an executable |
Beta Was this translation helpful? Give feedback.
-
As far as I've tried, including scripts from inside the python/package directory slows down their help messages since they always import the package first (running everything in
__init__.py
). Before I had a need for Rust in my library, I could avoid this via poetry with the following layout:The
cli.py
script looks like this to avoid slow imports for--help
:And including
cli:app
as an entrypoint:Moving to a maturin mixed project now, this breaks with the follow error:
$ project --help Traceback... from cli import app ModuleNotFoundError: No module named 'cli'
Thus, I've had to go back to including the CLI in the python/project directory and this slows down the help message responsiveness by several seconds. This is not a deal breaker, but it would be great to be able to do this. Otherwise, I'm curious if there are other workarounds to improve help message responsiveness that are compatible with maturin. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions