You pass cron the full path to your entry point. Where’s the rigamarole?
You pass cron the full path to your entry point. Where’s the rigamarole?
0 0 * * * /path/to/bash/script/to/init/pyenv && /my/path/to/poetry run /my/path/to/python.py -arg1
An anecdote: Homebrew uses this method for shipping python executables.
0 0 * * * /path/to/interpreter/created/by/poetry/bin/python myscript.py
I seem to recall that with python2.7 that calling bin/python in a virtualenv without activating the virtualenv did not used to "work" (i.e. it would use the system packages). Did this change at some point or is my memory just wrong?
The exception is if your python thingy is "the main thing" running on a server, i.e. your customer facing webapp.
My $.10 anyway
This of course leads to other issues to solve, now that your development environment doesn't actually mirror production.