{ "info": { "author": "Fantix King", "author_email": "fantix.king@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "==============\naiocontextvars\n==============\n\n.. image:: https://img.shields.io/pypi/v/aiocontextvars.svg\n :target: https://pypi.python.org/pypi/aiocontextvars\n\n.. image:: https://img.shields.io/travis/fantix/aiocontextvars.svg\n :target: https://travis-ci.org/fantix/aiocontextvars\n\n**IMPORTANT:** This package will be deprecated after\n`contextvars asyncio backport`_ is fixed. Before then, this library\nexperimentally provides the missing asyncio support for the\n``contextvars`` backport library. Please read more in Python 3.7 `contextvars\ndocumentation `_.\n\n\nCompatibility\n-------------\n\nIn Python 3.7 this package *is* 100% ``contextvars``.\n\nIn Python 3.5 and 3.6, this package added asyncio support to the PEP-567\nbackport package also named ``contextvars``, in a very different way than\nPython 3.7 ``contextvars`` implementation:\n\n1. ``call_soon()`` and family methods.\n\nPython 3.7 added keyword argument ``context`` to ``call_soon()`` and its family\nmethods. By default those methods will copy (inherit) the current context and\nrun the given method in that context. But ``aiocontextvars`` won't touch the\nloop, so in order to achieve the same effect, you'll need to::\n\n loop.call_soon(copy_context().run, my_meth)\n\n2. Task local.\n\nPython 3.7 used above keyword argument ``context`` in ``Task`` to make sure\nthat each step of a coroutine is ran in the same context inherited at the time\nits driving task was created. Meanwhile, ``aiocontextvars`` uses\n``Task.current_task()`` to achieve similar effect: it hacks asyncio and\nattaches a copied context to the task on its creation, and replaces thread\nlocal with current task instance to share the context. This behaves identically\nto Python 3.7 in most times. What you need to do is to import\n``aiocontextvars`` before creating loops.\n\n3. Custom tasks and loops.\n\nBecause above hack is done by replacing ``asyncio.get_event_loop`` and\n``loop.create_task``, therefore tasks and loops created by custom/private API\nwon't behave correctly as expected, e.g. ``uvloop.new_event_loop()`` or\n``asyncio.Task()``. Also, event loops created before importing\n``aiocontextvars`` are not patched either. So over all, you should import\n``aiocontextvars`` at the beginning before creating event loops, and always use\n``asyncio.*`` to operate loops/policies, and public asyncio API to create\ntasks.\n\n\nCredits\n-------\n\nFantix King is the author and maintainer of this library. This library is open\nsource software under BSD license.\n\n.. _contextvars asyncio backport: https://github.com/MagicStack/contextvars/issues/2\n\n\n=======\nHistory\n=======\n\n0.2.1 (2018-10-24)\n------------------\n\n* Changed to single module layout.\n* Updated README.\n\n0.2.0 (2018-09-09)\n------------------\n\n**This is a breaking change.** Most implementation is replaced with\n``contextvars``. In Python 3.5 and 3.6, ``aiocontextvars`` depends on\n``contextvars`` the PEP-567 backport in PyPI, and patches it to partially\nsupport asyncio; in Python 3.7 ``aiocontextvars`` is only a delegate to the\nbuilt-in ``contextvars`` library.\n\n* Modified ``ContextVar.set()`` to return a token.\n* Added ``ContextVar.reset(token)``.\n* Removed ``ContextVar.delete()``.\n* Removed ``enable_inherit()`` and ``disable_inherit()``, inherit is always enabled.\n* Added ``copy_context()`` and ``Context.run()``.\n* Removed ``Context.current()`` and ``Context.inherited``.\n* Fixed issue that ``set_event_loop(None)`` fails (contributed by J.J. Jackson in #10 #11)\n\n0.1.2 (2018-04-04)\n------------------\n\n* Supported Python 3.5.\n\n0.1.1 (2017-12-03)\n------------------\n\n* Fixed setup.py\n\n0.1.0 (2017-12-03)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fantix/aiocontextvars", "keywords": "aiocontextvars", "license": "BSD license", "maintainer": "", "maintainer_email": "", "name": "aiocontextvars", "package_url": "https://pypi.org/project/aiocontextvars/", "platform": "", "project_url": "https://pypi.org/project/aiocontextvars/", "project_urls": { "Homepage": "https://github.com/fantix/aiocontextvars" }, "release_url": "https://pypi.org/project/aiocontextvars/0.2.2/", "requires_dist": [ "contextvars (==2.4) ; python_version < \"3.7\"" ], "requires_python": ">=3.5", "summary": "Asyncio support for PEP-567 contextvars backport.", "version": "0.2.2" }, "last_serial": 5115973, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a4890f0a7cbfee2e565e566c416eedfd", "sha256": "1a719bc387b5f52523c737fdcf843c30f1ca68c4f49cf5736577bddddd363cf7" }, "downloads": -1, "filename": "aiocontextvars-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a4890f0a7cbfee2e565e566c416eedfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15331, "upload_time": "2017-12-03T08:41:48", "url": "https://files.pythonhosted.org/packages/20/d1/84f209fd71db05314e9c4f354b109be83bc3d7ff564400cd4e7aadd6115a/aiocontextvars-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c47730724e071e930db376be24d734cc", "sha256": "847f96e9df8662c4922f81e3a4dd6698bc6617416d9ebe0ab7474b67176791ba" }, "downloads": -1, "filename": "aiocontextvars-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c47730724e071e930db376be24d734cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15279, "upload_time": "2017-12-03T08:49:25", "url": "https://files.pythonhosted.org/packages/b4/f6/845b6b7db4dc46a24de439845395877058985fcadb703cb01ff551bc27ad/aiocontextvars-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "b297da3bcb42e5c2210da8762f5e08dd", "sha256": "77a8fd70e774de2778357503a5b5a702a405ff458b41d4583677732cfab3b25d" }, "downloads": -1, "filename": "aiocontextvars-0.1.2.tar.gz", "has_sig": false, "md5_digest": "b297da3bcb42e5c2210da8762f5e08dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15327, "upload_time": "2018-04-04T09:02:48", "url": "https://files.pythonhosted.org/packages/6c/40/13c6f49f6c47f2cd4f890a193176abf75fe10d5c3486dd2a9bbde878b5e0/aiocontextvars-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "fbf9065ae8eb9844ffb2e8625df65985", "sha256": "530f3054f65c2d5f0cf25700bac33a8c0254da519320a334205e8ec0cdbc6adb" }, "downloads": -1, "filename": "aiocontextvars-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fbf9065ae8eb9844ffb2e8625df65985", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 4145, "upload_time": "2018-09-09T07:05:12", "url": "https://files.pythonhosted.org/packages/c5/ab/fb86407b574b7bb2e67600c9798883e8d7dce46d4023c002f864be0e4b2e/aiocontextvars-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "40cae13e3e5bd162e4f922b32127fcc2", "sha256": "eaf193d9ffc5b1942d612ae28d90f1ef5eb59981e41fe38f3863b769eceb301a" }, "downloads": -1, "filename": "aiocontextvars-0.2.0.tar.gz", "has_sig": false, "md5_digest": "40cae13e3e5bd162e4f922b32127fcc2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 16477, "upload_time": "2018-09-09T07:05:14", "url": "https://files.pythonhosted.org/packages/b1/d1/c6313174b1cbcf3bf8f7bdb3175e2ef9b0d2d8f70544361403ff5d101722/aiocontextvars-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f618cd3dc5fb870899ca685048dd0865", "sha256": "6ff7aee14f549d52f0446cbb84d0deddcd3fc677bcf8fbc2ce13f5756d2064dc" }, "downloads": -1, "filename": "aiocontextvars-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f618cd3dc5fb870899ca685048dd0865", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 4880, "upload_time": "2018-10-24T06:47:48", "url": "https://files.pythonhosted.org/packages/05/92/0691fa7129fb8ecec02db01be716fc7c3d9a1d969340b2338db74b9993e2/aiocontextvars-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5e2901f6663b48ae3eb273d1a54e201a", "sha256": "1e0ff5837c8b01c36a1107acdd0baf7853ebdf6c9fc43e8e311f4be37ac2038a" }, "downloads": -1, "filename": "aiocontextvars-0.2.1.tar.gz", "has_sig": false, "md5_digest": "5e2901f6663b48ae3eb273d1a54e201a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 13534, "upload_time": "2018-10-24T06:47:49", "url": "https://files.pythonhosted.org/packages/7d/2b/c3b52634e4a7d9ad4fe4692b8db6551f6232a8fa53dcda285d9da79a45bb/aiocontextvars-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "558f549426c756a454d3107f5287e4a6", "sha256": "885daf8261818767d8f7cbd79f9d4482d118f024b6586ef6e67980236a27bfa3" }, "downloads": -1, "filename": "aiocontextvars-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "558f549426c756a454d3107f5287e4a6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 4911, "upload_time": "2019-04-08T22:40:32", "url": "https://files.pythonhosted.org/packages/db/c1/7a723e8d988de0a2e623927396e54b6831b68cb80dce468c945b849a9385/aiocontextvars-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "28e8e00dcc35f3b7964d1f5b30fde069", "sha256": "f027372dc48641f683c559f247bd84962becaacdc9ba711d583c3871fb5652aa" }, "downloads": -1, "filename": "aiocontextvars-0.2.2.tar.gz", "has_sig": false, "md5_digest": "28e8e00dcc35f3b7964d1f5b30fde069", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 13565, "upload_time": "2019-04-08T22:40:33", "url": "https://files.pythonhosted.org/packages/fb/f4/26986cd042d5f9e4847c8af6274588fae6c9f2ec67e332890572ae9f3bb2/aiocontextvars-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "558f549426c756a454d3107f5287e4a6", "sha256": "885daf8261818767d8f7cbd79f9d4482d118f024b6586ef6e67980236a27bfa3" }, "downloads": -1, "filename": "aiocontextvars-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "558f549426c756a454d3107f5287e4a6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 4911, "upload_time": "2019-04-08T22:40:32", "url": "https://files.pythonhosted.org/packages/db/c1/7a723e8d988de0a2e623927396e54b6831b68cb80dce468c945b849a9385/aiocontextvars-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "28e8e00dcc35f3b7964d1f5b30fde069", "sha256": "f027372dc48641f683c559f247bd84962becaacdc9ba711d583c3871fb5652aa" }, "downloads": -1, "filename": "aiocontextvars-0.2.2.tar.gz", "has_sig": false, "md5_digest": "28e8e00dcc35f3b7964d1f5b30fde069", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 13565, "upload_time": "2019-04-08T22:40:33", "url": "https://files.pythonhosted.org/packages/fb/f4/26986cd042d5f9e4847c8af6274588fae6c9f2ec67e332890572ae9f3bb2/aiocontextvars-0.2.2.tar.gz" } ] }