testing-cabal / linecache2

Backport of the Python stdlib linecache module
1 stars 5 forks source link

renamed all tests files - fixes #2 #4

Closed tarekziade closed 9 years ago

tarekziade commented 9 years ago

I tried to generate the files using the module content as data but that leads to very ugly code. I think the renaming is the most straightforward, less disruptive change - if you think that can be changed in stdlib too.

rbtcollins commented 9 years ago

That will depend on the inspect module. (inspect_fodder is test data for inspect).I really think we should separate out the linecache test data from inspect in the stdlib, which will sort this out.

Natim commented 9 years ago

We shouldn't have .py files that aren't python code. We should merge this anyway because it is breaking current installations. Thanks @tarekziade for the bugfix.

rbtcollins commented 9 years ago

They are python code. And it doesn't break installations, so its low pri - we can take the time to do it right.

On 18 March 2015 at 21:40, Rémy HUBSCHER notifications@github.com wrote:

We shouldn't have .py files that aren't python code. We should merge this anyway because it is breaking current installations. Thanks @tarekziade https://github.com/tarekziade for the bugfix.

— Reply to this email directly or view it on GitHub https://github.com/testing-cabal/linecache2/pull/4#issuecomment-82822059 .

Robert Collins rbtcollins@hp.com Distinguished Technologist HP Converged Cloud

Natim commented 9 years ago

it finds a syntax error in inspect_fodder2.py

rbtcollins commented 9 years ago

See #1 - thats in the compile step which doesn't affect install - its still installs happily (under setuptools or pip).

rbtcollins commented 9 years ago

To be clear - I'm entirely in favour of resolving this, I just don't want to incur technical debt against future backports from trunk, which is the reason for existence of this module.

Natim commented 9 years ago

Even if the module is well installed, having an error when installing it is not satisfying, also when installing it as a dependency of another module, pip just fails, you have to install it manually before installing the rest of your requirements to fix it, which is not what we want.

I really think we should separate out the linecache test data from inspect in the stdlib.

I did not understand what you are trying to say here. What is the way forward? How can we help?

rbtcollins commented 9 years ago

Newer versions of pip won't show the compile warning at all. Can you please attach the output of a failing pip run - I've just tried this on 2.6: mkvirtualenv test pip install unittest2

which works (and brings in linecache2 as a dependency).

Moving this forward: fix the tests in cPython master so that they don't depend on the inspect_fodder* files. That might be done by new static files or just-in-time files with whatever characteristics needed for the tests. The way to do that is an issue in bugs.python.org with a patch.

tarekziade commented 9 years ago

You are right the latest pip does not seem to be affected.

$ bin/pip --version
pip 1.4 from /private/tmp/testing/lib/python2.7/site-packages (python 2.7)
tarekz:testing tarek$ bin/pip install linecache2
Downloading/unpacking linecache2
  Using download cache from /Users/tarek/.pip-downloads/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fl%2Flinecache2%2Flinecache2-1.0.0.tar.gz
  Running setup.py egg_info for package linecache2

    Installed /private/tmp/testing/build/linecache2/pbr-0.10.8-py2.7.egg
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found

    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Installing collected packages: linecache2
  Running setup.py install for linecache2
    [pbr] Reusing existing SOURCES.txt
      File "/private/tmp/testing/lib/python2.7/site-packages/linecache2/tests/inspect_fodder2.py", line 102
        def keyworded(*arg1, arg2=1):
                                ^
    SyntaxError: invalid syntax

Successfully installed linecache2
Cleaning up...

tarekz:testing tarek$ bin/pip --version
pip 6.0.8 from /private/tmp/testing/lib/python2.7/site-packages (python 2.7)
tarekz:testing tarek$ rm  -rf lib/python2.7/site-packages/linecache2*
tarekz:testing tarek$ bin/pip install linecache2
DEPRECATION: --download-cache has been deprecated and will be removed in the future. Pip now automatically uses and configures its cache.
Collecting linecache2
  Using cached linecache2-1.0.0-py2.py3-none-any.whl
Installing collected packages: linecache2
  Compiling /private/var/folders/9f/hxxvjvvn2t34rf54y873z6900000gn/T/pip-build-Rn1ry0/linecache2/linecache2/tests/inspect_fodder2.py
Successfully installed linecache2-1.0.0

That's good enough on my side - we'll just update pip. Thanks for your feedback