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

1795 rename async module #1796

Merged
merged 8 commits into from
Jun 17, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ examples/frameworks/pylonstest/pylonstest.egg-info/
MANIFEST
nohup.out
setuptools-*
.cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

.cache was renamed to .pytest_cache and we already added it to .gitignore.

.eggs
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like a good candidate for having a global .gitignore file.

1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Dariusz Suchojad <[email protected]>
David Vincelli <[email protected]>
David Wolever <[email protected]>
Denis Bilenko <[email protected]>
Diego Oliveira <[email protected]>
Dima Barsky <[email protected]>
Djoume Salvetti <[email protected]>
Dmitry Medvinsky <[email protected]>
Expand Down
8 changes: 8 additions & 0 deletions docs/source/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
=========

19.9.0 / 2018/05/26
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would change 2018/05/26 with "not released".

===================

- the internal module `gunicorn.workers.async` was renamed to `gunicorn.workers.async`
since ``async`` is now a reserved word in Python 3.7
(:pr:`1527`)


19.8.1 / 2018/04/30
===================

Expand Down
2 changes: 1 addition & 1 deletion gunicorn/workers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
}


if sys.version_info >= (3, 3):
if sys.version_info >= (3, 4):
# gaiohttp worker can be used with Python 3.3+ only.

Choose a reason for hiding this comment

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

3.3+ -> 3.4+?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

@mozillazg mozillazg Jun 9, 2018

Choose a reason for hiding this comment

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

I mean the comment # gaiohttp worker can be used with Python 3.3+ only. should be updated to # gaiohttp worker can be used with Python 3.4+ only. to match your change.

SUPPORTED_WORKERS["gaiohttp"] = "gunicorn.workers.gaiohttp.AiohttpWorker"
File renamed without changes.
2 changes: 1 addition & 1 deletion gunicorn/workers/_gaiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def init_process(self):
super().init_process()

def run(self):
self._runner = asyncio.async(self._run(), loop=self.loop)
self._runner = asyncio.ensure_future(self._run(), loop=self.loop)

try:
self.loop.run_until_complete(self._runner)
Expand Down
2 changes: 1 addition & 1 deletion gunicorn/workers/geventlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import greenlet

from gunicorn.http.wsgi import sendfile as o_sendfile
from gunicorn.workers.async import AsyncWorker
from gunicorn.workers._async import AsyncWorker

def _eventlet_sendfile(fdout, fdin, offset, nbytes):
while True:
Expand Down
2 changes: 1 addition & 1 deletion gunicorn/workers/ggevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import gunicorn
from gunicorn.http.wsgi import base_environ
from gunicorn.workers.async import AsyncWorker
from gunicorn.workers._async import AsyncWorker
from gunicorn.http.wsgi import sendfile as o_sendfile

VERSION = "gevent/%s gunicorn/%s" % (gevent.__version__, gunicorn.__version__)
Expand Down
4 changes: 2 additions & 2 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
coverage>=4.0,<4.4 # TODO: https://github.com/benoitc/gunicorn/issues/1548
pytest==3.0.5
pytest-cov==2.4.0
pytest
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please leave unrelated changes to another PR.

pytest-cov
2 changes: 1 addition & 1 deletion tests/test_gaiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_run(self, m_asyncio):
self.worker.loop = mock.Mock()
self.worker.run()

self.assertTrue(m_asyncio.async.called)
self.assertTrue(m_asyncio.ensure_future.called)
self.assertTrue(self.worker.loop.run_until_complete.called)
self.assertTrue(self.worker.loop.close.called)

Expand Down