Skip to content

Commit

Permalink
Merge branch 'master' into imagegrab_xcb
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 25, 2020
2 parents c2beb8f + d33d467 commit 8f316a0
Show file tree
Hide file tree
Showing 318 changed files with 5,928 additions and 4,517 deletions.
22 changes: 6 additions & 16 deletions .appveyor.yml
Expand Up @@ -13,11 +13,8 @@ environment:
TEST_OPTIONS:
DEPLOY: YES
matrix:
- PYTHON: C:\Python38rc1-x64
- PYTHON: C:/Python37
- PYTHON: C:/Python37-x64
- PYTHON: C:/Python36
- PYTHON: C:/Python36-x64
- PYTHON: C:/Python38
- PYTHON: C:/Python38-x64
- PYTHON: C:/Python35
- PYTHON: C:/Python35-x64
- PYTHON: C:/msys64/mingw32
Expand All @@ -32,23 +29,13 @@ environment:


install:
- ps: |
if ($env:PYTHON -eq "C:\Python38rc1-x64") {
curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/d0cf77e62028704875073e3dc4626f61d1c33b0e/install_python.ps1
.\install_python.ps1
}
- curl -fsSL -o pillow-depends.zip https://github.com/python-pillow/pillow-depends/archive/master.zip
- 7z x pillow-depends.zip -oc:\
- mv c:\pillow-depends-master c:\pillow-depends
- xcopy c:\pillow-depends\*.zip c:\pillow\winbuild\
- xcopy c:\pillow-depends\*.tar.gz c:\pillow\winbuild\
- xcopy /s c:\pillow-depends\test_images\* c:\pillow\tests\images
- cd c:\pillow\winbuild\
- ps: |
if ($env:PYTHON -eq "c:/vp/pypy2")
{
c:\pillow\winbuild\appveyor_install_pypy2.cmd
}
- ps: |
if ($env:PYTHON -eq "c:/vp/pypy3")
{
Expand All @@ -65,6 +52,9 @@ install:
c:\pillow\winbuild\build_deps.cmd
$host.SetShouldExit(0)
}
- curl -fsSL -o gs950.exe https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/gs950w32.exe
- gs950.exe /S
- path %path%;C:\Program Files (x86)\gs\gs9.50\bin

build_script:
- ps: |
Expand All @@ -86,7 +76,7 @@ test_script:
- cd c:\pillow
- '%PYTHON%\%PIP_DIR%\pip.exe 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-report term --cov-report xml Tests'
- '%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:
Expand Down
19 changes: 19 additions & 0 deletions .ci/after_success.sh
@@ -0,0 +1,19 @@
#!/bin/bash

# gather the coverage data
pip3 install codecov
if [[ $MATRIX_DOCKER ]]; then
coverage xml --ignore-errors
else
coverage xml
fi

if [[ $TRAVIS ]]; then
codecov
fi

if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then
# Coverage and quality reports on just the latest diff.
depends/diffcover-install.sh
depends/diffcover-run.sh
fi
File renamed without changes.
12 changes: 8 additions & 4 deletions .travis/install.sh → .ci/install.sh
Expand Up @@ -3,7 +3,7 @@
set -e

sudo apt-get update
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-tk\
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
cmake imagemagick libharfbuzz-dev libfribidi-dev

Expand All @@ -16,12 +16,16 @@ pip install pyroma
pip install test-image-results
pip install numpy
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 pyqt5-dev-tools
pip install pyqt5
pip install pyqt5!=5.14.1
fi
fi

# docs only on Python 2.7
if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then pip install -r requirements.txt ; fi
# docs only on Python 3.8
if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ]; then pip install -r requirements.txt ; fi

# webp
pushd depends && ./install_webp.sh && popd
Expand Down
10 changes: 10 additions & 0 deletions .ci/test.sh
@@ -0,0 +1,10 @@
#!/bin/bash

set -e

python -m pytest -v -x --cov PIL --cov Tests --cov-report term Tests

# Docs
if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ] && [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
make doccheck
fi
8 changes: 7 additions & 1 deletion .coveragerc
Expand Up @@ -10,5 +10,11 @@ exclude_lines =
if 0:
if __name__ == .__main__.:
# Don't complain about debug code
if Image.DEBUG:
if DEBUG:

[run]
omit =
Tests/32bit_segfault_check.py
Tests/bench_cffi_access.py
Tests/check_*.py
Tests/createfontdatachunk.py
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Expand Up @@ -9,14 +9,14 @@ Please send a pull request to the master branch. Please include [documentation](
- Fork the Pillow repository.
- Create a branch from master.
- Develop bug fixes, features, tests, etc.
- Run the test suite on Python 2.7 and 3.x. You can enable [Travis CI](https://travis-ci.org/profile/) and [AppVeyor](https://ci.appveyor.com/projects/new) on your repo to catch test failures prior to the pull request, and [Codecov](https://codecov.io/gh) to see if the changed code is covered by tests.
- Run the test suite. You can enable [Travis CI](https://travis-ci.org/profile/) and [AppVeyor](https://ci.appveyor.com/projects/new) on your repo to catch test failures prior to the pull request, and [Codecov](https://codecov.io/gh) to see if the changed code is covered by tests.
- Create a pull request to pull the changes from your branch to the Pillow master.

### Guidelines

- Separate code commits from reformatting commits.
- Provide tests for any newly added code.
- Follow PEP8.
- Follow PEP 8.
- When committing only documentation changes please include [ci skip] in the commit message to avoid running tests on Travis-CI and AppVeyor.

## Reporting Issues
Expand Down
9 changes: 8 additions & 1 deletion .codecov.yml → .github/codecov-upstream.yml
Expand Up @@ -3,9 +3,16 @@
codecov:
# Avoid "Missing base report" due to committing CHANGES.rst with "[CI skip]"
# https://github.com/codecov/support/issues/363
# https://docs.codecov.io/v4.3.6/docs/comparing-commits
# https://docs.codecov.io/docs/comparing-commits
allow_coverage_offsets: true

token: 6dafc396-e7f5-4221-a38a-8b07a49fbdae

comment: off

# Matches 'omit:' in .coveragerc
ignore:
- "Tests/32bit_segfault_check.py"
- "Tests/bench_cffi_access.py"
- "Tests/check_*.py"
- "Tests/createfontdatachunk.py"
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Expand Up @@ -20,6 +20,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Build system information
run: python .github/workflows/system-info.py

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/system-info.py
@@ -0,0 +1,25 @@
"""
Print out some handy system info like Travis CI does.
This sort of info is missing from GitHub Actions.
Requested here:
https://github.com/actions/virtual-environments/issues/79
"""
import os
import platform
import sys

print("Build system information")
print()

print("sys.version\t\t", sys.version.split("\n"))
print("os.name\t\t\t", os.name)
print("sys.platform\t\t", sys.platform)
print("platform.system()\t", platform.system())
print("platform.machine()\t", platform.machine())
print("platform.platform()\t", platform.platform())
print("platform.version()\t", platform.version())
print("platform.uname()\t", platform.uname())
if sys.platform == "darwin":
print("platform.mac_ver()\t", platform.mac_ver())
31 changes: 30 additions & 1 deletion .github/workflows/test-docker.yml
Expand Up @@ -17,6 +17,7 @@ jobs:
debian-10-buster-x86,
centos-6-amd64,
centos-7-amd64,
centos-8-amd64,
amazon-1-amd64,
amazon-2-amd64,
fedora-30-amd64,
Expand All @@ -29,6 +30,9 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Build system information
run: python .github/workflows/system-info.py

- name: Docker pull
run: |
docker pull pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
Expand All @@ -37,4 +41,29 @@ jobs:
run: |
# The Pillow user in the docker container is UID 1000
sudo chown -R 1000 $GITHUB_WORKSPACE
docker run -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
docker run --name pillow_container -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
sudo chown -R runner $GITHUB_WORKSPACE
- name: After success
if: success()
run: |
PATH="$PATH:~/.local/bin"
docker start pillow_container
pil_path=`docker exec pillow_container /vpy3/bin/python -c 'import os, PIL;print(os.path.realpath(os.path.dirname(PIL.__file__)))'`
docker stop pillow_container
sudo mkdir -p $pil_path
sudo cp src/PIL/*.py $pil_path
.ci/after_success.sh
env:
MATRIX_DOCKER: ${{ matrix.docker }}

- name: Prepare coverage token
if: success() && github.repository == 'python-pillow/Pillow'
run: cp .github/codecov-upstream.yml codecov.yml

- name: Upload coverage
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.docker }}

0 comments on commit 8f316a0

Please sign in to comment.