Skip to content

Commit

Permalink
add pyproject.toml as default
Browse files Browse the repository at this point in the history
  • Loading branch information
verte-zerg committed Dec 11, 2024
1 parent 46c5d79 commit 1c8c3f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@ poetry_bin() {

poetry_venv() {
local pyproject
show_error_if_not_exists="0"
pyproject="$(eval "echo ${MISE_TOOL_OPTS__PYPROJECT-}")"
if [ "$pyproject" = "" ]; then
return 1
pyproject="pyproject.toml"
else
show_error_if_not_exists="1"
fi
if [[ $pyproject != /* ]] && [[ -n ${MISE_PROJECT_ROOT-} ]]; then
pyproject="${MISE_PROJECT_ROOT-}/$pyproject"
fi
if [[ ! -f $pyproject ]]; then
echoerr "mise-poetry: No pyproject.toml found. Execute \`poetry init\` to create \`$pyproject\` first."
if [ "$show_error_if_not_exists" = "1" ]; then
echoerr "mise-poetry: No pyproject.toml found. Execute \`poetry init\` to create \`$pyproject\` first."
fi
return 1
fi
poetry_bin -C "${pyproject%/*}" env info --path 2>/dev/null
true
}

0 comments on commit 1c8c3f0

Please sign in to comment.