This script will take the versions from the current lock file and pin them in the pyproject.toml file. This will keep new versions from being installed if for some reason you need to rebuild the poetry.lock file and gives you more control when upgrading packages to ensure the build isn't broken.
pip install toml