Skip to content

Commit

Permalink
Better warnings, restructured CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Yu committed Dec 19, 2019
1 parent 5f056e2 commit 293c431
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
41 changes: 21 additions & 20 deletions .github/workflows/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,26 @@ jobs:
set -x
export PATH="${PATH}:/opt/rez/bin/rez"
rez status
rm -rf /opt/rez
- name: rez-pip --install
run: |
export PATH="${PATH}:/opt/rez/bin/rez"
echo "rez-pip --install . ==========================================="
rez-pip --install .
echo "rez view rez ==========================================="
rez view rez
- name: rez-pip --install test as python package
run: |
# Still needed as there's no fallback to use system's python
echo "rez bind python ==========================================="
rez bind python
echo "Checking rez as python package: ==========================================="
rez env rez -- python -c 'import rez;print(rez.__file__)'
- name: pip install --target
run: |
Expand All @@ -50,22 +69,4 @@ jobs:
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
rez status
pip uninstall --yes rez
- name: rez-pip --install
run: |
python install.py
export PATH=${PATH}:/opt/rez/bin/rez
# # Still needed as there's no fallback to use system's python
# echo "rez bind python ==========================================="
# rez bind python
echo "rez-pip --install . ==========================================="
rez-pip --install .
echo "rez view rez ==========================================="
rez view rez
echo "Checking rez as python package: ==========================================="
rez env rez -- python -c 'import rez;print(rez.__file__)'
pip uninstall --yes rez
11 changes: 7 additions & 4 deletions src/rez/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ def find_pip(pip_version=None, python_version=None):
import pip
found_pip_version = pip.__version__
py_exe = sys.executable
print_warning(
"Found no pip in python and pip package; "
"falling back to pip installed in rez own virtualenv (version %s)",
found_pip_version
print_warning("Found no pip in any python and/or pip packages!")
print_warning("Falling back to pip installed in rez own virtualenv:")
logging_arguments = (
("pip", found_pip_version, pip.__file__),
("python", ".".join(sys.version_info[:3]), py_exe),
)
for warn_args in logging_arguments:
print_warning("%10s: %s (%s)", *warn_args)

if not _check_found(py_exe, found_pip_version, log_invalid=False):
message = "pip{specifier} is required! Please update your pip."
Expand Down

0 comments on commit 293c431

Please sign in to comment.