typer
typer copied to clipboard
✨ Allow running scripts that import other scripts with `typer` command
Issue
typer command cannot run a script which imports other scripts in the same directory, or in the subdirectory.
The original problem comes from https://github.com/tiangolo/typer-cli/discussions/142, and I still can reproduce this with typer version 0.12.3.
Changes I Made
- add
sys.path.append(str(state.file.parent))beforeexec_module - add a test for this
You can check that the test won't pass without the modification of sys.path.