Skip to content

Commit

Permalink
Small fixes to the new way we handle pandoc releases (#298)
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

* Performance enhancement suggested by @davidbgk

* Updated the way we get the version number from the fractured url

* Hey let's not dublicate the runners
  • Loading branch information
JessicaTegner committed Sep 22, 2022
1 parent 0e243c2 commit 46ffef7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Continuous Integration

on:
- push
- pull_request
pull_request:
paths:
- '**.py'
- '**.yaml'

jobs:
test:
Expand Down
5 changes: 2 additions & 3 deletions pypandoc/pandoc_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ def _get_pandoc_urls(version="latest"):
# 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)
version_url_frags = response.url.split("/")
version = version_url_frags[-1]
except urllib.error.HTTPError as e:
raise RuntimeError("Invalid pandoc version {}.".format(version))
return
Expand Down

0 comments on commit 46ffef7

Please sign in to comment.