[project] name = "pymobiledevice3" description = "Pure python3 implementation for working with iDevices (iPhone, etc...)" readme = "README.md" requires-python = ">=3.9" license = "GPL-3.0-or-later" keywords = [ "ios", "protocol", "lockdownd", "instruments", "automation", "cli", "afc", ] authors = [ { name = "doronz88", email = "doron88@gmail.com" }, { name = "matan", email = "matan1008@gmail.com" }, ] maintainers = [ { name = "doronz88", email = "doron88@gmail.com" }, { name = "matan", email = "matan1008@gmail.com" }, ] classifiers = [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", "Programming Language :: Python :: 3 :: Only", ] dynamic = ["version"] dependencies = [ "construct>=2.9.29", # construct-typing 0.8.0 requires Python >= 3.10 and replaces csfield(Const(...)) with # csfield_const() (see afc.py). Keep the 3.9 floor on the last 0.7.x release. "construct-typing>=0.8.0; python_version >= '3.10'", "construct-typing>=0.7.0,<0.8.0; python_version < '3.10'", "asn1", "coloredlogs", "IPython", "bpylist2>=4.0.1", "pygments", "daemonize", "pykdebugparser>=1.2.7", "pyusb>=1.2.1", "tqdm", "requests", "xonsh", "packaging", "typing_extensions>=4.1.0", "pygnuutils>=0.0.7", "cryptography>=43.0.0", "pycrashreport>=2.0.0", "fastapi>=0.93.0", "uvicorn>=0.15.0", "wsproto", "Pillow", "questionary>=2.0.0", "ipsw_parser>=1.8.2", "ifaddr", "hyperframe", "srptools", "qh3>=1.0.0,<2", "developer_disk_image>=0.3.0", "opack2", "psutil", "pytun-pmd3>=3.0.3", "prompt_toolkit", "sslpsk-pmd3>=1.0.3; python_version < '3.13'", "python-pcapng>=2.1.1", "pyimg4>=0.8.8", "pyiosbackup>=0.2.4", "typer>=0.23.2,<0.24.0; python_version < '3.10'", "typer>=0.25; python_version >= '3.10'", "typer-injector>=0.3.0", "defusedxml", "pywin32; platform_system == 'Windows'", # IORegistry access for `doctor`: tells "the host does not see this device at all" apart from # "usbmuxd is not listing it", which are the same symptom with different fixes. IOKit is macOS. # 0.0.6 floor: the first release shipping py.typed, without which every property read here is # Unknown to pyright and needs a cast plus a suppression to stay clean. "ioregistry>=0.0.6; platform_system == 'Darwin'", "av>=14.0.0; platform_system != 'Darwin'", # pmd-pytcp — the no-root userspace tunnel's TCP/IP stack, a minimal PyTCP fork # (https://github.com/doronz88/pmd-pytcp). Pulls its pmd-net-addr / pmd-net-proto siblings in # transitively. Supported on Python 3.9+ (the whole pymobiledevice3 range); if the import or # stack init fails the tunnel transparently falls back to the kernel path (see cli_common). # 0.3.7 floor: the complete 2026-08 stability-audit series. The API contract strictly # needs only 0.3.4 — session death (RST / FIN / reaper / 2MSL) wakes blocked recv() # waiters, which the relay handler in userspace_tunnel.py relies on to finish promptly # once it fully closes an abandoned connection's pytcp socket, plus the NUD FAILED # black-hole fix (a device asleep ~3 s could kill the tunnel until process restart) — # but 0.3.5-0.3.7 carry the rest of the audit's liveness/bounds work (datapath loops # survive their first exception instead of dying silently, per-session timer spins # stopped, connect() failures always surface, every queue/table bounded), and the floor # guarantees no pymobiledevice3 install runs a stack with those known wedge modes. # 0.3.0 added the 'net.rx_cksum_validate' software RX-checksum-offload sysctl # (skips the RFC 1071 checksum on the AEAD-authenticated tunnel; ~+35% bulk download). # 0.2.0 added dynamic send-MSS via working RFC 4821/8899 PLPMTUD (probing sysctls # tcp.mtu_probing / tcp.base_mss / tcp.plpmtud.probe_timer_ms, the tcp.rto.min_ms floor, # and the runtime 'log.enabled' hot-path gate). userspace_tunnel.py sets these knobs # unconditionally — no capability probing — so the floor IS the compatibility contract. # (0.1.0 introduced the pure-asyncio stack the module is written against.) "pmd-pytcp>=0.3.7; python_version >= '3.9'", # pmd-pytcp's address types, which userspace_tunnel.py imports directly. pmd-pytcp pins the # version it was built against. "pmd-net-addr", # WebDAV mounting of AFC services (` webdav`). ASGIWebDAV requires Python >= 3.10, so it # is gated accordingly; the CLI surfaces a clear message on 3.9. backports.zstd supplies the zstd # module ASGIWebDAV imports on 3.10-3.13 (stdlib on 3.14+); uvicorn is already a dependency above. "asgiwebdav>=2.0.1; python_version >= '3.10'", "backports.zstd; python_version >= '3.10' and python_version < '3.14'", # chardet is pulled in by ASGIWebDAV. Its 7.6.0 cp315 wheel segfaults on import (Cython # module init dies in __Pyx__ExceptionSave against the current 3.15 ABI), which crashed # the CLI on Python 3.15 the moment anything touched the webdav import chain. Earlier # and later releases are fine, so exclude exactly that build on 3.15. "chardet!=7.6.0; python_version >= '3.15'", ] [project.optional-dependencies] test = ["pytest", "pytest-asyncio", "httpx"] # Docs tooling targets Python >= 3.10 (mkdocs-llmstxt / recent mkdocstrings); markers keep the # project's 3.9 floor resolvable since uv resolves all extras universally. docs = [ "mkdocs-material>=9.5; python_version >= '3.10'", "mkdocstrings[python]>=0.26; python_version >= '3.10'", "mkdocs-llmstxt>=0.5; python_version >= '3.10'", ] full = ["pymobiledevice3[test,docs]"] [project.urls] "Homepage" = "https://github.com/doronz88/pymobiledevice3" "Bug Reports" = "https://github.com/doronz88/pymobiledevice3/issues" [project.scripts] pymobiledevice3 = "pymobiledevice3.__main__:main" [tool.setuptools] package-data = { "pymobiledevice3" = [ "py.typed", "resources/webinspector/*.js", "resources/webinspector/logo.png", "resources/dsc_uuid_map.json", "resources/notifications.txt", "resources/serve_web/viewer.html", "resources/serve_web/viewer.css", "resources/serve_web/viewer.js", ] } [tool.setuptools.packages.find] exclude = ["docs*", "tests*"] [tool.setuptools.dynamic] version = { attr = "pymobiledevice3._version.__version__" } [tool.setuptools_scm] version_file = "pymobiledevice3/_version.py" [build-system] requires = ["setuptools>=43.0.0", "setuptools_scm>=8", "wheel"] build-backend = "setuptools.build_meta" [tool.pyright] include = ["pymobiledevice3", "tests"] pythonVersion = "3.9" typeCheckingMode = "standard" # Bug-revealing strict-mode rules adopted incrementally on top of standard. reportUnnecessaryComparison = "error" reportUnnecessaryIsInstance = "error" reportUnnecessaryCast = "error" reportUntypedNamedTuple = "error" reportDeprecated = "error" reportMissingTypeArgument = "error" reportMissingParameterType = "error" reportUnknownVariableType = "error" reportUnknownMemberType = "error" reportUnknownArgumentType = "error" reportUnknownParameterType = "error" reportUnknownLambdaType = "error" venvPath = "." venv = ".venv" # The reportMissingParameterType and reportUnknown* rules are enforced across the package, but not # on the test suite: test fixtures, monkeypatch callbacks and mock stubs are deliberately # loosely-typed and annotating/narrowing them adds noise without catching real bugs. [[tool.pyright.executionEnvironments]] root = "tests" extraPaths = ["."] reportMissingParameterType = "none" reportUnknownVariableType = "none" reportUnknownMemberType = "none" reportUnknownArgumentType = "none" reportUnknownParameterType = "none" reportUnknownLambdaType = "none" [tool.ruff] target-version = "py39" line-length = 120 fix = true [tool.ruff.lint] select = [ # flake8-2020 "YTT", # flake8-bugbear "B", # flake8-builtins "A", # flake8-comprehensions "C4", # flake8-debugger "T10", # flake8-simplify "SIM", # isort "I", # pycodestyle "E", "W", # pyflakes "F", # pygrep-hooks "PGH", # pyupgrade "UP", # ruff "RUF", # tryceratops "TRY", ] ignore = [ # Shadowing a built-in "A001", # LineTooLong "E501", # Custom error classes "TRY003", # Use `logging.exception` instead of `logging.error` "TRY400", # Abstract `raise` to an inner function "TRY301", # Do not perform function call `csfield` in dataclass defaults "RUF009", # Use `X | Y` instead of `Union` (keep Union so annotations stay evaluable on the 3.9 floor, # e.g. under typing.get_type_hints(), not just as strings via `from __future__ import annotations`) "UP007", # Use `X | None` instead of `Optional` (same reason as UP007) "UP045", ] [tool.ruff.format] preview = true