From ff5ae1c59e7229d0f43a56f3e9bc3618ba4a9626 Mon Sep 17 00:00:00 2001 From: Vikash Kothary Date: Sun, 16 Jan 2022 20:28:46 +0000 Subject: [PATCH] chore: Rename and refactor poetry export script --- scripts/{lock.sh => poetry-export.sh} | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) rename scripts/{lock.sh => poetry-export.sh} (59%) mode change 100755 => 100644 diff --git a/scripts/lock.sh b/scripts/poetry-export.sh old mode 100755 new mode 100644 similarity index 59% rename from scripts/lock.sh rename to scripts/poetry-export.sh index 6586716..fd3ba2a --- a/scripts/lock.sh +++ b/scripts/poetry-export.sh @@ -1,11 +1,15 @@ -#!/bin/bash -# file: lock.sh -# description: Lock dependencies and export requirements. +#!/usr/bin/env bash +# file: poetry-export.sh +# description: Lock dependencies and export them as backward-compatible requirements.txt files. -echo -e "# THE FILE WAS GENERATED BY POETRY, DO NOT EDIT!\n\n" > src/requirements.txt -echo -e "# THE FILE WAS GENERATED BY POETRY, DO NOT EDIT!\n\n" > src/requirements-dev.txt +echo '[INFO] Updating poetry.lock file.' poetry lock -poetry export --without-hashes -f requirements.txt >> src/requirements.txt -poetry export --dev --without-hashes -f requirements.txt >> src/requirements-dev.txt +echo '[INFO] Generating requirements.txt.' +echo -e "# THE FILE WAS GENERATED BY POETRY, DO NOT EDIT!\n\n" > src/requirements.txt +poetry export --without-hashes -f requirements.txt >> src/requirements.txt + +echo '[INFO] Generating requirements-dev.txt.' +echo -e "# THE FILE WAS GENERATED BY POETRY, DO NOT EDIT!\n\n" > src/requirements-dev.txt +poetry export --dev --without-hashes -f requirements.txt >> src/requirements-dev.txt echo "-e src/." >> src/requirements-dev.txt