Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if python starts python3 #6239

Merged
merged 4 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion check/doctest
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
cd "${topdir}" || exit $?

source dev_tools/pypath
source dev_tools/pypath || exit $?

python dev_tools/docs/run_doctest.py "$@"
2 changes: 1 addition & 1 deletion check/pytest
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cd "${topdir}" || exit $?
# (the last `-n` option wins)
PYTEST_ARGS=( "-n=auto" "$@" )

source dev_tools/pypath
source dev_tools/pypath || exit $?

pytest "${PYTEST_ARGS[@]}"
RESULT=$?
Expand Down
2 changes: 1 addition & 1 deletion check/pytest-and-incremental-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ else
rev="${base}"
fi

source dev_tools/pypath
source dev_tools/pypath || exit $?

# Run tests while producing coverage files.
check/pytest --cov \
Expand Down
2 changes: 1 addition & 1 deletion check/pytest-changed-files
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ if [ "${num_changed}" -eq 0 ]; then
exit 0
fi

source dev_tools/pypath
source dev_tools/pypath || exit $?

pytest "${rest[@]}" "${changed[@]}"
2 changes: 1 addition & 1 deletion check/pytest-changed-files-and-incremental-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ if [ "${#changed_python_tests[@]}" -eq 0 ]; then
exit 0
fi

source dev_tools/pypath
source dev_tools/pypath || exit $?

# Run tests while producing coverage files.
check/pytest "${changed_python_tests[@]}" \
Expand Down
6 changes: 6 additions & 0 deletions dev_tools/pypath
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ else
_PYPATH_BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
fi

if ! python --version | grep -q -F "Python 3."; then
echo "python command does not start Python 3" >&2
echo "Please use a virtual environment created for Python 3." >&2
return 2
fi

_PYPATH_PREFIX="${_PYPATH_BASE_DIR}$(
cd "${_PYPATH_BASE_DIR}" &&
env PYTHONPATH=. python dev_tools/modules.py list --mode folder |
Expand Down
Loading