Submitter | Manuel Jacob |
---|---|
Date | March 6, 2020, 10:05 p.m. |
Message ID | <186c13bbb49fd4de4fd2.1583532306@tmp> |
Download | mbox | patch |
Permalink | /patch/45577/ |
State | Accepted |
Headers | show |
Comments
On Fri, 06 Mar 2020 23:05:06 +0100, Manuel Jacob wrote: > # HG changeset patch > # User Manuel Jacob <me@manueljacob.de> > # Date 1583532298 -3600 > # Fri Mar 06 23:04:58 2020 +0100 > # Node ID 186c13bbb49fd4de4fd2c9983c3daf8fede5b177 > # Parent 4ce2330f2d0b9690cc852602a9e055491a408c03 > tests: use pyflakes module instead of pyflakes executable Queued, thanks. > diff --git a/tests/hghave.py b/tests/hghave.py > --- a/tests/hghave.py > +++ b/tests/hghave.py > @@ -553,7 +553,7 @@ > @check("pyflakes", "Pyflakes python linter") > def has_pyflakes(): > return matchoutput( > - "sh -c \"echo 'import re' 2>&1 | pyflakes\"", > + "sh -c \"echo 'import re' 2>&1 | $PYTHON -m pyflakes\"", > br"<stdin>:1: 're' imported but unused", > True, Perhaps, this can be rewritten as "try: import pyflakes" since we no longer use the pyflakes executable.
On 2020-03-08 06:24, Yuya Nishihara wrote: > On Fri, 06 Mar 2020 23:05:06 +0100, Manuel Jacob wrote: >> # HG changeset patch >> # User Manuel Jacob <me@manueljacob.de> >> # Date 1583532298 -3600 >> # Fri Mar 06 23:04:58 2020 +0100 >> # Node ID 186c13bbb49fd4de4fd2c9983c3daf8fede5b177 >> # Parent 4ce2330f2d0b9690cc852602a9e055491a408c03 >> tests: use pyflakes module instead of pyflakes executable > > Queued, thanks. > >> diff --git a/tests/hghave.py b/tests/hghave.py >> --- a/tests/hghave.py >> +++ b/tests/hghave.py >> @@ -553,7 +553,7 @@ >> @check("pyflakes", "Pyflakes python linter") >> def has_pyflakes(): >> return matchoutput( >> - "sh -c \"echo 'import re' 2>&1 | pyflakes\"", >> + "sh -c \"echo 'import re' 2>&1 | $PYTHON -m pyflakes\"", >> br"<stdin>:1: 're' imported but unused", >> True, > > Perhaps, this can be rewritten as "try: import pyflakes" since we no > longer > use the pyflakes executable. I’m not sure whether that would work. On my machine, hghave.py is run with /tmp/hgtests.ds59p4hc/install/bin/python $PYTHON is /bin/python3
On Sun, 08 Mar 2020 23:26:44 +0100, Manuel Jacob wrote: > On 2020-03-08 06:24, Yuya Nishihara wrote: > > On Fri, 06 Mar 2020 23:05:06 +0100, Manuel Jacob wrote: > >> # HG changeset patch > >> # User Manuel Jacob <me@manueljacob.de> > >> # Date 1583532298 -3600 > >> # Fri Mar 06 23:04:58 2020 +0100 > >> # Node ID 186c13bbb49fd4de4fd2c9983c3daf8fede5b177 > >> # Parent 4ce2330f2d0b9690cc852602a9e055491a408c03 > >> tests: use pyflakes module instead of pyflakes executable > > > > Queued, thanks. > > > >> diff --git a/tests/hghave.py b/tests/hghave.py > >> --- a/tests/hghave.py > >> +++ b/tests/hghave.py > >> @@ -553,7 +553,7 @@ > >> @check("pyflakes", "Pyflakes python linter") > >> def has_pyflakes(): > >> return matchoutput( > >> - "sh -c \"echo 'import re' 2>&1 | pyflakes\"", > >> + "sh -c \"echo 'import re' 2>&1 | $PYTHON -m pyflakes\"", > >> br"<stdin>:1: 're' imported but unused", > >> True, > > > > Perhaps, this can be rewritten as "try: import pyflakes" since we no > > longer > > use the pyflakes executable. > > I’m not sure whether that would work. > > On my machine, > > hghave.py is run with /tmp/hgtests.ds59p4hc/install/bin/python > $PYTHON is /bin/python3 /install/bin/python should be a symlink to python3 if run-tests.py was run by python3. Otherwise some other hghave rules wouldn't work.
Patch
diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -553,7 +553,7 @@ @check("pyflakes", "Pyflakes python linter") def has_pyflakes(): return matchoutput( - "sh -c \"echo 'import re' 2>&1 | pyflakes\"", + "sh -c \"echo 'import re' 2>&1 | $PYTHON -m pyflakes\"", br"<stdin>:1: 're' imported but unused", True, ) diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t --- a/tests/test-check-pyflakes.t +++ b/tests/test-check-pyflakes.t @@ -20,7 +20,7 @@ > -X mercurial/thirdparty/concurrent \ > -X mercurial/thirdparty/zope \ > 2>/dev/null \ - > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" + > | xargs $PYTHON -m pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" contrib/perf.py:*: undefined name 'xrange' (glob) (?) mercurial/hgweb/server.py:*: undefined name 'reload' (glob) (?) mercurial/util.py:*: undefined name 'file' (glob) (?)