tractor
tractor copied to clipboard
`trio.Process` deprecations
trio changed it's subprocess API as per the large discussion in
https://github.com/python-trio/trio/issues/1104.
Summary:
- they dropped the
Process.aclose()behaviour due to it being "surprising", prone to bugs and,Process.aclose was always just a convenience wrapper around other existing public APIs, and that hasn't changed. as per comment: https://github.com/python-trio/trio/pull/1568#discussion_r668920523
- changed the
run_process()API to allow for calling via aprocess = await nursery.start(run_process, ...)style and a newdeliver_cancel()callback api from: https://github.com/python-trio/trio/pull/1568- i commented here, and this might be a way for us to simplify our
implementation by leveraging the now existing shielded-nursery-spawns-killer-task style
which is more or less what we implemented before this APi landed:
https://github.com/python-trio/trio/pull/1568#pullrequestreview-551374713
- currently the default impls don't close the stdstreams on a hard
kill? I'll be copying that in from the old
Process.aclose()in the interim.
- currently the default impls don't close the stdstreams on a hard
kill? I'll be copying that in from the old
- i commented here, and this might be a way for us to simplify our
implementation by leveraging the now existing shielded-nursery-spawns-killer-task style
which is more or less what we implemented before this APi landed:
https://github.com/python-trio/trio/pull/1568#pullrequestreview-551374713
home/goodboy/repos/tractor/tractor/_spawn.py:191: TrioDeprecationWarning: using trio.Process as an async context manager is deprecated since Trio 0.20.0; use run_process or nursery.start(run_process, ...) instead (https://github.com/python-trio/trio/issues/1104)
async with proc: # calls ``trio.Process.aclose()``
/home/goodboy/.virtualenvs/xonsh310/lib/python3.10/site-packages/trio/_abc.py:261: TrioDeprecationWarning: trio.Process.aclose is deprecated since Trio 0.20.0; use run_process or nursery.start(run_process, ...) instead (https://github.com/python-trio/trio/issues/1104)
await self.aclose()
Mostly comprehensive list of related trio issues & PRs:
- https://github.com/python-trio/trio/issues/1104
- https://github.com/python-trio/trio/pull/1525
- https://github.com/python-trio/trio/issues/1209
- https://github.com/python-trio/trio/pull/1568#discussion_r668920523
- https://github.com/python-trio/trio/issues/1104
I guess #356 mostly resolved any issues for this.
Not sure if we should close it yet though?