diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 096d39a..cc19f86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,31 @@ +default_install_hook_types: + - pre-commit + - post-checkout + - post-merge + - post-rewrite repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.13 + - repo: https://github.com/astral-sh/uv-pre-commit + rev: 0.8.4 hooks: - - id: ruff - args: ["--fix"] - - id: ruff-format - - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.381 + - id: uv-sync + args: ["--all-groups"] + + - repo: local hooks: - - id: pyright + - id: uv-basedpyright + name: Run basedpyright via uv + entry: uv run basedpyright + language: system + types: [python] + + - id: uv-ruff-check + name: Run ruff check via uv + entry: uv run ruff check --fix + language: system + types: [python] + + - id: uv-ruff-fmt + name: Run ruff format via uv + entry: uv run ruff format + language: system + types: [python] diff --git a/pyproject.toml b/pyproject.toml index 955670e..e211b7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,7 @@ name = "FindMy" version = "0.8.0" description = "Everything you need to work with Apple's Find My network!" readme = "README.md" -authors = [ - {name = "Mike Almeloo", email = "git@mikealmel.ooo"}, -] +authors = [{ name = "Mike Almeloo", email = "git@mikealmel.ooo" }] license-files = ["LICENSE.md"] requires-python = ">=3.9,<3.14" dependencies = [ @@ -24,18 +22,13 @@ requires-python = ">=3.11" [dependency-groups] dev = [ "pre-commit>=4.0.0,<5.0.0", - "pyright>=1.1.391,<2.0.0", + "basedpyright>=1.31.1,<2.0.0", "ruff>=0.8.4,<1.0.0", "tomli>=2.0.1,<3.0.0", "packaging>=25.0,<26.0", ] -test = [ - "pytest>=8.3.2,<9.0.0", -] -docs = [ - "sphinx>=8.2.3,<8.3.0", - "sphinx-autoapi==3.6.0", -] +test = ["pytest>=8.3.2,<9.0.0"] +docs = ["sphinx>=8.2.3,<8.3.0", "sphinx-autoapi==3.6.0"] [tool.pyright] venvPath = "." @@ -48,15 +41,10 @@ reportImplicitOverride = true [tool.ruff] line-length = 100 -exclude = [ - "docs/", - "tests/" -] +exclude = ["docs/", "tests/"] [tool.ruff.lint] -select = [ - "ALL", -] +select = ["ALL"] ignore = [ "FIX002", # resolving TODOs @@ -64,23 +52,24 @@ ignore = [ "D212", # multi-line docstring start at first line "D105", # docstrings in magic methods - "S101", # assert statements - "S603", # false-positive subprocess call (https://github.com/astral-sh/ruff/issues/4045) + "S101", # assert statements + "S603", # false-positive subprocess call (https://github.com/astral-sh/ruff/issues/4045) "PLR2004", # "magic" values >.> "FBT", # boolean "traps" + "COM812", # trailing commas ] [tool.ruff.lint.per-file-ignores] "examples/*" = [ - "T201", # use of "print" - "S101", # use of "assert" - "D", # documentation - "INP001", # namespacing + "T201", # use of "print" + "S101", # use of "assert" + "D", # documentation + "INP001", # namespacing ] "scripts/*" = [ - "T201", # use of "print" - "D", # documentation + "T201", # use of "print" + "D", # documentation ] [tool.setuptools] diff --git a/uv.lock b/uv.lock index 9cbc807..f5509e4 100644 --- a/uv.lock +++ b/uv.lock @@ -203,6 +203,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b7/b8/3fe70c75fe32afc4bb507f75563d39bc5642255d1d94f1f23604725780bf/babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2", size = 10182537, upload-time = "2025-02-01T15:17:37.39Z" }, ] +[[package]] +name = "basedpyright" +version = "1.31.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodejs-wheel-binaries" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/33/39/e2870a3739dce055a5b7822d027843c9ba9b3453dcb4b226d9b0e9d486f4/basedpyright-1.31.1.tar.gz", hash = "sha256:4e4d922a385f45dc93e50738d1131ec4533fee5d338b700ef2d28e2e0412e642", size = 22067890, upload-time = "2025-08-03T13:41:15.405Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1b/cc/8bca3b3a48d6a03a4b857a297fb1473ed1b9fa111be2d20c01f11112e75c/basedpyright-1.31.1-py3-none-any.whl", hash = "sha256:8b647bf07fff929892db4be83a116e6e1e59c13462ecb141214eb271f6785ee5", size = 11540576, upload-time = "2025-08-03T13:41:11.571Z" }, +] + [[package]] name = "beautifulsoup4" version = "4.13.4" @@ -558,9 +570,9 @@ dependencies = [ [package.dev-dependencies] dev = [ + { name = "basedpyright" }, { name = "packaging" }, { name = "pre-commit" }, - { name = "pyright" }, { name = "ruff" }, { name = "tomli" }, ] @@ -585,9 +597,9 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ + { name = "basedpyright", specifier = ">=1.31.1,<2.0.0" }, { name = "packaging", specifier = ">=25.0,<26.0" }, { name = "pre-commit", specifier = ">=4.0.0,<5.0.0" }, - { name = "pyright", specifier = ">=1.1.391,<2.0.0" }, { name = "ruff", specifier = ">=0.8.4,<1.0.0" }, { name = "tomli", specifier = ">=2.0.1,<3.0.0" }, ] @@ -967,6 +979,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314, upload-time = "2024-06-04T18:44:08.352Z" }, ] +[[package]] +name = "nodejs-wheel-binaries" +version = "22.18.0" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/6d/773e09de4a052cc75c129c3766a3cf77c36bff8504a38693b735f4a1eb55/nodejs_wheel_binaries-22.18.0-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:53b04495857755c5d5658f7ac969d84f25898fe0b0c1bdc41172e5e0ac6105ca", size = 50873051, upload-time = "2025-08-01T11:10:29.475Z" }, + { url = "https://files.pythonhosted.org/packages/ae/fc/3d6fd4ad5d26c9acd46052190d6a8895dc5050297b03d9cce03def53df0d/nodejs_wheel_binaries-22.18.0-py2.py3-none-macosx_11_0_x86_64.whl", hash = "sha256:bd4d016257d4dfe604ed526c19bd4695fdc4f4cc32e8afc4738111447aa96d03", size = 51814481, upload-time = "2025-08-01T11:10:33.086Z" }, + { url = "https://files.pythonhosted.org/packages/10/f9/7be44809a861605f844077f9e731a117b669d5ca6846a7820e7dd82c9fad/nodejs_wheel_binaries-22.18.0-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3b125f94f3f5e8ab9560d3bd637497f02e45470aeea74cf6fe60afe751cfa5f", size = 57804907, upload-time = "2025-08-01T11:10:36.83Z" }, + { url = "https://files.pythonhosted.org/packages/e9/67/563e74a0dff653ec7ddee63dc49b3f37a20df39f23675cfc801d7e8e4bb7/nodejs_wheel_binaries-22.18.0-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78bbb81b6e67c15f04e2a9c6c220d7615fb46ae8f1ad388df0d66abac6bed5f8", size = 58335587, upload-time = "2025-08-01T11:10:40.716Z" }, + { url = "https://files.pythonhosted.org/packages/b6/b1/ec45fefef60223dd40e7953e2ff087964e200d6ec2d04eae0171d6428679/nodejs_wheel_binaries-22.18.0-py2.py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5d3ea8b7f957ae16b73241451f6ce831d6478156f363cce75c7ea71cbe6c6f7", size = 59662356, upload-time = "2025-08-01T11:10:44.795Z" }, + { url = "https://files.pythonhosted.org/packages/a2/ed/6de2c73499eebf49d0d20e0704f64566029a3441c48cd4f655d49befd28b/nodejs_wheel_binaries-22.18.0-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:bcda35b07677039670102a6f9b78c2313fd526111d407cb7ffc2a4c243a48ef9", size = 60706806, upload-time = "2025-08-01T11:10:48.985Z" }, + { url = "https://files.pythonhosted.org/packages/2b/f5/487434b1792c4f28c63876e4a896f2b6e953e2dc1f0b3940e912bd087755/nodejs_wheel_binaries-22.18.0-py2.py3-none-win_amd64.whl", hash = "sha256:0f55e72733f1df2f542dce07f35145ac2e125408b5e2051cac08e5320e41b4d1", size = 39998139, upload-time = "2025-08-01T11:10:52.676Z" }, +] + [[package]] name = "packaging" version = "25.0" @@ -1209,19 +1235,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/73/4c/4ef43d2ee85e55a73cfb5090cf29d2f1a5d82e6fe81623b62b7e008afe33/pyobjc_framework_libdispatch-11.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cfe515f4c3ea66c13fce4a527230027517b8b779b40bbcb220ff7cdf3ad20bc4", size = 20435, upload-time = "2025-06-14T20:51:03.137Z" }, ] -[[package]] -name = "pyright" -version = "1.1.403" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "nodeenv" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fe/f6/35f885264ff08c960b23d1542038d8da86971c5d8c955cfab195a4f672d7/pyright-1.1.403.tar.gz", hash = "sha256:3ab69b9f41c67fb5bbb4d7a36243256f0d549ed3608678d381d5f51863921104", size = 3913526, upload-time = "2025-07-09T07:15:52.882Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/49/b6/b04e5c2f41a5ccad74a1a4759da41adb20b4bc9d59a5e08d29ba60084d07/pyright-1.1.403-py3-none-any.whl", hash = "sha256:c0eeca5aa76cbef3fcc271259bbd785753c7ad7bcac99a9162b4c4c7daed23b3", size = 5684504, upload-time = "2025-07-09T07:15:50.958Z" }, -] - [[package]] name = "pytest" version = "8.4.1"