Skip to content

Commit f06a23b

Browse files
* Updated logic to get pandoc releases - issue JessicaTegner#295 * Updated appveyor script * Updated how get get the versions from GitHub, including handling of latest
1 parent 4becb4e commit f06a23b

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

‎appveyor.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ install:
4444
- ECHO "Filesystem root:"
4545
- ps: "ls \"C:/\""
4646

47-
- ECHO "Installed SDKs:"
48-
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
47+
#- ECHO "Installed SDKs:"
48+
#- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
4949

5050
# stolen from https://github.com/doxygen/doxygen/blob/master/appveyor.yml
5151
- appveyor-retry appveyor DownloadFile https://miktex.org/download/win/miktexsetup-x64.zip

‎pypandoc/pandoc_download.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import tempfile
1212
from typing import Union
1313

14+
import urllib
1415
try:
1516
from urllib.request import urlopen
1617
except ImportError:
@@ -45,8 +46,17 @@ def _get_pandoc_urls(version="latest"):
4546
# url to pandoc download page
4647
url = "https://github.com/jgm/pandoc/releases/" + \
4748
("tag/" if version != "latest" else "") + version
49+
# try to open the url
50+
try:
51+
response = urlopen(url)
52+
content = response.read()
53+
pattern = re.compile(r"pandoc\s*([\d.]+)")
54+
version = re.search(pattern, content.decode("utf-8")).group(1)
55+
except urllib.error.HTTPError as e:
56+
raise RuntimeError("Invalid pandoc version {}.".format(version))
57+
return
4858
# read the HTML content
49-
response = urlopen(url)
59+
response = urlopen("https://github.com/jgm/pandoc/releases/expanded_assets/"+version)
5060
content = response.read()
5161
# regex for the binaries
5262
processor_architecture = "arm" if platform.uname()[4].startswith("arm") else "amd"

0 commit comments

Comments
 (0)