Skip to content

Commit 01674b9

Browse files
authored
Merge pull request #619 from geeksville/pr-poelock
Add bin/git-resolve-poetry-lock.sh to resolve merge conficts
2 parents 4f1ea5b + a68a9f8 commit 01674b9

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

bin/git-resolve-poetry-lock.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# This is a little helper you can use to resolve git merge conflicts in poetry.lock
6+
# with minimal changes vs the requested lib versions
7+
# Based on this article with a good description of best practices:
8+
# https://www.peterbe.com/plog/how-to-resolve-a-git-conflict-in-poetry.lock
9+
10+
echo "Resolving poetry.lock merge conflicts, you'll need to run git commit yourself..."
11+
12+
# Get poetry.lock to look like it does in master
13+
git checkout --theirs poetry.lock
14+
# Rewrite the lock file
15+
poetry lock --no-update
16+
git add poetry.lock
17+
18+
# Update your poetry env to match the new merged lock file
19+
poetry install

0 commit comments

Comments
 (0)