Skip to content

Commit

Permalink
Squash-merge azure pipelines (currently without twine)
Browse files Browse the repository at this point in the history
  • Loading branch information
James R. Barlow committed Jul 16, 2019
1 parent a73cdea commit 77e82c9
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,8 @@ install:

script:
- python3 -m pytest

branches:
except:
- docs
- azure-pipelines
102 changes: 102 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
variables:
qpdf_version: "8.4.2"
qpdf_release: ${{ format('https://github.com/qpdf/qpdf/releases/download/release-qpdf-{0}/qpdf-{0}.tar.gz', variables.qpdf_version) }}
cibw_skip: "cp27-* cp34-*"
cibw_test_command: "pytest -nauto {project}/tests"
cibw_test_requires: "-r requirements/test.txt"
cibuildwheel_version: "0.11.1"
cibw_before_build: "pip install pybind11"

jobs:
- job: linux_sdist
pool: {vmImage: 'Ubuntu-16.04'}
steps:
- task: UsePythonVersion@0
- bash: |
mkdir qpdf && wget -q $QPDF_RELEASE -O - | tar xz -C qpdf --strip-components=1
cd qpdf/
./configure
make -j 2
sudo make install
cd ..
displayName: "Build QPDF"
- bash: |
python -m pip install --upgrade pip
python setup.py sdist
python -m pip install pybind11
python -m pip install --verbose dist/*.tar.gz
python -m pip install -r requirements/test.txt
displayName: "Build sdist"
- bash: |
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
python -m pytest -nauto
displayName: "Test"
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'dist'}
- job: linux
pool: {vmImage: 'Ubuntu-16.04'}
variables:
cibw_before_build: >- # yaml: folded newlines to spaces, no newline at end
yum install -y libjpeg-devel zlib-devel &&
cd qpdf &&
./autogen.sh &&
./configure &&
make install &&
cd .. &&
pip install pybind11
steps:
- task: UsePythonVersion@0
- bash: |
mkdir qpdf && wget -q $QPDF_RELEASE -O - | tar xz -C qpdf --strip-components=1
- bash: source azure-pipelines/build.bash
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
- job: macos
pool: {vmImage: 'macOS-10.13'}
variables:
cibw_before_build: >-
pip install pybind11 &&
brew install qpdf
steps:
- task: UsePythonVersion@0
- bash: source azure-pipelines/build.bash
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
- job: windows64
pool: {vmImage: 'vs2017-win2016'}
variables:
qpdf_windows: ${{ format('https://github.com/qpdf/qpdf/releases/download/release-qpdf-{0}/qpdf-{0}-bin-msvc64.zip', variables.qpdf_version) }}
qpdf_dll: "qpdf21.dll"
cibw_skip: "cp27-* cp34-* cp35-win32* cp36-win32* cp37-win32*"
cibw_environment: >-
INCLUDE="$INCLUDE;c:\\qpdf\\include"
LIB="$LIB;c:\\qpdf\\lib"
LIBPATH="$LIBPATH;c:\\qpdf\\lib"
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.5', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
- powershell: azure-pipelines/win-download-qpdf.ps1
displayName: "Download QPDF"
- bash: source azure-pipelines/build.bash
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
- job: windows32
pool: {vmImage: 'vs2017-win2016'}
variables:
qpdf_windows: ${{ format('https://github.com/qpdf/qpdf/releases/download/release-qpdf-{0}/qpdf-{0}-bin-msvc32.zip', variables.qpdf_version) }}
qpdf_dll: "qpdf21.dll"
cibw_skip: "cp27-* cp34-* cp35-win_amd64* cp36-win_amd64* cp37-win_amd64*"
cibw_environment: >-
INCLUDE="$INCLUDE;c:\\qpdf\\include"
LIB="$LIB;c:\\qpdf\\lib"
LIBPATH="$LIBPATH;c:\\qpdf\\lib"
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.5', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x86}}
- powershell: azure-pipelines/win-download-qpdf.ps1
displayName: "Download QPDF"
- bash: source azure-pipelines/build.bash
- task: PublishBuildArtifacts@1
inputs: {pathtoPublish: 'wheelhouse'}
5 changes: 5 additions & 0 deletions azure-pipelines/build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -ex
python -m pip install --upgrade pip
pip install cibuildwheel==$CIBUILDWHEEL_VERSION
cibuildwheel --output-dir wheelhouse .
5 changes: 5 additions & 0 deletions azure-pipelines/win-download-qpdf.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Invoke-WebRequest -Uri $env:QPDF_WINDOWS -OutFile "qpdf-release.zip"
7z x "qpdf-release.zip" -oc:\
$qpdfdir = Get-ChildItem c:\qpdf-*
Move-Item -Path $qpdfdir -Destination c:\qpdf
cp c:\qpdf\bin\$env:QPDF_DLL src\pikepdf
4 changes: 2 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
attrs >= 17.4.0
hypothesis >= 4.16, < 5
attrs >= 19.1.0
hypothesis >= 4.24, < 5
Pillow >= 5.0.0
pytest >= 4.4.0, < 5
pytest-xdist >= 1.28, < 2
Expand Down

0 comments on commit 77e82c9

Please sign in to comment.