Skip to content

Commit

Permalink
Auto-detect image magick latest 6.9.X-Y version (#936)
Browse files Browse the repository at this point in the history
* Auto-detect image magick version

* Fix version detection
  • Loading branch information
Overdrivr authored Apr 5, 2019
1 parent 282848a commit 57086ef
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
7 changes: 6 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ image: Visual Studio 2017

environment:
global:
IMAGE_MAGICK_VERSION: 6.9.10-35-Q16
IMAGE_MAGICK_INSTALL_DIR: c://ImageMagick
matrix:
- PYTHON: "C:\\Python35-x64"
Expand Down Expand Up @@ -36,6 +35,12 @@ install:
- pip install --upgrade pip --user
- pip install pipenv

# Find latest image magick version by parsing website

- python find_latest_imagemagick_version.py > temp.txt
- set /p IMAGE_MAGICK_VERSION=<temp.txt

- echo %IMAGE_MAGICK_VERSION%
# Download ImageMagick installer (which also installs ffmpeg.)
# From http://ftp.fifi.org/ImageMagick/binaries/
# Might need to be updated from time to time
Expand Down
21 changes: 21 additions & 0 deletions find_latest_imagemagick_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from urllib import request
import re

url = "https://legacy.imagemagick.org/script/index.php"

'''This little script parses url above to extract latest image magick version
(major version 6.9), to feed it into CI system. Not the best way for reproducible
builds, but it's preferred for now over storing imagemagick installer into the
git repository
'''

response = request.urlopen(url)
html = response.read().decode('utf-8')
r = re.compile("6\.9\.[0-9]+\-[0-9]+")
version = r.findall(html)
if len(version) == 0:
raise ValueError("Could not find latest legacy 6.9.X-Y ImageMagick version from {}".format(url))
version = version[0]
# Append Q16 build
version += '-Q16'
print(version)

0 comments on commit 57086ef

Please sign in to comment.