heynemann/pyvows

Py3 status (site, README)

Zearin opened this issue · 30 comments

Just started with PyVows, and I love it. I’m about to try it with some Python 3, but it would be nice if the website or README let me know what PyVows Python 3 status is without having to check for myself. :)

Thanks for a freakin’ great module! :D


Update: Checklist

  • Add Py3 status to the site
  • Add Py3 status to README

I'm not sure, actually.

If you can try it out and contribute on how are we doing on Python 3.0, I'd be very thankful.

I don’t have Python 3.0, but I have Python 3.2. I know there are some feature-level differences between the two…but I don’t know what they are. :-/

But I can see how things go on 3.2.

Ironically, I’m kind of new to testing. (That’s what made me look around for different frameworks; PyVows was the most attractive. ☺) Could you walk me through what I need to do to test PyVows on Python 3.2?

I meant 3.2. The lastest version, hehehe.

Sure, you just need to run pyvows test suite in python 3.2.

Pyvows tests itself. ;) Just run its suite.

Even though that does not prove that every SINGLE feature works, it will
prove most work. We can keep adding things as we find them.

Cheers,
Bernardo Heynemann

Update

Looks like it won’t be possible until we ditch GEvent. (See #55.)

In the meantime…

GEvent itself wants to support Python 3. They want to support Python 2.x as far back as 2.5, which was causing them grief when they didn’t know how to deal with the different syntaxes for exception handling. It seems they have overcome this particular barrier, and are working on Python 3 support.

(See gevent/gevent#38)

What about using pyuv?

I've got PyVows working with Python 3.4 in my project (https://github.com/davedoesdev/python-jwt).

You need gevent>=1.1rc1 and the following monkey patching:

import sys
if sys.version_info >= (3, 0):
    import pyvows.reporting.common
    pyvows.reporting.common.unicode = str

import inspect
_orig_ismethod = inspect.ismethod
inspect.ismethod = lambda o: _orig_ismethod(o) or inspect.isfunction(o)

w00t w00t! That is great news! :) I haven’t had time for this project in ages, but it’s still very important to me. I really appreciate any help.


Spur-of-the-moment thought:

For Python 3, going with gevent is one possible route. Another is going with asyncio for Python 3, and asyncio’s backport for Python 2 (called trollius IIRC).

These are not mutually exclusive. I can imagine the pyvows.runners package containing a library of runners, including both gevent and asyncio.

Have you had any experience with asyncio?

I’ve watched Guido’s talks on it over and over, and I totally get the large-scale concepts…but whenever I try to play around with it, I have trouble turning my ideas into code. Even though I love Python and dislike (but not hate!) JavaScript, wrapping my brain around how to code using EventEmitter objects in Node.js was easy. Wrapping my brain around how to code using asyncio has been difficult for me.


I think sticking with gevent is the right direction for the near-term. I’ll have time to check out your work tonight. If it looks good, I’ll make a new branch for it in the official repo for testing and refinement before merging into master.

…I’m so excited! Thanks again for your work on this! :)

@Zearin let me know if you need any help.
I'm using py.test for my current project but don't really like it as much as pyvows.

I got distracted yesterday and forgot to check your work. I can do it today in the next hour or two. TTYS!

@davedoesdev Can you give me instructions on how to run your project’s tests after a fresh git clone?

  • pip install -r requirements.txt
  • make node_deps
  • make test

I noticed when I ran make node_deps that the console printed --python=python2.7. Can you explain if/how this affects running PyVows on Python 3?

Latest output:

 make test
./test/run/run_pyvows.py -v test

 ============
 Vows Results
 ============

  ✓ OK » 50037 honored • 0 broken (968.162732s)

Holy CRAP! You have 50K tests with a 15-minute runtime?!?! Now that is some thoroughly tested code.

No wonder you’re using PyVows! (I still can’t even believe it still takes PyVows 15 minutes to run the tests!)

Reason for --python=python2.7 is nodejs/node-gyp#193 and https://codereview.chromium.org/1454433002
(2.7 is only used when actually installing the Node modules - for interop testing with node-jsjws).
3.4 is used for the tests.

@davedoesdev I did the following:

  1. Opened test/run/run_pyvows.py
  2. Changed the shebang from #!/usr/bin/env python#!/usr/bin/env python3
  3. Ran make test

And I got the following output:

./test/run/run_pyvows.py -v test

 ============
 Vows Results
 ============


    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Generate jwt
      Verify jwt all algs allowed

       Error in topic:
      expired
      Nested tests following this error have not been run.
    Pem as hmac key
      Verify token using public pemhs256 alg allowed
      ✗ token should verify
          Expected topic(expired) to be an instance of <class 'tuple'>, but it was a <class 'jwt._JWTError'>

           found in /Users/amrogers/python-jwt/test/pem_as_hmac_key_vows.py at line 33 

  ✗ OK » 50026 honored • 1 broken (1420.460436s)

make: *** [run_test] Error 1

Interesting. What spec is the machine running the test? It may be that I need to increase the expiry time.
Although it passes on Travis and that is quite slow (or used to be - perhaps their container-based infrastructure is faster).

The other option is to decrease the parallelism, which might be easier.

The pem_as_hmac_key_vows.py test failed. Let's check it passes when run on its own.
@Zearin does this pass?

PYTHONPATH=. ./test/run/run_pyvows.py test/pem_as_hmac_key_vows.py

Btw - is there a way to control how many batches PyVows runs at once?

Ah it seems not. It seems all batches from all suites are run in parallel at once.
I guess one way around this in the Makefile (or run_pyvows.py) is to run each _vows.py file separately.

I should have a patch tomorrow which monkey patches PyVows to run batches in series, which should help the expiry problem. Just tidying things up.

@Zearin could you pull and try running the test again please? The latest code runs batches in series so hopefully the tokens won't expire on your machine now.

Okay!

First bit:

$ PYTHONPATH=. ./test/run/run_pyvows.py test/pem_as_hmac_key_vows.py

 ============
 Vows Results
 ============

  ✓ OK » 4 honored • 0 broken (0.005890s)

Then, the real part:

$ make test
./test/run/run_pyvows.py -v test

 ============
 Vows Results
 ============

  ✓ OK » 50037 honored • 0 broken (921.028081s)

w00+!

@davedoesdev Thoughts?

So you have the PyVows tests for python_jwt working now on Python 3?
If so, those monkey patches I'm doing against PyVows should be folded into the source proper.

So you have the PyVows tests for python_jwt working now on Python 3?
If so, those monkey patches I'm doing against PyVows should be folded into the source proper.

Cool. And thanks—I appreciate all your help on this!

@Zearin did you manage to get those patches across?

Alas…

I am truly happy that PyVows is finally on its way to supporting Python 3, but I have been out of touch with the project for years now. Once I worked on PyVows quite a bit, but that time is past. I’ve moved onto other testing suites now.

@Zearin did you manage to get those patches across?

I was going to reply to this with a “No…sorry!” message, when I realized that my heart just isn’t in the project anymore. Make no mistake—I still care about it and want it to succeed! It was the first open source project I made nontrivial contributions to, and was eventually invited to join the dev team.

I enjoyed that time. But I’ve moved on. Perhaps it’s time for someone new to take my place…

@davedoesdev: Would you be interested in taking over as custodian of the project?

@heynemann: If @davedoesdev accepts, are you okay with making him a collaborator?

Definitely ok with it.
Em 28 de abr de 2016 12:05, "Zearin" notifications@github.com escreveu:

Alas…

I am truly happy that PyVows is finally on its way to supporting Python 3,
but I have been out of touch with the project for years now. Once I worked
on PyVows quite a bit, but that time is past. I’ve moved onto other testing
suites now.

@Zearin https://github.com/Zearin did you manage to get those patches
across?

I was going to reply to this with a “No…sorry!” message, when I realized
that my heart just isn’t in the project anymore. Make no mistake—I still
care about it and want it to succeed! It was the first open source project
I made nontrivial contributions to, and was eventually invited to join the
dev team.

I enjoyed that time. But I’ve moved on. Perhaps it’s time for someone new
to take my place…

@davedoesdev https://github.com/davedoesdev: Would you be interested in
taking over as custodian of the project?

@heynemann https://github.com/heynemann: If @davedoesdev
https://github.com/davedoesdev accepts, are you okay with making him a
collaborator?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#23 (comment)

Love to but with $DAYJOB and my own projects I don't have enough time.
Reluctantly I've moved onto pytest on my latest projects.