Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 458648 - dev-python/ply-3.4-r1 fails tests because of missing .pyo files
Summary: dev-python/ply-3.4-r1 fails tests because of missing .pyo files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL: https://github.com/dabeaz/ply/issues/50
Whiteboard:
Keywords:
: 459314 514446 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-21 23:32 UTC by Michał Górny
Modified: 2017-01-23 13:37 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-02-21 23:32:03 UTC
FAIL: test_lex_many_tokens (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "testlex.py", line 559, in test_lex_many_tokens
    self.assert_(pymodule_out_exists("manytab.pyo"))
AssertionError: False is not true

It looks like they're doing quite a fragile assumptions there.
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2013-02-28 15:00:36 UTC
*** Bug 459314 has been marked as a duplicate of this bug. ***
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2013-03-02 09:36:01 UTC
testlex.py has a total of 5 such files with .pyo.  Either turn the optimisation (-O) for the compiling by testlex.py or remove all instances of the .pyo files.
How do you enable the -O option?  It works fine in distutils ecalss with
python_enable_pyc and python_disable_pyc for and aft of src_test.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-03-02 12:43:55 UTC
(In reply to comment #2)
> testlex.py has a total of 5 such files with .pyo.  Either turn the
> optimisation (-O) for the compiling by testlex.py or remove all instances of
> the .pyo files.
> How do you enable the -O option?  It works fine in distutils ecalss with
> python_enable_pyc and python_disable_pyc for and aft of src_test.

Think of pypy.
Comment 4 Ian Delaney (RETIRED) gentoo-dev 2013-03-03 06:20:12 UTC
Q. How do you enable the -O option?

A. Think of pypy

yields  tilt.  You'd a thought this is 20 questions.  Bugs to me are for reporting (sure), followed by fixing and closing.  If you know how to do both, please get on with it.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-03-03 08:57:16 UTC
I'm just saying that you don't understand the issue and try to get bug count down quick. And then I will have to re-open it since the tests will still fail.
Comment 6 Tobias Klausmann (RETIRED) gentoo-dev 2014-06-23 12:09:14 UTC
*** Bug 514446 has been marked as a duplicate of this bug. ***
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2014-12-13 08:55:51 UTC
(In reply to Michał Górny from comment #5)
> I'm just saying that you don't understand the issue and try to get bug count
> down quick. And then I will have to re-open it since the tests will still
> fail.

I am just saying this is no time for lectures and exposing my lack of understanding.  You have the capacity to figure this off your own bat and you don't. No-one else does either it seems.  Subsequently 503094 has a small library of keyword and stable requests are left hanging off it.  Also they do not warrant be held up over missing .pyo files in an over demanding testsuite.

  13 Dec 2014; Ian Delaney <idella4@gentoo.org> ply-3.4-r1.ebuild:
  tests retricted, closes bug #458648, finally
Comment 8 Ian Delaney (RETIRED) gentoo-dev 2014-12-18 07:45:42 UTC
According to some well informed users, the fix for this requires the use of PYTHONDONTWRITEBYTECODE. According to an established ebuild, this can be done like so;

src_test() {
        # (unset)
        local -x PYTHONDONTWRITEBYTECODE

or alternatively can be set to "0", being true.  Sadly there is yet another flaw laying behind this once fixed. see $URL.  

The last comment by dabeaz gives mixed messages.  Initially it implies the problem lies within the test file itself.  The second throws everything wide open.  What we end with is a report of a fix in the repo, yet no release of this package since then, and statements casting doubt over the integrity of core files. 

I would leave this resolved UPSTREAM since it is them that leave us with this, however in consultation with comrel I have been asked to re-assign this open.
Timeout time set to 1 week makes it Christmas day~ I'll make it 6.  After that the above fix already proven effective is set for commit to  dev-python/ply-3.4-r1.
 
This action has been discussed with and endorsed by pachos2 of comrel
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-18 14:45:01 UTC
As I have already pointed out, your 'fix' doesn't solve the issue with PyPy. And there is no other proper fix but removing the test since it doesn't serve any real purpose and relies on implementation details.
Comment 10 Ian Delaney (RETIRED) gentoo-dev 2014-12-18 21:15:46 UTC
(In reply to Michał Górny from comment #9)
> As I have already pointed out, your 'fix' doesn't solve the issue with PyPy.
> And there is no other proper fix but removing the test since it doesn't
> serve any real purpose and relies on implementation details.

1. It's not (only) 'my' fix. It's feedback from Arfrever, as is the bug filed by him.
2. You never pointed out. You hinted obliquely, and for all of us this was only ever 'obvious' or apparent to you and Arfrever. Arfrever as we all know cannot act on it
3. Why not drop pypy and allow a clear path for this fix to apply?
4. Perhaps you could supply a patch.

On my part I have no disagreement with removing either the test(s) or support of pypy as a final solution.  seding out a test or 2 is a fix I have done scores of times in testsuites in 'python herd'.  pypy to my knowledge has a known user base of one and its 'need' or representation as a supporting python impl in packages in portage is random and arbitrary at best.

What is required here is a resolution so the bug can be closed.
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-18 21:43:45 UTC
(In reply to Ian Delaney from comment #10)
> (In reply to Michał Górny from comment #9)
> > As I have already pointed out, your 'fix' doesn't solve the issue with PyPy.
> > And there is no other proper fix but removing the test since it doesn't
> > serve any real purpose and relies on implementation details.
> 
> 3. Why not drop pypy and allow a clear path for this fix to apply?

Well, maybe we should go further and drop the whole package! It is certainly the root cause of the issue.

So let me repeat in bold: *tests* are broken, not the *package*, *PyPy* or the *ebuild*. So if you want to fix it, fix the tests. If you want to commit something random just to get bug count down, please just leave this bug open to people who actually care about improving things rather than pretending to fix bugs.

And just to be clear: *fixing* bugs is about figuring out what's wrong. Not figuring out what happens to make the error message disappear, or what someone else did to make it disappear. It's about understanding the issue, and finding a proper resolution.

> 4. Perhaps you could supply a patch.

So to sum up, you come here, make noise, waste others' time and in the end someone else ends up fixing the bug? Sounds familiar.
Comment 12 Arfrever Frehtes Taifersar Arahesis 2014-12-19 05:15:55 UTC
Master Arfrever hath ycreated the proper fix:
https://code.google.com/p/gentoo-progress/source/browse/overlays/progress/dev-python/ply/files/ply-3.5_pre20140101-tests.patch?r=5205
Comment 13 Mike Gilbert gentoo-dev 2014-12-19 17:17:31 UTC
(In reply to Ian Delaney from comment #8)
> I would leave this resolved UPSTREAM since it is them that leave us with
> this, however in consultation with comrel I have been asked to re-assign
> this open.
> Timeout time set to 1 week makes it Christmas day~ I'll make it 6.  After
> that the above fix already proven effective is set for commit to 
> dev-python/ply-3.4-r1.
>  
> This action has been discussed with and endorsed by pachos2 of comrel

Respectfully, comrel has no say in this, other than helping you communicate with mgorny.

If the tests are not fixed, this bug should remain open. There is no acceptable "timeout" after which we just decide to close it without resolving the issue.

Restricting tests should not be treated as a resolution; the test suite is not so completely broken as to warrant that.

It looks like Arfrever has helpfully supplied a patch; it might be wise to wait for upstream to review it.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-19 17:41:39 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #12)
> Master Arfrever hath ycreated the proper fix:
> https://code.google.com/p/gentoo-progress/source/browse/overlays/progress/
> dev-python/ply/files/ply-3.5_pre20140101-tests.patch?r=5205

It still doesn't cover the case of PYTHONDONTWRITEBYTECODE.
Comment 15 Pacho Ramos gentoo-dev 2014-12-21 11:59:18 UTC
Thanks a lot for the patch Arfrever :)

From my point of view, taking care this is only a testsuite bug, I would see no problem on waiting for upstream response (or for the next release) to get the patch introduced, as restricting tests is also a good option for now :/

But I am not even in python team, it's only an opinion :)
Comment 16 Pacho Ramos gentoo-dev 2017-01-18 12:09:43 UTC
can you recheck with 3.9 version?
Comment 17 Tobias Klausmann (RETIRED) gentoo-dev 2017-01-20 09:21:44 UTC
(In reply to Pacho Ramos from comment #16)
> can you recheck with 3.9 version?

It does work, sortof:

>>> Source compiled.                                                              
 * Skipping make test/check due to ebuild restriction.                            
>>> Test phase [disabled because of RESTRICT=test]: dev-python/ply-3.9            

If I remove the RESTRICT=test:


>>> Test phase: dev-python/ply-3.9
 * python2_7: running distutils-r1_run_phase python_test
.F..FFFF..................................
======================================================================
FAIL: test_lex_many_tokens (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "testlex.py", line 613, in test_lex_many_tokens
    self.assert_(pymodule_out_exists("manytab.pyo", 1))
AssertionError: False is not true

======================================================================
FAIL: test_lex_opt_alias (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "testlex.py", line 546, in test_lex_opt_alias
    self.assert_(pymodule_out_exists("aliastab.pyo", 1))
AssertionError: False is not true

======================================================================
FAIL: test_lex_optimize (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "testlex.py", line 395, in test_lex_optimize
    self.assert_(pymodule_out_exists("lextab.pyo", 1))
AssertionError: False is not true

======================================================================
FAIL: test_lex_optimize2 (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "testlex.py", line 450, in test_lex_optimize2
    self.assert_(pymodule_out_exists("opt2tab.pyo", 1))
AssertionError: False is not true

======================================================================
FAIL: test_lex_optimize3 (__main__.LexBuildOptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "testlex.py", line 500, in test_lex_optimize3
    self.assert_(pymodule_out_exists("lexdir/sub/calctab.pyo", 1))
AssertionError: False is not true
Comment 18 Mike Gilbert gentoo-dev 2017-01-22 02:16:52 UTC
It looks like newer versions of ply check for CPython for this particular set of tests.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8ce88f4bf28e8ca3e58ccdce8168060ec7b37d9

commit e8ce88f4bf28e8ca3e58ccdce8168060ec7b37d9
Author: Mike Gilbert <floppym@gentoo.org>
Date:   Sat Jan 21 21:12:23 2017 -0500

    dev-python/ply: clear PYTHONDONTWRITEBYTECODE for tests
    
    Bug: https://bugs.gentoo.org/458648
    Package-Manager: Portage-2.3.3_p32, Repoman-2.3.1_p25

 dev-python/ply/ply-3.6-r1.ebuild | 8 ++++----
 dev-python/ply/ply-3.8.ebuild    | 8 ++++----
 dev-python/ply/ply-3.9.ebuild    | 6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)
Comment 19 Mike Gilbert gentoo-dev 2017-01-22 02:25:35 UTC
(In reply to Tobias Klausmann from comment #17)

Thanks for retesting. My latest commit should take care of those failures.
Comment 20 Tobias Klausmann (RETIRED) gentoo-dev 2017-01-23 13:37:17 UTC
I've just now tested with 3.6-r1, 3.8 and 3.9 and they all compile and test fine.