Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py3 status (site, README) #23

Open
2 tasks
Zearin opened this issue Mar 3, 2012 · 30 comments
Open
2 tasks

Py3 status (site, README) #23

Zearin opened this issue Mar 3, 2012 · 30 comments
Milestone

Comments

@Zearin
Copy link
Collaborator

Zearin commented Mar 3, 2012

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
@heynemann
Copy link
Owner

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.

@Zearin
Copy link
Collaborator Author

Zearin commented Mar 8, 2012

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?

@heynemann
Copy link
Owner

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

@Zearin
Copy link
Collaborator Author

Zearin commented Jan 6, 2013

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)

@AphonicChaos
Copy link

What about using pyuv?

@davedoesdev
Copy link
Contributor

I've got PyVows working with Python 3.4 in my project (https:/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)

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 2, 2015

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 Zearin added the feature label Dec 2, 2015
@davedoesdev
Copy link
Contributor

@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.

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 3, 2015

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

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 3, 2015

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

@davedoesdev
Copy link
Contributor

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

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 4, 2015

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?

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 4, 2015

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!)

@davedoesdev
Copy link
Contributor

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.

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 5, 2015

@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

@davedoesdev
Copy link
Contributor

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).

@davedoesdev
Copy link
Contributor

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

@davedoesdev
Copy link
Contributor

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

@davedoesdev
Copy link
Contributor

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

@davedoesdev
Copy link
Contributor

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.

@davedoesdev
Copy link
Contributor

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.

@davedoesdev
Copy link
Contributor

@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.

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 13, 2015

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+!

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 14, 2015

@davedoesdev Thoughts?

@davedoesdev
Copy link
Contributor

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.

@Zearin
Copy link
Collaborator Author

Zearin commented Dec 15, 2015

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!

@davedoesdev
Copy link
Contributor

@Zearin did you manage to get those patches across?

@Zearin
Copy link
Collaborator Author

Zearin commented Apr 28, 2016

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?

@heynemann
Copy link
Owner

Definitely ok with it.
Em 28 de abr de 2016 12:05, "Zearin" [email protected] 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:/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:/davedoesdev: Would you be interested in
taking over as custodian of the project?

@heynemann https:/heynemann: If @davedoesdev
https:/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)

@davedoesdev
Copy link
Contributor

davedoesdev commented Apr 30, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants