BSD Ports

devel/py-nest-asyncio2 1.7.2 NetBSD

Patch asyncio to allow nested event loops

System
NetBSD
Repository
pkgsrc
Maintainer
[email protected]
Port added
Last update
Commit
9908ef3469
License
modified-bsd
Categories
devel, python
Package size
14.5 KiB, 58.0 KiB installed

Description

By design asyncio does not allow its event loop to be nested. This presents a practical problem: When in an environment where the event loop is already running it's impossible to run tasks and wait for the result. Trying to do so will give the error "RuntimeError: This event loop is already running".

The issue pops up in various environments, such as web servers, GUI applications and in Jupyter notebooks.

This module patches asyncio to allow nested use of asyncio.run and loop.run_until_complete.

In the other systems

The newest version among them is 1.7.2, as upstream numbers it.

SystemPortVersionVulnerabilitiesStatusMaintainerLast update
NetBSDdevel/py-nest-asyncio21.7.2 newestnone known-[email protected]2026-10-12
FreeBSDdevel/py-nest-asyncio21.7.2 newestnone known-[email protected]-
MidnightBSDdevel/py-nest-asyncio21.7.2 newestno data-[email protected]2026-07-14
HardenedBSDdevel/py-nest-asyncio21.7.2 newestno data-[email protected]-
GhostBSDdevel/py-nest-asyncio21.7.2 newestno data-[email protected]-

Compare across BSDs

Version history 3

  1. 1.7.4 9908ef3469
  2. 1.7.3 71512d3c5c
  3. 1.7.2 690bed67c3

Upstream's version as each commit to the port's Makefile set it, or as this site first saw it in the system's packages; the tree's own revisions are not versions here.

Install

Binary package:

pkgin install py311-nest-asyncio2

From pkgsrc:

cd /usr/pkgsrc/devel/py-nest-asyncio2 && make install clean

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

RepositoryVersion
NetBSD 10.1 x86_641.7.2
NetBSD 10.1 aarch641.7.2
SmartOS / illumos x86_641.7.4
macOS 15 arm641.7.4

Dependency graph

Ports that need it on the left, what it needs to run on the right; at most 8 of each. "Dependencies" below lists them all.

Dependencies

Run dependencies 1
Required by 1

Configuration

No options to configure.

Service scripts
none
Flavors
py312-nest-asyncio2-1.7.2, py313-nest-asyncio2-1.7.2, py314-nest-asyncio2-1.7.2

Commit history 3

DateCommitCreditsLog message
9908ef3469 adam py-nest-asyncio2: updated to 1.7.4
1.7.4 fix: run_until_complete() manage_asyncgens() Fix async generator hooks are not called during run() (but only in run_forever()), and can't get finalized. fix: manage_asyncgens() broken on Python 3.5 Fix run_forever() is broken on Python 3.5.
71512d3c5c adam py-nest-asyncio2: updated to 1.7.3
1.7.3 Fix context may be re-entered and cause RuntimeError: cannot enter context
690bed67c3 adam py-nest-asyncio2: added version 1.7.2
nest-asyncio2 is a fork of the unmaintained nest_asyncio, with the following changes: Support setting run_close_loop to avoid leaked event loop. Python 3.12 support loop_factory parameter support Python 3.14 support Fix broken asyncio.current_task() and others Fix DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16 To avoid potential bugs, apply() will warn if asyncio is already patched by nest_asyncio on Python 3.12+. You can also set error_on_mispatched=True to turn the warning into a RuntimeError, regardless of the Python version. There is no behavior change on Python < 3.12. All interfaces are kept as they are. To migrate, you just need to change the package and module name to nest_asyncio2.