Poetry
table of contents
Initialization
Quickly initialize a new Python environment with Poetry. We explicitly stick to Python 3.11.x (we don’t want automatic upgrades to 3.12, etc.). Also, we activate Poetry virtual environment on startup.
poetry init --python '~3.11' --no-interaction --quiet
poetry install
echo 'source $(poetry env info -p)/bin/activate' > .startup
Resolving rebase conflicts
When rebasing a branch with an updated poetry.lock, conflicts may arise. To resolve these conflicts, we can utilize the following function:
function poetry-resolve-rebase-conflict() {
git checkout --ours ./poetry.lock
poetry lock --no-update
git add ./poetry.lock
}