Patchwork [1,of,4] py3: update test-check-py3-compat.t output

login
register
mail settings
Submitter Pulkit Goyal
Date Aug. 3, 2016, 7:18 p.m.
Message ID <498534103bb67c47f334.1470251902@pulkit-goyal>
Download mbox | patch
Permalink /patch/16066/
State Changes Requested
Headers show

Comments

Pulkit Goyal - Aug. 3, 2016, 7:18 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1470249288 -19800
#      Thu Aug 04 00:04:48 2016 +0530
# Branch stable
# Node ID 498534103bb67c47f334d84f20ced9bd5acde1aa
# Parent  d3df009ab1175a6792549b51ae66486dd98f398b
py3: update test-check-py3-compat.t output

The lower part of test-check-py3-compat.t runs only on py3 and hence its
 remain unchanged. Hence this patch updates the output so that change in output
 in the next patches will be only related to the change in the patch.
Pierre-Yves David - Aug. 4, 2016, 11:22 a.m.
On 08/03/2016 09:18 PM, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1470249288 -19800
> #      Thu Aug 04 00:04:48 2016 +0530
> # Branch stable
> # Node ID 498534103bb67c47f334d84f20ced9bd5acde1aa
> # Parent  d3df009ab1175a6792549b51ae66486dd98f398b
> py3: update test-check-py3-compat.t output
>
> The lower part of test-check-py3-compat.t runs only on py3 and hence its
>  remain unchanged. Hence this patch updates the output so that change in output
>  in the next patches will be only related to the change in the patch.

I've pushed that first one. Do we have a buildbot covering this?
Pulkit Goyal - Aug. 4, 2016, 11:28 a.m.
> I've pushed that first one. Do we have a buildbot covering this?

AFAIK No.
Katsunori FUJIWARA - Aug. 5, 2016, 2:41 a.m.
At Thu, 04 Aug 2016 00:48:22 +0530,
Pulkit Goyal wrote:
> 
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1470249288 -19800
> #      Thu Aug 04 00:04:48 2016 +0530
> # Branch stable
> # Node ID 498534103bb67c47f334d84f20ced9bd5acde1aa
> # Parent  d3df009ab1175a6792549b51ae66486dd98f398b
> py3: update test-check-py3-compat.t output
> 
> The lower part of test-check-py3-compat.t runs only on py3 and hence its
>  remain unchanged. Hence this patch updates the output so that change in output
>  in the next patches will be only related to the change in the patch.
> 
> diff -r d3df009ab117 -r 498534103bb6 tests/test-check-py3-compat.t
> --- a/tests/test-check-py3-compat.t	Wed Jul 20 14:12:45 2016 -0500
> +++ b/tests/test-check-py3-compat.t	Thu Aug 04 00:04:48 2016 +0530
> @@ -136,8 +136,9 @@
>    mercurial/patch.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
>    mercurial/pathutil.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
>    mercurial/peer.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
> -  mercurial/pure/mpatch.py: error importing module: <AttributeError> 'VendorImporter' object has no attribute 'find_spec' (line *) (glob)
> -  mercurial/pure/parsers.py: error importing module: <AttributeError> 'VendorImporter' object has no attribute 'find_spec' (line *) (glob)
> +  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob)
> +  mercurial/pure/osutil.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob)
> +  mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob)
>    mercurial/pushkey.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
>    mercurial/pvec.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
>    mercurial/registrar.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)

Thnak you for this patch! I'm just investigating why
test-check-py3-compat.t fails only on my environment :-)

But even after this patch, test-check-py3-compat.t fails with error
below on my environment:

@@ -136,7 +136,7 @@
   mercurial/patch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
   mercurial/pathutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
   mercurial/peer.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
-  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob)
+  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'policy' (line 12)
   mercurial/pure/osutil.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob)
   mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob)
   mercurial/pushkey.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)

Would you have any suggestion for me ?

I run test-check-py3-compat.t by the command line below on the root of
Mercurial source repository with Python 3.5.2

  (cd tests && python ./run-tests.py --with-python3 `which python3` test-check-py3-compat.t)


In fact, I have the path to fix problem that mercurial/pure/*.py
causes error at relative importing only at check-py3-compat.py. But I
can't believe validity of my work, because of this unexpected failure
of test-check-py3-compat.t :-<



> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy@lares.dti.ne.jp
Pulkit Goyal - Aug. 5, 2016, 10:48 a.m.
> @@ -136,7 +136,7 @@
>    mercurial/patch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
>    mercurial/pathutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
>    mercurial/peer.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
> -  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob)
> +  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'policy' (line 12)
>    mercurial/pure/osutil.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob)
>    mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob)
>    mercurial/pushkey.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
>
> Would you have any suggestion for me ?

mpatch.py doesnot imports policy, do cross-check that (I think you
have already done that) line 12 in mpatch.py says from . import
pycompat, not from . import policy. Moreover I don't see a reason for
this behaviour if you have from . import pycompat there. If I can have
a look at your repo, I can say more :)
Katsunori FUJIWARA - Aug. 5, 2016, 4:14 p.m.
At Fri, 5 Aug 2016 16:18:57 +0530,
Pulkit Goyal wrote:
> 
> > @@ -136,7 +136,7 @@
> >    mercurial/patch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
> >    mercurial/pathutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
> >    mercurial/peer.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
> > -  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob)
> > +  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'policy' (line 12)
> >    mercurial/pure/osutil.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob)
> >    mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob)
> >    mercurial/pushkey.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
> >
> > Would you have any suggestion for me ?
> 
> mpatch.py doesnot imports policy, do cross-check that (I think you
> have already done that) line 12 in mpatch.py says from . import
> pycompat, not from . import policy. Moreover I don't see a reason for
> this behaviour if you have from . import pycompat there. If I can have
> a look at your repo, I can say more :)

Oh, sorry. I have tested test-check-py3-compat.t on tip of
hg-committed repo (at that time), and it includes Maciej's cffi work
on pure/mpatch.py.

    https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-July/086555.html
    or https://www.mercurial-scm.org/repo/hg-committed/rev/f2846d546645

This replaced "from . import pycompat" by "from . import policy, pycompat".

I can confirm expected result of test-check-py3-compat.t at testing on
current tip of main hg repo. Thank you !

This means that we should update test-check-py3-compat.t soon again,
though :-P


----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy@lares.dti.ne.jp
Pulkit Goyal - Aug. 5, 2016, 5:03 p.m.
> This means that we should update test-check-py3-compat.t soon again,
> though :-P

Yeah and it will be better to have the build bot cover python 3 after
some amount of time.
Pierre-Yves David - Aug. 6, 2016, 12:23 a.m.
On 08/05/2016 07:03 PM, Pulkit Goyal wrote:
>> This means that we should update test-check-py3-compat.t soon again,
>> though :-P
>
> Yeah and it will be better to have the build bot cover python 3 after
> some amount of time.

I'm not sure there is any reason to delay this. We could enabled test 
that we know to work only.
Pulkit Goyal - Aug. 7, 2016, 7:39 p.m.
> I'm not sure there is any reason to delay this. We could enabled test that
> we know to work only.

Then let's have it asap :)
Pierre-Yves David - Aug. 7, 2016, 11:47 p.m.
On 08/07/2016 09:39 PM, Pulkit Goyal wrote:
>> I'm not sure there is any reason to delay this. We could enabled test that
>> we know to work only.
>
> Then let's have it asap :)

Great, can you look into having that done? There is some details about 
the buildbot on the wiki https://www.mercurial-scm.org/wiki/Buildbot.
However I do not see anything about configuring new runs. Kevin Bullock 
will know more about this.

Cheers,

Patch

diff -r d3df009ab117 -r 498534103bb6 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Wed Jul 20 14:12:45 2016 -0500
+++ b/tests/test-check-py3-compat.t	Thu Aug 04 00:04:48 2016 +0530
@@ -136,8 +136,9 @@ 
   mercurial/patch.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
   mercurial/pathutil.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
   mercurial/peer.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
-  mercurial/pure/mpatch.py: error importing module: <AttributeError> 'VendorImporter' object has no attribute 'find_spec' (line *) (glob)
-  mercurial/pure/parsers.py: error importing module: <AttributeError> 'VendorImporter' object has no attribute 'find_spec' (line *) (glob)
+  mercurial/pure/mpatch.py: error importing module: <ImportError> cannot import name 'pycompat' (line *) (glob)
+  mercurial/pure/osutil.py: error importing module: <ImportError> cannot import name 'policy' (line *) (glob)
+  mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'mercurial.pure.node' (line *) (glob)
   mercurial/pushkey.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
   mercurial/pvec.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)
   mercurial/registrar.py: error importing: <TypeError> '_fields_' must be a sequence of (name, C type) pairs (error at osutil.py:*) (glob)