What is poetry typing practice?
Is poetry typing good for beginners?
How does typing poetry improve my skills?
Hey,
I am developing a production application where I would like to run a script through Poetry. Naturally, in Poetry there is the option to register your file as script:
[tool.poetry.scripts] main = "<package_name>.jobs.<job_type>.main:main" writer = "<package_name>.jobs.<job_type>.main:main"
It is fine as long as we can encapsulate the ultimate logic in one function (main in my case). However, the function I am trying to run communicates with the external world based on the typer package (link). So in the main.pyscript I have the following lines:
if __name__ == "__main__": typer_run_job(main)
where main is the actual logic of my job and typer_run_job is just a wrapper to use typer as the CLI tool of my choice.
How can I know, given these circumstances, declare entry point in Poetry not as the main function, but the typer_run_job(main) call which is absolutely necessary for the script to run correctly. In other words: is there a way to make script run whatever is under if __name__ == "__main__":?