Skip to content

Commit 908f6e3

Browse files
committed
Make make-poetry-conversion-patch.sh fast.
Signed-off-by: Rolf Schröder <rolf.schr@gmail.com>
1 parent e14c7aa commit 908f6e3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

make-poetry-conversion-patch.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
GENERATED_POETRY_FILES=(pyproject.toml poetry.lock)
88
PATCH_FILE=poetry-conversion.patch
99

10+
set -e
11+
1012
# Sanity check.
1113
for f in "${GENERATED_POETRY_FILES[@]}" ; do
1214
test -f "$f" && { echo "File $f exists! Aborting ..." ; exit 1; }
@@ -47,8 +49,7 @@ EOF
4749

4850
# Convert requirements.txt entries to pyproject.toml entries.
4951
# https://github.com/python-poetry/poetry/issues/663
50-
# This may take very long.
51-
perl -pe 's/([<=>]+)/:$1/' requirements.txt | xargs -t -n 1 -I {} poetry add '{}'
52+
perl -pe 's/([<=>]+)/:$1/' requirements.txt | tr '\n' ' ' | xargs -t -I {} bash -c "poetry add {}"
5253

5354
# Generate the patch file.
5455
rm $PATCH_FILE

0 commit comments

Comments
 (0)