Skip to content

Commit 46ffef7

Browse files
Small fixes to the new way we handle pandoc releases (#298)
* Updated logic to get pandoc releases - issue #295 * Updated appveyor script * Updated how get get the versions from GitHub, including handling of latest * Performance enhancement suggested by @davidbgk * Updated the way we get the version number from the fractured url * Hey let's not dublicate the runners
1 parent 0e243c2 commit 46ffef7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Continuous Integration
22

33
on:
4-
- push
5-
- pull_request
4+
pull_request:
5+
paths:
6+
- '**.py'
7+
- '**.yaml'
68

79
jobs:
810
test:

pypandoc/pandoc_download.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ def _get_pandoc_urls(version="latest"):
4949
# try to open the url
5050
try:
5151
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)
52+
version_url_frags = response.url.split("/")
53+
version = version_url_frags[-1]
5554
except urllib.error.HTTPError as e:
5655
raise RuntimeError("Invalid pandoc version {}.".format(version))
5756
return

0 commit comments

Comments
 (0)