earl / beanstalkc

A simple beanstalkd client library for Python
Apache License 2.0
457 stars 115 forks source link

Python 3.x compliance #33

Closed dnene closed 9 years ago

dnene commented 11 years ago

I did a quick modification for python 3.x compliance (See https://github.com/dnene/beanstalkc/commit/1acb0eb8f94785784a4e467878fd373797c11a90 )

I haven't quite figured out how to run the existing test cases so created my own at test/test_beanstalkc.py

Could you describe what commands I need to run and from which directory to execute the test cases. That can help me work through any other issues.

The tests in test/test_beanstalkc.py are successful across both python 2.7 and 3.3

earl commented 11 years ago

You can run the tests either by running beanstalkc.py itself python beanstalkc.py, or by invoking nose directly: nosetests -c .nose.cfg.

Thanks for looking into this (it's a long-standing issue: #13). beanstalkc currently aims to stay backwards compatible to 2.6.

dnene commented 11 years ago

Thanks. Not sure why, but the same command wasn't working for me yesterday :(

If I am able to retain 2.6 compatibility and have all the test cases pass on 2.6, 2.7 and 3.3, would you welcome a pull request? (Alternatively I will have to perpetually retain this fork for myself since I use Python 3.3)

On Wed, Jun 5, 2013 at 11:02 PM, Andreas Bolka notifications@github.comwrote:

You can run the tests either by running beanstalkc.py itself python beanstalkc.py, or by invoking nose directly: nosetests -c .nose.cfg.

Thanks for looking into this. beanstalkc currently aims to stay backwards compatible to 2.6.

— Reply to this email directly or view it on GitHubhttps://github.com/earl/beanstalkc/issues/33#issuecomment-18993666 .


http://blog.dhananjaynene.com twitter: @dnene http://twitter.com/dnenegoogle plus: http://gplus.to/dhananjaynene

earl commented 11 years ago

Yes, if you can maintain 2.6+ compatibility, a pull request would be very welcome.

I'd also be interested in results regarding 3.2 (and probably 3.1).

Tomtomgo commented 11 years ago

@dnene @earl Any news on this? Having beanstalkc standard work on Python 3.3 would be really nice!

djit commented 10 years ago

+1 for Python 3.3 compatibility

justinabrahms commented 10 years ago

I went to make an attempt here. I'm not sure how to proceed and still keep doctests. Example below running python3.4

======================================================================
FAIL: Doctest: README.mkd
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/doctest.py", line 2193, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for README.mkd
  File "/Users/justinlilly/src/hacks/beanstalkc/README.mkd", line 0

----------------------------------------------------------------------
File "/Users/justinlilly/src/hacks/beanstalkc/README.mkd", line 28, in README.mkd
Failed example:
    job.body
Expected:
    'hey!'
Got:
    b'hey!'

Not sure how to proceed for that.

justinabrahms commented 10 years ago

If there are others who would like to try, this was my tox.ini

[tox]
envlist = py26,py27,py34
[testenv]
deps=
    nose
    pyyaml
commands=nosetests -c .nose.cfg

Write that into the repo root as tox.ini, pip install tox then just run tox to run in all 3 environments. I pulled in the branch mentioned above (and fixed 2 merge conflicts), but got stuck on that difficult error I posted above.

hit9 commented 10 years ago

syntax error on py3.3

hit9 commented 10 years ago

Any progress on Py 3.x?

svisser commented 10 years ago

+1 to make it clear this is desired.

Here is a pull request towards 2.x and 3.x support: https://github.com/earl/beanstalkc/pull/52.

menezes- commented 9 years ago

Hey, I was needing python3 support so i created this: https://github.com/menezes-/pystalkd it's based on beanstalkc and should be API compatible. Hope that's ok.

svisser commented 9 years ago

@earl is it possible to merge in the pull request and to make beanstalkc 3.x compatible? I don't think the situation regarding SLES 12 has changed much but having two nearly identical projects isn't a good thing.

earl commented 9 years ago

Thanks, everyone, for the continued interest in getting beanstalkc to run on Python 3. I'll be tending to this over the next few days (or weeks, if necessary), with the aim of getting a properly Python 3-enabled beanstalkc 0.5.0 released before the end of 2014.

As a first step, I'll be cleaning up issues & pull requests to focus discussion. Please, everyone interested in Python 3 support, follow / subscribe to issue #13. This is where the discussion will continue.