Skip to content

Commit 4faa1d0

Browse files
committed
Simplify Add virtualenv to the path for pyright-action
1 parent 9ef16d9 commit 4faa1d0

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

analyze-project/action.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ runs:
5656
- name: Check for mypy and pyright installation
5757
id: check_tools
5858
run: |
59-
python - <<EOF
6059
import os
6160
from importlib.metadata import version, PackageNotFoundError
6261
@@ -67,11 +66,10 @@ runs:
6766
except PackageNotFoundError:
6867
return "false"
6968
70-
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
71-
f.write(f"mypy={is_installed('mypy')}\n")
72-
f.write(f"pyright={is_installed('pyright')}\n")
73-
EOF
74-
shell: bash
69+
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
70+
print(f"mypy={is_installed('mypy')}", file=output)
71+
print(f"pyright={is_installed('pyright')}", file=output)
72+
shell: python
7573
- name: Echo check_tools outputs
7674
run: |
7775
echo "mypy installed: ${{ steps.check_tools.outputs.mypy }}"
@@ -86,12 +84,7 @@ runs:
8684
if: steps.check_tools.outputs.pyright == 'true'
8785
shell: bash
8886
run: |
89-
VENV_PATH="$(poetry env info --path)"
90-
if [[ "$RUNNER_OS" == "Windows" ]]; then
91-
echo "$VENV_PATH/Scripts" >> $GITHUB_PATH
92-
else
93-
echo "$VENV_PATH/bin" >> $GITHUB_PATH
94-
fi
87+
echo "$(dirname $(poetry env info --executable))" >> $GITHUB_PATH
9588
working-directory: ${{ inputs.project-directory }}
9689
- name: Pyright static analysis
9790
if: steps.check_tools.outputs.pyright == 'true'

0 commit comments

Comments
 (0)