Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Add python 3.3 to python and allow_failures #148 #149

Closed
wants to merge 14 commits into from

Conversation

graingert
Copy link
Contributor

No description provided.

@graingert
Copy link
Contributor Author

Don't merge this until unittest2 problems are solved

This allows support for both python 2.6 and 3.3
@graingert
Copy link
Contributor Author

The skip_if function was taken from the MIT licensed https://github.com/eventlet/eventlet/blob/master/tests/__init__.py

In my opinion not a "significant portion of the code"

@willkg
Copy link
Member

willkg commented Apr 6, 2013

We're already using nose and we only need a skip_if that takes a boolean. Something like this is probably better:

from functools import wraps

from nose.plugins.skip import SkipTest


def skip_if(condition):
    """Skips tests if condition is True.
    """
    def skipped_wrapper(func):
        @wraps(func)
        def wrapped(*args, **kwargs):
            if condition:
                def skip_function(*args, **kwargs):
                    raise SkipTest()
                return skip_function
            return func(*args, **kwargs)
        return wrapped
    return skipped_wrapper

I haven't tested that, but the gist is there and it's in the style of the rest of django-browserid.

@willkg
Copy link
Member

willkg commented Apr 7, 2013

This is awesome work! I'm really psyched about supporting python 3.3 and I'm glad someone else is doing it because I just haven't had time, yet.

@graingert
Copy link
Contributor Author

It looks like with @willkg's change only 45 tests are run even under django 1.5 (not 47 as expected)

It's also broken with my skip_if fix, looks like it breaks classes

if condition:
def skip_function(*args, **kwargs):
raise SkipTest()
return skip_function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need to be:

if condition:
    raise SkipTest()
return func(*args, **kwargs)

@graingert
Copy link
Contributor Author

Woo, now we support Python 3.3! (at least on paper)

@Osmose
Copy link
Contributor

Osmose commented May 5, 2013

This looks good to me, if @willkg agrees I'll merge this in. :D

@graingert Oh yeah, can you add 3.3 back in as an allowed failure? I want to have at least one release with it as an allowed failure before I make it mandatory.

@willkg
Copy link
Member

willkg commented May 10, 2013

Super sorry about not seeing this until just now. I'll check it out tomorrow.

install:
- pip install -e git+git://github.com/sobotklp/django-nose@b3f485e914965e0a7b7012c309864d6a6dcac3ed#egg=django-nose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this line for? django-nose is already in requirements.txt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because django-nose by default does not support py3k, I'll add this to requirements.txt instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, hrm... It'd be better if we were using a released version of django-nose. Erik maintains django-nose. It's probably a good idea to push python 3 support in there. Having said that, I just remembered that "go through the django-nose python 3 support patches" is in my queue of things to do. :(

I don't think it should get added to requirements.txt since it's not something you need to have installed to use django-browserid. We should have a requirements-dev.txt file which has development-centric things in it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirements.txt only has extra stuff for dev, as the setup.py has the
install_requires

Thomas Grainger

On 10 May 2013 15:14, Will Kahn-Greene notifications@github.com wrote:

In .travis.yml:

install:

    • pip install -e git+git://github.com/sobotklp/django-nose@b3f485e914965e0a7b7012c309864d6a6dcac3ed#egg=django-nose

Oh, hrm... It'd be better if we were using a released version of
django-nose. Erik maintains django-nose. It's probably a good idea to push
python 3 support in there. Having said that, I just remembered that "go
through the django-nose python 3 support patches" is in my queue of things
to do. :(

I don't think it should get added to requirements.txt since it's not
something you need to have installed to use django-browserid. We should
have a requirements-dev.txt file which has development-centric things in it.


Reply to this email directly or view it on GitHubhttps://github.com//pull/149/files#r4171394
.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh... ok. This is different than all the other projects I work on--but that's fine. Awesome!

I'll get to the django-nose stuff next week. Whenever that settles out, I'll do a PR to update django-browserid.

@willkg
Copy link
Member

willkg commented May 10, 2013

I can't seem to get a functional python3.3 virtual environment set up for some reason.

I mentioned a few nits some of which should get fixed while others are subjective. Other than that, it looks ok to me.

@Osmose
Copy link
Contributor

Osmose commented May 10, 2013

Merged in ee8a1e3. Nice job, @graingert ! 👍

@Osmose Osmose closed this May 10, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants