Skip to content

Commit

Permalink
Issue295 fixes #295 (#296)
Browse files Browse the repository at this point in the history
* Updated logic to get pandoc releases - issue #295

* Updated appveyor script

* Updated how get get the versions from GitHub, including handling of latest
  • Loading branch information
JessicaTegner authored Sep 22, 2022
1 parent 4becb4e commit f06a23b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ install:
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""

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

# stolen from https://github.com/doxygen/doxygen/blob/master/appveyor.yml
- appveyor-retry appveyor DownloadFile https://miktex.org/download/win/miktexsetup-x64.zip
Expand Down
12 changes: 11 additions & 1 deletion pypandoc/pandoc_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import tempfile
from typing import Union

import urllib
try:
from urllib.request import urlopen
except ImportError:
Expand Down Expand Up @@ -45,8 +46,17 @@ def _get_pandoc_urls(version="latest"):
# url to pandoc download page
url = "https://github.com/jgm/pandoc/releases/" + \
("tag/" if version != "latest" else "") + version
# try to open the url
try:
response = urlopen(url)
content = response.read()
pattern = re.compile(r"pandoc\s*([\d.]+)")
version = re.search(pattern, content.decode("utf-8")).group(1)
except urllib.error.HTTPError as e:
raise RuntimeError("Invalid pandoc version {}.".format(version))
return
# read the HTML content
response = urlopen(url)
response = urlopen("https://github.com/jgm/pandoc/releases/expanded_assets/"+version)
content = response.read()
# regex for the binaries
processor_architecture = "arm" if platform.uname()[4].startswith("arm") else "amd"
Expand Down

0 comments on commit f06a23b

Please sign in to comment.