-
Notifications
You must be signed in to change notification settings - Fork 257
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
Drop support for Python versions 2.7 and 3.4 #1126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge work, thank you!
nose-cov | ||
coverage | ||
gevent | ||
circus-web |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that tests using gevent or circus-web are now skipped. I think we should add a tox env with them. Also, papa tests seems to be skipped, I'm not sure why papa is not installed in tox.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added new env called extra
both in tox and in travis, which includes all the extra packages (gevent
, papa
, circus-web
). I also had to fix one test in circus/tests/test_circusd.py
, which raised RuntimeError
when sys.modules
dict changed size during iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After giving it some more thoughts and looking back at the tox config I decided to merge extra
and main configs, because they are practically the same. The only difference is 1 gevent-related test (test_daemonize
). Do you think we should have an extra env just for that?
I also realized that with py27 env removed the coverage/coveralls setup broke, so I brought it back in 48dadba.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might have had different envs to make sure that everything was working fine without gevent. But I'm ok with merging this for now, we'll see if it causes issues down the line.
This is a first commit in the series of removal lower Python versions. It includes: - clean-up of tox config - clean-up of travis config - fix yaml warning when it is used without Loader - fix isinstance calls - remove PY2 conditional from py3compat
A lot of real world examples failed (even example1.ini) because of the types misuse between bytes and str in streamer and other parts of the package. I reverted b and s methods as to_bytes and to_str respectively, keeping the same signature.
- remove try/except imports - remove leftover six imports (with relevatn changes in actual code) - remove unused itertools imports
It is not required as of Python 3 - https://www.python.org/dev/peps/pep-3120/
Also fix gevent related test
- coverage was not picking up by coveralls, because I removed the coverage package from deps while removing py27 config - remove PYTHONHASHSEED variable, because it is not necessary in Python 3 - remove extra env from travis config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great work! 🎉
I am facing the problem when I set httpd is True.
This is relate to "remove py3compat module"? Thanks. |
Yes, you are right. I completely forgot about circus-web, sorry. I will try to have a look at it as soon as possible. Thank you for reporting! |
@huydangg I had a look on this issue and fixing this import is just the tip of the iceberg... We will have to make circus-web compatible with python3 as well as with the new versions of tornado. I will try to make it happen, but it is not trivial and might take quite some time. For now you can try using previous versions of circus/circus-web/tornado. |
@biozz Thank you for your support. I will try using previous version. |
As discussed in #1124, we can start the process of dropping older python versions support.
Main changes are driven by following this article and include:
py3compat
moduletry/except
imports which were necessary for Python 2six
imports and usagesetup.py
tox.ini
Other changes include:
ConfigParser
andurlparse
incircus/util.py
circus/config.py
Loader=yaml.FullLoader
inyaml.load
callsIS_WINDOWS
skips for couple of tests__pycache__
removal inmake clean
commandcoding
line, because of PEP 3120I also did a small test on Windows (inside VirtualBox), thats why there are couple of
skipIf(IS_WINDOWS)
in the changes. Unfortunately the tests are completely broken in Windows and I think proper fixing should be done separately.Finally, I went through examples directory and tried starting several of those to make sure the changes didn't break anything.