Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3Packages.pypandoc: vendor patches, test w/o pandoc-citeproc
* Translate all seds in postPatch into patches (for setting the static path and skipping the test that needs network access) * The patch for the changed pandoc heading generation was simplified: Since we know our pandoc version is always that new, we can skip the version check. * Skip the test for pandoc-citeproc: pandoc-citeproc has been deprecated in favor of pandoc --citeproc by the upstream pandoc developer. pypandoc's testsuite doesn't reflect this yet (although it should support --citeproc theoretically) to avoid depending on pandoc-citeproc for the checkPhase (as we expect it to break again or continue to be broken) we skip the test requiring pandoc-citeproc. The breakage of pypandoc due to pandoc-citeproc was pointed out here: #116635 (comment) Thank you!
- Loading branch information
1 parent
f0ceaf8
commit 27077f1
Showing
4 changed files
with
63 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
pkgs/development/python-modules/pypandoc/new-pandoc-headings.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/tests.py b/tests.py | ||
index aede281..c400888 100755 | ||
--- a/tests.py | ||
+++ b/tests.py | ||
@@ -295,7 +295,7 @@ class TestPypandoc(unittest.TestCase): | ||
|
||
def test_unicode_input(self): | ||
# make sure that pandoc always returns unicode and does not mishandle it | ||
- expected = u'üäöîôû{0}======{0}{0}'.format(os.linesep) | ||
+ expected = u'# üäöîôû'.format(os.linesep) | ||
written = pypandoc.convert_text(u'<h1>üäöîôû</h1>', 'md', format='html') | ||
self.assertTrue(isinstance(written, unicode_type)) | ||
self.assertEqualExceptForNewlineEnd(expected, written) | ||
@@ -305,7 +305,7 @@ class TestPypandoc(unittest.TestCase): | ||
self.assertTrue(isinstance(written, unicode_type)) | ||
|
||
# Only use german umlauts in th next test, as iso-8859-15 covers that | ||
- expected = u'üäö€{0}===={0}{0}'.format(os.linesep) | ||
+ expected = u'# üäö€'.format(os.linesep) | ||
bytes = u'<h1>üäö€</h1>'.encode("iso-8859-15") | ||
|
||
# Without encoding, this fails as we expect utf-8 per default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/tests.py b/tests.py | ||
index deb50e0..aede281 100755 | ||
--- a/tests.py | ||
+++ b/tests.py | ||
@@ -179,6 +179,7 @@ class TestPypandoc(unittest.TestCase): | ||
received = pypandoc.convert_file(file_url, 'rst') | ||
self.assertEqualExceptForNewlineEnd(expected, received) | ||
|
||
+ @unittest.skip("no network access during checkPhase") | ||
def test_basic_conversion_from_http_url(self): | ||
url = 'https://raw.githubusercontent.com/bebraw/pypandoc/master/README.md' | ||
received = pypandoc.convert_file(url, 'html') | ||
@@ -247,6 +248,7 @@ class TestPypandoc(unittest.TestCase): | ||
|
||
self.assertRaises(RuntimeError, f) | ||
|
||
+ @unittest.skip("pandoc-citeproc has been deprecated") | ||
def test_conversion_with_citeproc_filter(self): | ||
# we just want to get a temp file name, where we can write to | ||
filters = ['pandoc-citeproc'] |
10 changes: 10 additions & 0 deletions
10
pkgs/development/python-modules/pypandoc/static-pandoc-path.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff --git a/pypandoc/__init__.py b/pypandoc/__init__.py | ||
index 6d5b79b..65437aa 100644 | ||
--- a/pypandoc/__init__.py | ||
+++ b/pypandoc/__init__.py | ||
@@ -582,4 +582,4 @@ def clean_pandocpath_cache(): | ||
|
||
|
||
__version = None | ||
-__pandoc_path = None | ||
+__pandoc_path = "@pandoc@" |