Patchwork [1,of,2] py3: have check-py3-compat require pygments to get stable result

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 17, 2016, 12:26 p.m.
Message ID <8ee007258724d72cac35.1471436817@mimosa>
Download mbox | patch
Permalink /patch/16325/
State Changes Requested
Headers show

Comments

Yuya Nishihara - Aug. 17, 2016, 12:26 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1471434770 -32400
#      Wed Aug 17 20:52:50 2016 +0900
# Node ID 8ee007258724d72cac3538970f1562a1950b1407
# Parent  178c89e8519a6111072a4331601efb34f63de59e
py3: have check-py3-compat require pygments to get stable result
Augie Fackler - Aug. 17, 2016, 1:22 p.m.
On Wed, Aug 17, 2016 at 09:26:57PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1471434770 -32400
> #      Wed Aug 17 20:52:50 2016 +0900
> # Node ID 8ee007258724d72cac3538970f1562a1950b1407
> # Parent  178c89e8519a6111072a4331601efb34f63de59e
> py3: have check-py3-compat require pygments to get stable result

Shouldn't we have a py3pygments for this? Otherwise I think this test will run if I have pygments installed in my Python 2, and Python 3 still won't be able to find pygments.

>
> diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
> --- a/tests/test-check-py3-compat.t
> +++ b/tests/test-check-py3-compat.t
> @@ -12,7 +12,7 @@
>    setup.py not using absolute_import
>    tests/test-demandimport.py not using absolute_import
>
> -#if py3exe
> +#if py3exe pygments
>    $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
>    doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
>    hgext/acl.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
> @@ -48,7 +48,7 @@
>    hgext/gpg.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
>    hgext/graphlog.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
>    hgext/hgk.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
> -  hgext/highlight/highlight.py: error importing module: <ImportError> No module named 'pygments' (line 13)
> +  hgext/highlight/highlight.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
>    hgext/histedit.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
>    hgext/journal.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
>    hgext/keyword.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Yuya Nishihara - Aug. 18, 2016, 8:31 a.m.
On Wed, 17 Aug 2016 09:22:11 -0400, Augie Fackler wrote:
> On Wed, Aug 17, 2016 at 09:26:57PM +0900, Yuya Nishihara wrote:
> > # HG changeset patch
> > # User Yuya Nishihara <yuya@tcha.org>
> > # Date 1471434770 -32400
> > #      Wed Aug 17 20:52:50 2016 +0900
> > # Node ID 8ee007258724d72cac3538970f1562a1950b1407
> > # Parent  178c89e8519a6111072a4331601efb34f63de59e
> > py3: have check-py3-compat require pygments to get stable result
> 
> Shouldn't we have a py3pygments for this? Otherwise I think this test will run if I have pygments installed in my Python 2, and Python 3 still won't be able to find pygments.

Indeed. V2 is coming.

Patch

diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -12,7 +12,7 @@ 
   setup.py not using absolute_import
   tests/test-demandimport.py not using absolute_import
 
-#if py3exe
+#if py3exe pygments
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
   doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   hgext/acl.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
@@ -48,7 +48,7 @@ 
   hgext/gpg.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
   hgext/graphlog.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
   hgext/hgk.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
-  hgext/highlight/highlight.py: error importing module: <ImportError> No module named 'pygments' (line 13)
+  hgext/highlight/highlight.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
   hgext/histedit.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
   hgext/journal.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
   hgext/keyword.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)