Package Details: python-pylatexenc 2.10-3

Git Clone URL: https://aur.archlinux.org/python-pylatexenc.git (read-only, click to copy)
Package Base: python-pylatexenc
Description: Python library for encoding unicode to latex and for parsing LaTeX to generate unicode text
Upstream URL: https://github.com/phfaist/pylatexenc
Licenses: MIT
Submitter: Tyilo
Maintainer: Tyilo
Last Packager: Tyilo
Votes: 3
Popularity: 0.75
First Submitted: 2017-07-03 20:51 (UTC)
Last Updated: 2024-04-03 22:05 (UTC)

Latest Comments

marcelroed commented on 2021-09-30 08:26 (UTC) (edited on 2021-09-30 08:26 (UTC) by marcelroed)

Thanks, @Tyilo! Works now.

Tyilo commented on 2021-09-29 16:33 (UTC)

@marcelroed Should be fixed in 2.10-2

marcelroed commented on 2021-09-29 12:02 (UTC)

The latest version fails a bunch of tests on my machine.

======================================================================
ERROR: test_basic_callable_replacement_latex_protection (test_latexencode.TestLatexEncode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marcelroed/.cache/yay/python-pylatexenc/src/pylatexenc-2.10/test/test_latexencode.py", line 78, in test_basic_callable_replacement_latex_protection
    u = UnicodeToLatexEncoder(replacement_latex_protection=lambda s: '{***{'+s+'}***}')
  File "/usr/lib/python3.9/site-packages/pylatexenc/latexencode/__init__.py", line 538, in __init__
    selfmethname = '_apply_protection_'+self.replacement_latex_protection.replace('-', '_')
AttributeError: 'function' object has no attribute 'replace'

======================================================================
ERROR: test_custom_conversion_rules (test_latexencode.TestPartialLatexEncode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marcelroed/.cache/yay/python-pylatexenc/src/pylatexenc-2.10/test/test_latexencode.py", line 260, in test_custom_conversion_rules
    u = latexencode.PartialLatexToLatexEncoder(
AttributeError: module 'pylatexenc.latexencode' has no attribute 'PartialLatexToLatexEncoder'

======================================================================
ERROR: test_simple_cases (test_latexencode.TestPartialLatexEncode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marcelroed/.cache/yay/python-pylatexenc/src/pylatexenc-2.10/test/test_latexencode.py", line 240, in test_simple_cases
    latexencode.PartialLatexToLatexEncoder()
AttributeError: module 'pylatexenc.latexencode' has no attribute 'PartialLatexToLatexEncoder'

======================================================================
ERROR: test_bug_issueno57 (test_latexwalker.TestLatexWalker)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pylatexenc/latexwalker/__init__.py", line 2248, in do_read
    mspec.parse_args(w=self, pos=tok.pos + tok.len,
  File "/usr/lib/python3.9/site-packages/pylatexenc/macrospec/__init__.py", line 95, in parse_args
    return self.args_parser.parse_args(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pylatexenc/macrospec/_argparsers.py", line 308, in parse_args
    optarginfotuple = w.get_latex_maybe_optional_arg(
  File "/usr/lib/python3.9/site-packages/pylatexenc/latexwalker/__init__.py", line 1649, in get_latex_maybe_optional_arg
    tok = self.get_token(pos, include_brace_chars=[('[', ']')], environments=False,
  File "/usr/lib/python3.9/site-packages/pylatexenc/latexwalker/__init__.py", line 1356, in get_token
    raise LatexWalkerEndOfStream(final_space=space)
pylatexenc.latexwalker.LatexWalkerEndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/marcelroed/.cache/yay/python-pylatexenc/src/pylatexenc-2.10/test/test_latexwalker.py", line 1425, in test_bug_issueno57
    (nodelist, npos, nlen) = lw.get_latex_nodes(pos, read_max_nodes=1)
  File "/usr/lib/python3.9/site-packages/pylatexenc/latexwalker/__init__.py", line 2351, in get_latex_nodes
    r_endnow = do_read(nodelist, p)
  File "/usr/lib/python3.9/site-packages/pylatexenc/latexwalker/__init__.py", line 2256, in do_read
    if e is not None: raise e
pylatexenc.latexwalker.LatexWalkerParseError: Missing arguments of macro "foo" @(1,0)
Open LaTeX blocks:
            @(1,0)  arguments of macro "foo"


======================================================================
FAIL: test_all (test_latexencode_all.TestLatexEncodeAll)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marcelroed/.cache/yay/python-pylatexenc/src/pylatexenc-2.10/test/test_latexencode_all.py", line 92, in test_all
    raise self.failureException("Unicode coverage tests failed. See full diff above.")
AssertionError: Unicode coverage tests failed. See full diff above.

======================================================================
FAIL: test_bug_issueno49 (test_latexwalker.TestLatexWalker)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marcelroed/.cache/yay/python-pylatexenc/src/pylatexenc-2.10/test/test_latexwalker.py", line 1398, in test_bug_issueno49
    self.assertEqual(nlen, node.len)
AssertionError: 6 != 1

======================================================================
FAIL: test_get_token (test_latexwalker.TestLatexWalker)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/marcelroed/.cache/yay/python-pylatexenc/src/pylatexenc-2.10/test/test_latexwalker.py", line 96, in test_get_token
    self.assertEqual(lw.get_token(pos=p),
AssertionError: Latex[20 chars]rg='mymacro', pos=181, len=10, pre_space='', post_space='\n\n') != Latex[20 chars]rg='mymacro', pos=181, len=8, pre_space='', post_space='')

----------------------------------------------------------------------

Tyilo commented on 2021-09-28 16:07 (UTC)

@aplund Done.

aplund commented on 2021-09-25 02:32 (UTC) (edited on 2021-09-25 02:33 (UTC) by aplund)

The current version is 2.10. Would you consider the following patch to update:

From b3a1154dbbf302f59f0dbe4dad098051f7b57bab Mon Sep 17 00:00:00 2001
From: Austin Lund <austin.lund@gmail.com>
Date: Sat, 25 Sep 2021 12:28:08 +1000
Subject: [PATCH] Update version to 2.10

---
 PKGBUILD | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index 275d282..f6ded91 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,18 +2,29 @@
 # PKGBUILD generated by pipman
 # Python package author: Philippe Faist <philippe.faist@bluewin.ch>
 pkgname=python-pylatexenc
-pkgver=1.3
+pkgver=2.10
 pkgrel=1
 pkgdesc="Python library for encoding unicode to latex and for parsing LaTeX to generate unicode text"
 arch=(any)
 url="https://github.com/phfaist/pylatexenc"
 license=(MIT)
-makedepends=("python" "python-pip")
+depends=(python)
+makedepends=(python-setuptools)
+source=("${pkgname}-v${pkgver}.tar.gz::https://github.com/phfaist/pylatexenc/archive/refs/tags/v${pkgver}.tar.gz")
+sha256sums=(bcb859affea00b5acb25aec780620170ab9d385c8f7dc266b7237ce9f47a59fd)
+
 build() {
-  pip install --no-deps --target="pylatexenc" pylatexenc
+    cd "pylatexenc-${pkgver}"
+    python setup.py build
 }
+
 package() {
-  sitepackages=$(python -c "import site; print(site.getsitepackages()[0])")
-  mkdir -p $pkgdir/"$sitepackages"
-  cp -r $srcdir/pylatexenc/* $pkgdir/"$sitepackages"
+    cd "pylatexenc-${pkgver}"
+    python setup.py install --root="$pkgdir" --optimize=1
+    install -D -m644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE.txt
+}
+
+check() {
+    cd "pylatexenc-${pkgver}"
+    python -m unittest test/test_*.py
 }
-- 
2.33.0