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

Python 3.3 support #124

Closed
wants to merge 9 commits into from
Closed

Python 3.3 support #124

wants to merge 9 commits into from

Conversation

gabrielfalcao
Copy link
Owner

This pull request is just a reference to the branch I created. As a result of an ongoing discussion brought up by @jamielennox at #118

In short python 3.3 support is going to be beneficial to some linux distributions.

The goal is to run tox and have all the tests passing for python 2.6, 2.7 and 3.3

melor and others added 3 commits November 22, 2013 01:55
The unfixed parse_querystring() raises the following exception
in Python 3.3:

  TypeError: Type str doesn't support the buffer API

Also removed iteritems() as it is deprecated and no longer
supported in Python 3.x
@dolph
Copy link

dolph commented Dec 4, 2013

I tested this branch against https://github.com/openstack/python-keystoneclient in py33 and it appears to have fixed all of our blockers caused by httpretty - thanks!

@TerryHowe
Copy link

I like what the keystoneclient folks have done with this. Is 3.3 support going to be a long time coming?

@daenney
Copy link

daenney commented Dec 12, 2013

I just stumbled upon the fact that Python 3.3 support is broken, was using it in a test suite that's now erring.

@gabrielfalcao
Copy link
Owner Author

I need to find time to work on the python-3.3-support, meanwhile pull-requests on that branch are welcome

Alejandro Cabrera and others added 3 commits December 13, 2013 10:31
@daenney
Copy link

daenney commented Dec 16, 2013

The python-3.3-support branch fixed the issues my tests were having on 3.3 so for now I'm putting that in my test requirements.

I did notice one thing, the headers suddenly became title-cased. It used to be a dict like this:

headers = {
  'accept' = 'applicaiton/json',
  'accept-charset' = 'utf-8',
}

But now they're like this:

headers = {
  'Accept' = 'applicaiton/json',
  'Accept-Charset' = 'utf-8',
}

@CyrilRoelandteNovance
Copy link
Collaborator

Just like @jamielennox (and probably for the same reason), I'm interested in porting HTTPretty to Python 3 as quickly as possible. I've taken a quick look at the test suite, and this looks doable. Are Github pull requests the preferred way of sending patches ?

@CyrilRoelandteNovance
Copy link
Collaborator

By the way, it might be nice to rebase the py3 branch on top of master right away.

@fcy
Copy link

fcy commented Jan 16, 2014

+1 for py33 support. I'm starting a new project and would love to rely on HTTPretty in my functional tests.

@CyrilRoelandteNovance
Copy link
Collaborator

@fcy You may want to take a look at https://github.com/CyrilRoelandteNovance/HTTPretty/tree/clean_py3

There are 11 patches on this branch, and it has Python 3 support. I'll probably merge it on master soon (just waiting for some packaging issues to be fixed first). In the meantime, if you could test it, that'd be great!

@gabrielfalcao
Copy link
Owner Author

@CyrilRoelandteNovance +1 for merging into master as long travis built passes 👍

@@ -490,7 +502,7 @@ def __init__(self, method, uri, body,
self.forcing_headers = forcing_headers or {}
self.status = int(status)

for k, v in headers.items():
for k, v in list(headers.items()):

Choose a reason for hiding this comment

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

Why you add 'list()' here? Generic python iterator is more memory efficient

@CyrilRoelandteNovance
Copy link
Collaborator

OK, so I've just proposed #143

If you're interested in Python 3 support, please test ! Also, this branch is some sort of an 0.8-rc1 for HTTPretty: I'd like to release 0.8 soon, with Python 3 support and improved packaging as the main enhancements.

@gabrielfalcao
Copy link
Owner Author

@CyrilRoelandteNovance sorry I've been out of this for a while.
Let's talk about releasing this soon?

@daenney
Copy link

daenney commented May 11, 2014

So eh, what's the state of this now? @CyrilRoelandteNovance's #143 was closed but nothing merged and this seems to be in limbo too.

@CyrilRoelandteNovance
Copy link
Collaborator

@daenney Hum, Python 3 support has been merged a while ago. if I'm not mistaken, it's part of 0.8, and is used by python-keystoneclient in OpenStack, for instance :)

@daenney
Copy link

daenney commented May 11, 2014

Right, Perhaps we should close this issue then, this is confusing.

@gabrielfalcao
Copy link
Owner Author

Hi @CyrilRoelandteNovance, @daenney so can it be closed?

@CyrilRoelandteNovance
Copy link
Collaborator

Yep, and I'm closing it.

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

Successfully merging this pull request may close these issues.

None yet

8 participants