mitogen icon indicating copy to clipboard operation
mitogen copied to clipboard

RFC: Mitogen 0.4

Open moreati opened this issue 10 months ago • 2 comments

Mostly a dumping ground for ideas, wishes, and discussion for now. None of these are even close to commitments or specifications

ansible_mitogen

  • ansible_mitogen -> mitogen.ansible?
  • ansible_mitogen.connection._connect_*() -> respective modules
  • ansible.mitogen.connection.convert_bool() -> ansible.module_utils.parsing.convert_bool.boolean()?
  • Remove ansible_mitogen sys.path manipulations
  • Remove ansible_mitogen.loader.*__get, or include "unwrapped" in names
  • Remove ansible_mitogen.loader re-export of Ansible loader classes
  • Remove ansible_mitogen.plugins.connection.{mitogen_doas,mitogen_sudo,mitogen_su}?
  • Clearly designate Mitogen specific methods (e.g. Connection._mito_thing()) vs Ansible methods (e.g. StrategyBase._execute_meta())

mitogen

  • mitogen.Poller -> mitogen.{SelectPoller,Selector,AbstractPoller}?
  • mitogen.compat to unify backward compatibility workarounds
  • mitogen connections/transport modules to a namespace -> e.g. mitogen.connection, mitogen.transports

Plumbing

  • Type signatures?
  • Remove releases branch?
  • Publish as Ansible Galaxy collection?

moreati avatar Feb 04 '25 10:02 moreati

  • Switch to src/*.py?

moreati avatar Feb 24 '25 22:02 moreati

  • Replace/supplement mitogen.service.argspec() decorator with Python type annotations?
  • Tighten up function signatures, e.g. ansible_mitogen.services.ContextService.__init__()
  • Consolidate duplicated FORK_SUPPORTED flags
  • move ansible_mitogen.mixins.ActionModuleMixin -> ansible_mitogen.plugins.action...?
  • Eliminiate uses of unicode_literals

moreati avatar May 13 '25 12:05 moreati

  • Change default remote python_path from python -> python3
  • Add python_path search, ala Ansible interpreter discovery?

moreati avatar Jun 25 '25 09:06 moreati

  • Remove argument formatting from mitogen.core.Error et al? Aim: consistency with Exception API.

moreati avatar Jun 26 '25 08:06 moreati

Remove/fix use of poller_class arg in mitogen.core.Router #1064

moreati avatar Jun 30 '25 13:06 moreati

➜  mitogen git:(issue1185-blockingioerror) ✗ ag -C3 deprecated:: mitogen ansible_mitogen
mitogen/core.py
1210-        """
1211-        Return `size() == 0`.
1212-
1213:        .. deprecated:: 0.2.8
1214-           Use :meth:`size` instead.
1215-
1216-        :raises LatchError:
--
1263-    A channel inherits from :class:`mitogen.core.Sender` and
1264-    `mitogen.core.Receiver` to provide bidirectional functionality.
1265-
1266:    .. deprecated:: 0.2.0
1267-        This class is incomplete and obsolete, it will be removed in Mitogen
1268-        0.3.
1269-
--
2794-        """
2795-        Return `size() == 0`.
2796-
2797:        .. deprecated:: 0.2.8
2798-           Use :meth:`size` instead.
2799-
2800-        :raises LatchError:

mitogen/select.py
285-        """
286-        Return `size() == 0`.
287-
288:        .. deprecated:: 0.2.8
289-           Use :meth:`size` instead.
290-        """
291-        return self._latch.empty()

moreati avatar Jul 06 '25 22:07 moreati

  • Rename/reorgnize modules, e.g.
    • Underscore prefix internal modules, would eliminate name clash of stdlibselect and mitogen.select when absolute_import isn't in effect.
    • Decouple helper functions from whterh they're needed by parent, master, etc
    • Consider platform specfic modules ala os.path composed at import time from posixpath, ntpath etc.

moreati avatar Jul 14 '25 06:07 moreati

mitogen.core.TimeoutError - name clashes/may cause be confused with Python builtin TimeoutError

moreati avatar Jul 23 '25 15:07 moreati

Remove PY24 and PY3 constants - style checkers don't treat them as static, just use sys.version_info directly

moreati avatar Jul 23 '25 15:07 moreati

Move mitogen.main() decoreator? So the imports inside it don't cause upgraded mitogen.master.scan_code_imports() and mitogen.master.ModuleFinder.find_related() to pull in mitogen.master for any module in mitogen. refs #1287 #682 #733

moreati avatar Aug 07 '25 13:08 moreati

Idea: A CLI interface e.g. python -m mitogen -t ssh [email protected] -c "import sys; print(sys.version_info)"

moreati avatar Aug 13 '25 15:08 moreati

Consider https://github.com/mitogen-hq/mitogen/issues/1218 (Ansible min/max version check)

moreati avatar Aug 16 '25 09:08 moreati

Rename Mitogen signals to notifications. Avoids name clashes with POSIX signals.

moreati avatar Aug 17 '25 10:08 moreati

logging config inspiration https://pkg.go.dev/github.com/daotl/go-log/v2#readme-environment-variables

moreati avatar Aug 25 '25 22:08 moreati

Remove legacy macOS/OSX workarounds in first stage?

moreati avatar Oct 30 '25 15:10 moreati