From 6a50e1076afff4c8f04a11f55bd0e6512dbfd8d9 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 29 Oct 2020 22:41:29 +1100 Subject: [PATCH 1/2] Invoke pip using Python --- .appveyor.yml | 8 ++++---- .ci/install.sh | 28 ++++++++++++++-------------- .github/workflows/macos-install.sh | 20 ++++++++++---------- .github/workflows/test-windows.yml | 2 +- .github/workflows/test.yml | 4 ++-- .travis.yml | 2 +- depends/diffcover-install.sh | 2 +- docs/releasenotes/6.0.0.rst | 2 +- tox.ini | 4 ++-- winbuild/build.rst | 2 +- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 092b73748ca..45b74814070 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,7 +33,7 @@ install: c:\pillow\winbuild\build\build_dep_all.cmd $host.SetShouldExit(0) - path C:\pillow\winbuild\build\bin;%PATH% -- '%PYTHON%\%PIP_DIR%\pip.exe install -U "setuptools>=49.3.2"' +- '%PYTHON%\%EXECUTABLE% -m pip install -U "setuptools>=49.3.2"' build_script: - ps: | @@ -44,13 +44,13 @@ build_script: test_script: - cd c:\pillow -- '%PYTHON%\%PIP_DIR%\pip.exe install pytest pytest-cov' +- '%PYTHON%\%EXECUTABLE% -m pip install pytest pytest-cov' - c:\"Program Files (x86)"\"Windows Kits"\10\Debuggers\x86\gflags.exe /p /enable %PYTHON%\%EXECUTABLE% - '%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests' #- '%PYTHON%\%EXECUTABLE% test-installed.py -v -s %TEST_OPTIONS%' TODO TEST_OPTIONS with pytest? after_test: -- pip install codecov +- python -m pip install codecov - codecov --file coverage.xml --name %PYTHON% --flags AppVeyor matrix: @@ -67,7 +67,7 @@ artifacts: before_deploy: - cd c:\pillow - - '%PYTHON%\%PIP_DIR%\pip.exe install wheel' + - '%PYTHON%\%EXECUTABLE% -m pip install wheel' - cd c:\pillow\winbuild\ - c:\pillow\winbuild\build\build_pillow.cmd bdist_wheel - cd c:\pillow diff --git a/.ci/install.sh b/.ci/install.sh index 6f83fef224c..6b9ade699c0 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -23,32 +23,32 @@ sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\ if [[ $TRAVIS_CPU_ARCH == "s390x" ]]; then sudo chown $USER ~/.cache/pip/wheels ; fi -pip install --upgrade pip -PYTHONOPTIMIZE=0 pip install cffi -pip install coverage -pip install olefile -pip install -U pytest -pip install -U pytest-cov -pip install pyroma -pip install test-image-results -pip install numpy +python3 -m pip install --upgrade pip +PYTHONOPTIMIZE=0 python3 -m pip install cffi +python3 -m pip install coverage +python3 -m pip install olefile +python3 -m pip install -U pytest +python3 -m pip install -U pytest-cov +python3 -m pip install pyroma +python3 -m pip install test-image-results +python3 -m pip install numpy # TODO Remove when 3.8 / 3.9 / PyPy3 includes setuptools 49.3.2+: -if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then pip install -U "setuptools>=49.3.2" ; fi -if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then pip install -U "setuptools>=49.3.2" ; fi -if [ "$TRAVIS_PYTHON_VERSION" == "pypy3.6-7.3.1" ]; then pip install -U "setuptools>=49.3.2" ; fi +if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi +if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi +if [ "$TRAVIS_PYTHON_VERSION" == "pypy3.6-7.3.1" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi if [[ $TRAVIS_PYTHON_VERSION == 3.* ]]; then # arm64, ppc64le, s390x CPUs: # "ERROR: Could not find a version that satisfies the requirement pyqt5" if [[ $TRAVIS_CPU_ARCH == "amd64" ]]; then sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools - pip install pyqt5 + python3 -m pip install pyqt5 fi fi # docs only on Python 3.8 -if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then pip install -r requirements.txt ; fi +if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -r requirements.txt ; fi # webp pushd depends && ./install_webp.sh && popd diff --git a/.github/workflows/macos-install.sh b/.github/workflows/macos-install.sh index 16f532edf7c..473412d3be4 100755 --- a/.github/workflows/macos-install.sh +++ b/.github/workflows/macos-install.sh @@ -4,20 +4,20 @@ set -e brew install libtiff libjpeg openjpeg libimagequant webp little-cms2 freetype openblas -PYTHONOPTIMIZE=0 pip install cffi -pip install coverage -pip install olefile -pip install -U pytest -pip install -U pytest-cov -pip install pyroma -pip install test-image-results +PYTHONOPTIMIZE=0 python3 -m pip install cffi +python3 -m pip install coverage +python3 -m pip install olefile +python3 -m pip install -U pytest +python3 -m pip install -U pytest-cov +python3 -m pip install pyroma +python3 -m pip install test-image-results echo -e "[openblas]\nlibraries = openblas\nlibrary_dirs = /usr/local/opt/openblas/lib" >> ~/.numpy-site.cfg -pip install numpy +python3 -m pip install numpy # TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+: -if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then pip install -U "setuptools>=49.3.2" ; fi -if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then pip install -U "setuptools>=49.3.2" ; fi +if [ "$GHA_PYTHON_VERSION" == "3.8" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi +if [ "$GHA_PYTHON_VERSION" == "3.9" ]; then python3 -m pip install -U "setuptools>=49.3.2" ; fi # extra test images pushd depends && ./install_extra_test_images.sh && popd diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index a52f092c6a4..a7fb2bdbc56 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -55,7 +55,7 @@ jobs: - name: Print build system information run: python .github/workflows/system-info.py - - name: pip install wheel pytest pytest-cov + - name: python -m pip install wheel pytest pytest-cov run: python -m pip install wheel pytest pytest-cov # TODO Remove when 3.8 / 3.9 includes setuptools 49.3.2+: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6cb09964028..df5f6f07cee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - echo "::set-output name=dir::$(pip cache dir)" + echo "::set-output name=dir::$(python3 -m pip cache dir)" - name: pip cache uses: actions/cache@v2 @@ -96,7 +96,7 @@ jobs: - name: Docs if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.8 run: | - pip install sphinx-removed-in sphinx-rtd-theme + python3 -m pip install sphinx-removed-in sphinx-rtd-theme make doccheck - name: After success diff --git a/.travis.yml b/.travis.yml index da8aedf8c96..2966cdf19fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ matrix: install: - | if [ "$LINT" == "true" ]; then - pip install tox + python3 -m pip install tox else .ci/install.sh; fi diff --git a/depends/diffcover-install.sh b/depends/diffcover-install.sh index a0b462b56d7..18be4f9f9d1 100755 --- a/depends/diffcover-install.sh +++ b/depends/diffcover-install.sh @@ -5,4 +5,4 @@ git fetch origin master:refs/remotes/origin/master # CFLAGS=-O0 means build with no optimisation. # Makes build much quicker for lxml and other dependencies. -time CFLAGS=-O0 pip install diff_cover +time CFLAGS=-O0 python3 -m pip install diff_cover diff --git a/docs/releasenotes/6.0.0.rst b/docs/releasenotes/6.0.0.rst index 0145347f229..3e3b945a0a9 100644 --- a/docs/releasenotes/6.0.0.rst +++ b/docs/releasenotes/6.0.0.rst @@ -17,7 +17,7 @@ Removed deprecated PIL.OleFileIO PIL.OleFileIO was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour of the upstream olefile Python package, and replaced with an ``ImportError``. The deprecated file has now been removed from Pillow. If needed, install from PyPI (eg. -``pip install olefile``). +``python3 -m pip install olefile``). Removed deprecated ImageOps functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tox.ini b/tox.ini index 81c6e19cf7b..2557d5067a8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ # Tox (https://tox.readthedocs.io/en/latest/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. +# test suite on all supported python versions. To use it, +# "python3 -m pip install tox" and then run "tox" from this directory. [tox] envlist = diff --git a/winbuild/build.rst b/winbuild/build.rst index ba568a0303d..cd4a45e87b7 100644 --- a/winbuild/build.rst +++ b/winbuild/build.rst @@ -82,7 +82,7 @@ Pillow for the selected version of Python. instead of installing Pillow. You can also use ``winbuild\build\build_pillow.cmd --inplace develop`` to build -and install Pillow in develop mode (instead of ``pip install --editable``). +and install Pillow in develop mode (instead of ``python3 -m pip install --editable``). Testing Pillow -------------- From 0823b37d41f0d36d38187e74d868015d6eb2c80e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 30 Oct 2020 19:25:50 +1100 Subject: [PATCH 2/2] Removed PIP_DIR variable --- .appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 45b74814070..a77033ec136 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,7 +7,6 @@ init: environment: EXECUTABLE: python.exe - PIP_DIR: Scripts TEST_OPTIONS: DEPLOY: YES matrix: