Skip to content

Commit

Permalink
HOTFIX - Poetry Version Check (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-macmillan authored Jan 3, 2025
1 parent a4906f4 commit 8d18ac9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ license = "MIT"
readme = "README.md"
package-mode = false

# https://peps.python.org/pep-0518/#tool-table
[tool.static_tests]
poetry_version = "1.8.4"

[tool.poetry.dependencies]
python = "^3.12"
aiobotocore = "*"
Expand Down
20 changes: 20 additions & 0 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
#! /bin/bash

function display_result {
RESULT=$1
EXIT_STATUS=$2
TEST=$3

if [ $RESULT -ne 0 ]; then
echo -e "\033[31m$TEST failed\033[0m"
exit $EXIT_STATUS
else
echo -e "\033[32m$TEST passed\033[0m"
fi
}


# Poetry version stability check
POETRY_VERSION=$(grep "poetry_version" pyproject.toml | grep -oE "[0-9]{1}.[0-9]{1,3}.[0-9]{1,3}")
head -1 poetry.lock | grep -qE "${POETRY_VERSION}"
display_result $? 1 "Expected Poetry version: ${POETRY_VERSION}, found: $(head -1 poetry.lock | grep -oE "[0-9]{1}.[0-9]{1,3}.[0-9]{1,3}")"


# Values set in pyroject.toml
pytest

0 comments on commit 8d18ac9

Please sign in to comment.