lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

python 3 support #231

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Python3 setup.py install

What is the expected output? What do you see instead?
Install fails because of Python2 syntax.

What version of the product are you using? On what operating system?
CouchDB-0.9

Please provide any additional information below.
Just wondering if a version that supports Python 3 can be expected.

Original issue reported on code.google.com by boxnumbe...@gmail.com on 12 Nov 2013 at 9:59

GoogleCodeExporter commented 8 years ago
I have an MQ where this is mostly working. If someone is serious about helping 
drive it forward, I can probably publish it somewhere.

Original comment by djc.ochtman on 12 Nov 2013 at 10:13

GoogleCodeExporter commented 8 years ago
I would be happy to lend a hand.

Original comment by boxnumbe...@gmail.com on 12 Nov 2013 at 10:24

GoogleCodeExporter commented 8 years ago
I'd like this to work as well. I had started doing something with six so it 
works on both Python 2 and Python 3, but in the end I had no time and ended 
using microfiber.

I'd be happy to help as well to get this package to work on Python 3.

Original comment by thomas.j...@gmail.com on 26 Nov 2013 at 11:22

GoogleCodeExporter commented 8 years ago
I've pushed my MQ state to a Bitbucket repository:

https://bitbucket.org/djc/couchdb-python-py3-mq

You can apply this by enabling the MQ extension for hg and then cloning that 
repo to .hg/patches in your couchdb-python repository. Then, you can use hg 
qpush -a to apply all the patch and see the current state of the test suite. I 
hope someone can step up to help push this forward!

Original comment by djc.ochtman on 26 Nov 2013 at 3:04

GoogleCodeExporter commented 8 years ago
I'd like to help but I'm not familiar with bitbucket.  Can I use git to fork 
your repo?

Original comment by boxnumbe...@gmail.com on 26 Nov 2013 at 10:25

GoogleCodeExporter commented 8 years ago
That probably doesn't really help you. Maybe this is a good chance to give 
Mercurial a chance?

Original comment by djc.ochtman on 27 Nov 2013 at 6:58

GoogleCodeExporter commented 8 years ago
I installed Mercurial and enabled MQ.  I'm not sure what it means to clone your 
repo to ".hg/patches in your couchdb-python repository."  Can you explain?  

I tried this: hg clone https://bitbucket.org/djc/couchdb-python-py3-mq
but I don't see any python files.

Original comment by boxnumbe...@gmail.com on 30 Nov 2013 at 2:58

GoogleCodeExporter commented 8 years ago
This is a duplicate of #150.

Original comment by michael....@gmail.com on 5 Jan 2014 at 7:50

GoogleCodeExporter commented 8 years ago
Issue 150 has been merged into this issue.

Original comment by djc.ochtman on 5 Jan 2014 at 10:01

GoogleCodeExporter commented 8 years ago
Here's a patch that add Python3 compatibility while preserving Python2 
compatibility, using six and the awesome series of patches by Dirkjan Ochtman 
(djc).

All the test pass except for the doctests (because Unicode strings are u"abc" 
in py2 and "abc" in py3). However I haven't tested that in a real-world app yet 
:)

There are lots of changes wrt strings and unicode strings, so I'm not sure it 
won't break compatibility with other versions of the library.

Tested with Python 2.7.6 and 3.3.3. Should work with 2.6 as well, but not 
tested. Won't work with <2.5 and <3.3.

Original comment by thomas.j...@gmail.com on 17 Jan 2014 at 10:08

Attachments:

GoogleCodeExporter commented 8 years ago
Thomas: awesome work, man!

Would it be possible to keep this split into smaller patches? The larger patch 
is pretty hard to review... It would be great if you could give me patches that 
would apply on top of what I already had, that way we could land it quickly.

Original comment by djc.ochtman on 17 Jan 2014 at 10:47

GoogleCodeExporter commented 8 years ago
I applied the py3.patch on a github mirror of Revision 961ac99baa29, in case 
someone without mercurial installed needs the python 3 version urgently: 
https://github.com/miebach/couchdb-python/tree/python3 (download zip button on 
the right side)

Original comment by kwmieb...@gmail.com on 27 Jan 2014 at 2:39

GoogleCodeExporter commented 8 years ago
We're starting a new python based project and we intend to use Python3 for 
that. Most of our dependencies are already available (numpy, pandas, cherrypy, 
and so on), but couchdb-python wasn't, so I was happy to find this issue and 
the patch. Thanks a lot.

I hope it can be integrated by the time we would want to deploy. Does anyone 
have any information on the intent? This ticket has been dormant for almost 2 
months now.

I've used the github version as I'm more familiar with git, is that the latest? 
is there an updated version somewhere else?

Thanks in advance.

Original comment by bazs...@gmail.com on 13 Mar 2014 at 1:09

GoogleCodeExporter commented 8 years ago
> I've used the github version as I'm more familiar with git, 
> is that the latest? is there an updated version somewhere else?

The github version is based on 

Rev 961ac99baa29 Allow overriding wrapper in ViewDefinition.__call__(). Aug 18, 
2013 Ryan Olson <rmolson>

You can verify this in the network view:

https://github.com/miebach/couchdb-python/network

And 961ac99baa29 is still the latest here on googlecode, so it seems the gothub 
code is recent:

https://code.google.com/p/couchdb-python/source/list

Original comment by kwmieb...@gmail.com on 13 Mar 2014 at 2:32

GoogleCodeExporter commented 8 years ago
The big patch, while great, should IMO be split up before landing into our 
repository. The separate patches from my MQ should be a good guideline for how 
to do that. If someone wants to do some work to make a patch separating the 
stuff in the big patch that's not in my queue out, that would probably help me 
move faster on this.

The big patch also seems to introduce a six dependency relative to my MQ; we 
should check if that really makes sense for this case.

Sorry, my round tuits have been a little scarce lately, but I do still want to 
take care of this issue.

Original comment by djc.ochtman on 13 Mar 2014 at 6:40

GoogleCodeExporter commented 8 years ago
I've just pushed my changes to the repository (rdb566517e8af and ancestors). 
With my approach, the current tip passes all tests on 2.7 and almost all tests 
on 3.3 (except a few doctests), so it should be fairly usable in Python 3-ready 
codebases.

I'd very much like for someone to take a look at the remaining doctests 
failures and see if there's a strategy to fix them (or rewrite them so the 
problems go away, without loss of useful documentation).

Python 3 also has new ResourceWarnings that are triggered by some of the tests, 
these should probably be investigated as well.

This is a fairly bottom-up port, so I'm not sure the unicode/bytes design makes 
sense. Review/criticism is most welcome.

Original comment by djc.ochtman on 30 Mar 2014 at 5:27

GoogleCodeExporter commented 8 years ago
It seams to work well here with current master.
Could you please make a release of CouchDB 0.10 so that we can integrate it and 
raise bugs if there are?

Original comment by hubscher.remy on 26 May 2014 at 9:04

GoogleCodeExporter commented 8 years ago
I'd really prefer to get the doctests fixed somehow, but I haven't come up with 
a strategy for doing so. I guess getting the doctests to skip under Python 3 
only would be acceptable.

Original comment by djc.ochtman on 26 May 2014 at 12:32

GoogleCodeExporter commented 8 years ago
With r402aac0b09ad, I consider this to be complete. Please test, and report new 
issues for anything you might run into. I'd like to release this soon.

Original comment by djc.ochtman on 6 Jul 2014 at 10:55

GoogleCodeExporter commented 8 years ago
My tests of r402aac0b09ad all passed.  I look forward to the release. 
Thanks!

Original comment by boxnumbe...@gmail.com on 6 Jul 2014 at 4:43

GoogleCodeExporter commented 8 years ago
Thanks for testing!

Original comment by djc.ochtman on 6 Jul 2014 at 5:32