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 support #363

Merged
merged 6 commits into from
Jun 13, 2016
Merged

Python 3 support #363

merged 6 commits into from
Jun 13, 2016

Conversation

pmdarrow
Copy link
Member

@pmdarrow pmdarrow commented Dec 2, 2015

Added support for Python 3 and running tests against all supported versions of Python with tox.

Borrowed heavily from #328 but cleaned things up & simplified some changes in the hopes that it will be more likely to be merged.

@pmdarrow
Copy link
Member Author

pmdarrow commented Dec 2, 2015

@locustio @heyman @HeyHugo @cgbystrom @Jahaja Can you take a quick look at this and consider merging it? All the legwork has been put in and it shouldn't require much time to review.

@cgoldberg
Copy link
Member

i'm doing a code review now. I'm not a maintainer, but I've contributed to locust before and I watch the project. Do the current maintainers need any help?

@pmdarrow fwiw, the tests all pass for me locally against your branch (Ubuntu 15.04).
I also tried with python 3.5 and all tests pass. Could you add 3.5 to your tox.ini and setup.py?

@pmdarrow
Copy link
Member Author

pmdarrow commented Dec 2, 2015

Will do. What do you think about adding 3.1, 3.2, and 3.3? Is that overkill / unnecessary?

@cgoldberg
Copy link
Member

I have 3.2, and 3.3 also installed here... so I'll add those to tox.ini and run the tests again. Those versions seem reasonable to add to your setup.py and tox.ini...
... I'd skip 3.0/3.1, nobody uses them :)
(eventually, I'd imagine dropping 2.6 and 3.2 support)

afaik, travis supports 3.2+, so we get CI on those versions for nothing.

@pmdarrow pmdarrow force-pushed the python3 branch 2 times, most recently from 9927b86 to 72aff70 Compare December 3, 2015 13:52
@pmdarrow
Copy link
Member Author

pmdarrow commented Dec 3, 2015

I updated setup.py, tox.ini, and travis.yml with 3.2, 3.3 and 3.5.

@pmdarrow
Copy link
Member Author

pmdarrow commented Dec 3, 2015

Looks like Flask doesn't support 3.2 (and the tests fail) so I'm dropping support for it.

@pmdarrow pmdarrow force-pushed the python3 branch 5 times, most recently from fccf2d6 to 1e87d5e Compare December 3, 2015 20:43
@vlad-nikityuk vlad-nikityuk mentioned this pull request Dec 8, 2015
@OPpuolitaival
Copy link

I tried this PR with --no-web and there is no more reports visible in command line during the run. There is error in logs: ' AttributeError : 'StdOutWrapper' object has no attribute 'flush'.

@smrpr
Copy link

smrpr commented Feb 22, 2016

@locustio what about this?

@pmdarrow
Copy link
Member Author

@ogabrielson I'll take a look. It's too bad the automated tests didn't catch that...

@pmdarrow pmdarrow mentioned this pull request Feb 24, 2016
@deniscostadsc
Copy link

Does anybody need a help to review this PR and then merge it to master?

@pmdarrow
Copy link
Member Author

pmdarrow commented Mar 3, 2016

@deniscostadsc see #355 for the discussion about why PRs aren't being reviewed.

@justiniso
Copy link
Member

@pmdarrow I'd consider this PR the highest priority aside from any major bug fixes that come up. I'm in the process of reviewing/testing, but I found a couple of minor issues that mean it is not yet ready for merging. I think what we should do is merge your branch into a branch in this repository that we would all have access to.

@deniscostadsc
Copy link

@justiniso, could you list the issues?

@justiniso
Copy link
Member

Yep, sorry!

Stdout no-ops: 548ffe7
Gevent to 1.1.0: f162e1e

I updated gevent version to their officially supported version (rather than release candidate). Note that 3.5 is not supported and consequently we should not support it either (3.4 is the latest supported). Even with 3.4, I'm getting this error when trying to start up the slave:

[2016-03-30 04:01:25,604] vagrant-ubuntu-trusty-64/INFO/locust.main: Starting Locust 0.7.3
[2016-03-30 04:01:25,605] vagrant-ubuntu-trusty-64/ERROR/locust.runners: Connection lost to master server. Aborting...
[2016-03-30 04:01:25,624] vagrant-ubuntu-trusty-64/ERROR/stderr: Traceback (most recent call last):
[2016-03-30 04:01:25,624] vagrant-ubuntu-trusty-64/ERROR/stderr: File "/usr/local/bin/locust", line 9, in <module>
[2016-03-30 04:01:25,625] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,625] vagrant-ubuntu-trusty-64/ERROR/stderr: load_entry_point('locustio==0.7.3', 'console_scripts', 'locust')()
[2016-03-30 04:01:25,625] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,626] vagrant-ubuntu-trusty-64/ERROR/stderr: File "/vagrant/locust/main.py", line 442, in main
[2016-03-30 04:01:25,627] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,627] vagrant-ubuntu-trusty-64/ERROR/stderr: main_greenlet.join()
[2016-03-30 04:01:25,627] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,628] vagrant-ubuntu-trusty-64/ERROR/stderr: File "/usr/local/lib/python3.4/dist-packages/gevent-1.1.0-py3.4-linux-x86_64.egg/gevent/pool.py", line 527, in join
[2016-03-30 04:01:25,628] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,629] vagrant-ubuntu-trusty-64/ERROR/stderr: self._empty_event.wait(timeout=timeout)
[2016-03-30 04:01:25,629] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,629] vagrant-ubuntu-trusty-64/ERROR/stderr: File "/usr/local/lib/python3.4/dist-packages/gevent-1.1.0-py3.4-linux-x86_64.egg/gevent/event.py", line 213, in wait
[2016-03-30 04:01:25,629] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,630] vagrant-ubuntu-trusty-64/ERROR/stderr: return self._wait(timeout)
[2016-03-30 04:01:25,630] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,630] vagrant-ubuntu-trusty-64/ERROR/stderr: File "/usr/local/lib/python3.4/dist-packages/gevent-1.1.0-py3.4-linux-x86_64.egg/gevent/event.py", line 123, in _wait
[2016-03-30 04:01:25,631] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,631] vagrant-ubuntu-trusty-64/ERROR/stderr: gotit = self._wait_core(timeout)
[2016-03-30 04:01:25,631] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,631] vagrant-ubuntu-trusty-64/ERROR/stderr: File "/usr/local/lib/python3.4/dist-packages/gevent-1.1.0-py3.4-linux-x86_64.egg/gevent/event.py", line 101, in _wait_core
[2016-03-30 04:01:25,632] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,632] vagrant-ubuntu-trusty-64/ERROR/stderr: result = self.hub.switch()
[2016-03-30 04:01:25,632] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,632] vagrant-ubuntu-trusty-64/ERROR/stderr: File "/usr/local/lib/python3.4/dist-packages/gevent-1.1.0-py3.4-linux-x86_64.egg/gevent/hub.py", line 606, in switch
[2016-03-30 04:01:25,633] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,633] vagrant-ubuntu-trusty-64/ERROR/stderr: return greenlet.switch(self)
[2016-03-30 04:01:25,633] vagrant-ubuntu-trusty-64/ERROR/stderr: 
[2016-03-30 04:01:25,634] vagrant-ubuntu-trusty-64/ERROR/stderr: gevent.hub
[2016-03-30 04:01:25,634] vagrant-ubuntu-trusty-64/ERROR/stderr: .
[2016-03-30 04:01:25,635] vagrant-ubuntu-trusty-64/ERROR/stderr: LoopExit
[2016-03-30 04:01:25,635] vagrant-ubuntu-trusty-64/ERROR/stderr: :
[2016-03-30 04:01:25,635] vagrant-ubuntu-trusty-64/ERROR/stderr: ('This operation would block forever', <Hub at 0x7fcb7a9e9800 epoll default pending=0 ref=0 fileno=4 resolver=<gevent.resolver_thread.Resolver at 0x7fcb7778f780 pool=<ThreadPool at 0x7fcb7778f7b8 0/1/10>> threadpool=<ThreadPool at 0x7fcb7778f7b8 0/1/10>>)
[2016-03-30 04:01:25,636] vagrant-ubuntu-trusty-64/ERROR/stderr: 

@alexandrul
Copy link

gevent 1.1.1 supports 3.5, even having wheels for windows 👍

https://pypi.python.org/pypi/gevent

@justiniso justiniso mentioned this pull request Apr 29, 2016
@heyman
Copy link
Member

heyman commented Jun 2, 2016

@justiniso Great! Do you know of any other existing issues before this could be merged?

Not at Pycon unfortunately. Next year hopefully :).

@heyman
Copy link
Member

heyman commented Jun 2, 2016

Hmm, perhaps I'm misinterpreting the Travis UI, but it looks like it's only running Python 3.5 in each build job:

image
image

@deniscostadsc
Copy link

deniscostadsc commented Jun 2, 2016

On travis.yml just version 3.5 of Python is declared

But maybe, tox is dealing with this in the correct way, creating all venvs. But you won't be able to see it on Travis UI.

Why not create a matrix on Travis instead of using tox? Do you want to run all possibilities locally?

@heyman
Copy link
Member

heyman commented Jun 3, 2016

Ah, yes, tox takes care of picking the correct version. And I guess the ability to easily run tests for all versions is convenient.

@pmdarrow
Copy link
Member Author

pmdarrow commented Jun 8, 2016

@deniscostadsc you are correct, tox (running under Python 3.5) is creating all the venvs for each version of Python we want to support. And you are also correct, it lets devs test against all supported versions of Python locally.

pmdarrow added 4 commits June 8, 2016 09:07
The setuptools / unittest test runner is very flaky on Python 3. This
also encourages a single way to run tests: unit2 discover (called by tox
or run directly).
justiniso and others added 2 commits June 8, 2016 09:24
@pmdarrow
Copy link
Member Author

pmdarrow commented Jun 8, 2016

@justiniso I cherry-picked your commit that explicitly declares pyzmq. Are people still experiencing issues with gevent or was that resolved with gevent 1.1.1?

@justiniso
Copy link
Member

Are people still experiencing issues with gevent or was that resolved with gevent 1.1.1

@pmdarrow if you're referring to my issue with gevent, that is fixed by the commit you just cherry-picked. If there are other issues, I'm not aware of them. My testing has been on linux and osx (unfortunately don't have a Windows machine to test with). As far as I'm aware, there are no other issues preventing merge.

@pmdarrow
Copy link
Member Author

@justiniso Ok. What should we do about releasing a new version of Locust? I'm guessing none of us "new" contributors have access to https://pypi.python.org/pypi/locustio?

@justiniso
Copy link
Member

Right, @heyman would have to do that. I would go with versioning as a pre-release 0.8a1 to flag as a potentially unstable version. It would be nice to let it soak with early adopters and let them report any issues with integrations, etc. before fully rolling it out.

@pmdarrow
Copy link
Member Author

pmdarrow commented Jun 13, 2016

I'll merge this and then create another PR with the release changes.

@pmdarrow pmdarrow merged commit 9e202a3 into locustio:master Jun 13, 2016
@pmdarrow pmdarrow deleted the python3 branch June 13, 2016 02:18
@justiniso
Copy link
Member

🙌

@justiniso justiniso added this to the 0.8.0 milestone Jun 13, 2016
@Slach
Copy link

Slach commented Jun 13, 2016

🙌
hooray ! ;)

@heyman
Copy link
Member

heyman commented Jun 13, 2016

Woho, great work!

It sounds like a good idea to do a pre-release alpha first.

@dlai0001
Copy link

dlai0001 commented Jul 1, 2016

👏 Awesome guys. Looking forward to using this in py3

@cgoldberg
Copy link
Member

cgoldberg commented Jul 1, 2016 via email

@ryankennedyio
Copy link

Great work. Would be great to get this on pypi as it would help the automation process quite a bit.

@heyman
Copy link
Member

heyman commented Nov 24, 2016

@ryankennedyio The latest master has been released to PyPI as a pre release, and can be installed by specifying the version explicitly (0.8a1)

@baynes
Copy link

baynes commented Jul 12, 2017

When will it come the main release rather than pre-release?
Or how about correcting the installation instructions on the website?

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.