pyautogui-zzy 0.9.54__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyautogui_zzy-0.9.54/CHANGELOG.md +42 -0
- pyautogui_zzy-0.9.54/Cargo.lock +370 -0
- pyautogui_zzy-0.9.54/Cargo.toml +30 -0
- pyautogui_zzy-0.9.54/DEVELOPING.md +112 -0
- pyautogui_zzy-0.9.54/LICENSE.txt +27 -0
- pyautogui_zzy-0.9.54/MANIFEST.in +16 -0
- pyautogui_zzy-0.9.54/NOTICE +18 -0
- pyautogui_zzy-0.9.54/PKG-INFO +129 -0
- pyautogui_zzy-0.9.54/PRODUCT_VISION.md +69 -0
- pyautogui_zzy-0.9.54/README.md +76 -0
- pyautogui_zzy-0.9.54/benchmarks/conftest.py +75 -0
- pyautogui_zzy-0.9.54/benchmarks/test_python_hotpaths.py +38 -0
- pyautogui_zzy-0.9.54/docs/Makefile +177 -0
- pyautogui_zzy-0.9.54/docs/conf.py +158 -0
- pyautogui_zzy-0.9.54/docs/index.rst +140 -0
- pyautogui_zzy-0.9.54/docs/install.rst +50 -0
- pyautogui_zzy-0.9.54/docs/keyboard.rst +129 -0
- pyautogui_zzy-0.9.54/docs/make.bat +242 -0
- pyautogui_zzy-0.9.54/docs/mouse.rst +219 -0
- pyautogui_zzy-0.9.54/docs/msgbox.rst +36 -0
- pyautogui_zzy-0.9.54/docs/quickstart.rst +150 -0
- pyautogui_zzy-0.9.54/docs/roadmap.rst +42 -0
- pyautogui_zzy-0.9.54/docs/screenshot.rst +157 -0
- pyautogui_zzy-0.9.54/docs/source/modules.rst +7 -0
- pyautogui_zzy-0.9.54/docs/source/pyautogui_zzy.rst +10 -0
- pyautogui_zzy-0.9.54/docs/tests.rst +29 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/__init__.py +2240 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/__main__.py +2 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/_cli.py +37 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/_pyautogui_java.py +0 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/_pyautogui_osx.py +453 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/_pyautogui_pyscreeze_opt.py +570 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/_pyautogui_win.py +505 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/_pyautogui_x11.py +326 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy/_visual_locator.py +306 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy.egg-info/PKG-INFO +129 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy.egg-info/SOURCES.txt +89 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy.egg-info/dependency_links.txt +1 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy.egg-info/entry_points.txt +2 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy.egg-info/not-zip-safe +1 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy.egg-info/requires.txt +27 -0
- pyautogui_zzy-0.9.54/pyautogui_zzy.egg-info/top_level.txt +1 -0
- pyautogui_zzy-0.9.54/pyproject.toml +132 -0
- pyautogui_zzy-0.9.54/setup.cfg +7 -0
- pyautogui_zzy-0.9.54/setup.py +21 -0
- pyautogui_zzy-0.9.54/src/cuda/tinylocate.cu +99 -0
- pyautogui_zzy-0.9.54/src/cuda/tinylocate.ptx +711 -0
- pyautogui_zzy-0.9.54/src/dummy.rs +128 -0
- pyautogui_zzy-0.9.54/src/gpu.rs +88 -0
- pyautogui_zzy-0.9.54/src/gpu_engine.rs +655 -0
- pyautogui_zzy-0.9.54/src/lib.rs +25 -0
- pyautogui_zzy-0.9.54/src/tinylocate.rs +370 -0
- pyautogui_zzy-0.9.54/src/vision.rs +512 -0
- pyautogui_zzy-0.9.54/src/win/capture.rs +203 -0
- pyautogui_zzy-0.9.54/src/win/hook.rs +79 -0
- pyautogui_zzy-0.9.54/src/win/input.rs +299 -0
- pyautogui_zzy-0.9.54/src/win/mod.rs +471 -0
- pyautogui_zzy-0.9.54/tests/fixtures/tinylocate/expected.json +9 -0
- pyautogui_zzy-0.9.54/tests/fixtures/tinylocate/reference.png +0 -0
- pyautogui_zzy-0.9.54/tests/fixtures/tinylocate/search.png +0 -0
- pyautogui_zzy-0.9.54/tests/test_automateboringstuff.py +204 -0
- pyautogui_zzy-0.9.54/tests/test_pyautogui.py +882 -0
- pyautogui_zzy-0.9.54/tests/unit/conftest.py +199 -0
- pyautogui_zzy-0.9.54/tests/unit/test_api_contract.py +170 -0
- pyautogui_zzy-0.9.54/tests/unit/test_command_language.py +74 -0
- pyautogui_zzy-0.9.54/tests/unit/test_input_orchestration.py +111 -0
- pyautogui_zzy-0.9.54/tests/unit/test_pure_helpers.py +88 -0
- pyautogui_zzy-0.9.54/tests/unit/test_screenshot_optimization.py +233 -0
- pyautogui_zzy-0.9.54/tests/unit/test_visual_locator.py +106 -0
- pyautogui_zzy-0.9.54/tests/unit/test_windows_backend_fallback.py +228 -0
- pyautogui_zzy-0.9.54/tools/benchmark_native.py +102 -0
- pyautogui_zzy-0.9.54/tools/benchmark_tinylocate_runtime.py +69 -0
- pyautogui_zzy-0.9.54/tools/check.py +90 -0
- pyautogui_zzy-0.9.54/tools/compile_tinylocate_cuda.py +51 -0
- pyautogui_zzy-0.9.54/tools/evaluate_tinylocate.py +86 -0
- pyautogui_zzy-0.9.54/tools/evaluate_tinylocate_multi.py +104 -0
- pyautogui_zzy-0.9.54/tools/evaluate_tinylocate_real.py +144 -0
- pyautogui_zzy-0.9.54/tools/export_tinylocate.py +34 -0
- pyautogui_zzy-0.9.54/tools/install_tinylocate_model.py +36 -0
- pyautogui_zzy-0.9.54/tools/prepare_tinylocate_images.py +54 -0
- pyautogui_zzy-0.9.54/tools/smoke_installed.py +21 -0
- pyautogui_zzy-0.9.54/tools/smoke_tinylocate_runtime.py +55 -0
- pyautogui_zzy-0.9.54/tools/train_tinylocate.py +230 -0
- pyautogui_zzy-0.9.54/tools/update_tinylocate_fixture.py +61 -0
- pyautogui_zzy-0.9.54/tools/verify_dist.py +91 -0
- pyautogui_zzy-0.9.54/training/tinylocate/__init__.py +6 -0
- pyautogui_zzy-0.9.54/training/tinylocate/data.py +125 -0
- pyautogui_zzy-0.9.54/training/tinylocate/format.py +41 -0
- pyautogui_zzy-0.9.54/training/tinylocate/gpu_data.py +189 -0
- pyautogui_zzy-0.9.54/training/tinylocate/model.py +114 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.9.54] — unreleased
|
|
4
|
+
|
|
5
|
+
First release published under the `pyautogui-zzy` distribution name. The code
|
|
6
|
+
is the same Rust/CUDA-accelerated fork of PyAutoGUI 0.9.54 that was previously
|
|
7
|
+
published as `pyautogui-rust 0.9.54.1`, plus the packaging fixes below.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Distribution renamed from `PyAutoGUI` to `pyautogui-zzy`, and the import
|
|
12
|
+
package from `pyautogui` to `pyautogui_zzy`. The wheel no longer installs a
|
|
13
|
+
top-level `pyautogui` module, so it can no longer overwrite or be overwritten
|
|
14
|
+
by the upstream PyAutoGUI distribution.
|
|
15
|
+
- The console script is now `pyautogui-zzy` and the entry point is
|
|
16
|
+
`pyautogui_zzy._cli:main`.
|
|
17
|
+
- Rust crate renamed to `pyautogui_zzy_rust`; `rust-version = "1.88"` is now
|
|
18
|
+
declared because `slice::as_chunks` is used.
|
|
19
|
+
- `slice::chunks_exact` replaced with `slice::as_chunks` in `src/vision.rs` and
|
|
20
|
+
`src/tinylocate.rs` (`clippy::chunks_exact_to_as_chunks`).
|
|
21
|
+
- Project authorship metadata now names the fork maintainer. Upstream
|
|
22
|
+
attribution moved to `NOTICE`, which is shipped alongside `LICENSE.txt`.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- The `pyautogui -gui` console entry point imported `._gui`, a module that was
|
|
27
|
+
never included in any wheel, so it raised `ImportError` on every install. The
|
|
28
|
+
switch is removed until a GUI is actually packaged.
|
|
29
|
+
- Removed stale `PKG-INFO` and `PyAutoGUI.egg-info/` build residue from the
|
|
30
|
+
source tree.
|
|
31
|
+
- Removed the Sphinx `automodule` reference to the non-existent
|
|
32
|
+
`pyautogui.keynames` submodule.
|
|
33
|
+
|
|
34
|
+
### Removed
|
|
35
|
+
|
|
36
|
+
- The `-gui` console switch (see above).
|
|
37
|
+
|
|
38
|
+
## [0.9.54] — 2026-07-15
|
|
39
|
+
|
|
40
|
+
Snapshot of the Rust/CUDA-accelerated fork of PyAutoGUI 0.9.54 by Al Sweigart:
|
|
41
|
+
Win32 `SendInput` batching, DPI-aware GDI capture, parallel hierarchical
|
|
42
|
+
template matching, and the external TinyLocate neural locator.
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.5.1"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "cfg-if"
|
|
13
|
+
version = "1.0.4"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "crossbeam-deque"
|
|
19
|
+
version = "0.8.7"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb"
|
|
22
|
+
dependencies = [
|
|
23
|
+
"crossbeam-epoch",
|
|
24
|
+
"crossbeam-utils",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[[package]]
|
|
28
|
+
name = "crossbeam-epoch"
|
|
29
|
+
version = "0.9.20"
|
|
30
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
31
|
+
checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f"
|
|
32
|
+
dependencies = [
|
|
33
|
+
"crossbeam-utils",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[[package]]
|
|
37
|
+
name = "crossbeam-utils"
|
|
38
|
+
version = "0.8.22"
|
|
39
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
40
|
+
checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
|
|
41
|
+
|
|
42
|
+
[[package]]
|
|
43
|
+
name = "crunchy"
|
|
44
|
+
version = "0.2.4"
|
|
45
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
46
|
+
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
|
|
47
|
+
|
|
48
|
+
[[package]]
|
|
49
|
+
name = "cudarc"
|
|
50
|
+
version = "0.19.8"
|
|
51
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
52
|
+
checksum = "42310153e06cf4cd532901f7096beb27504d681736a29ee90728ae4e2d93b2a8"
|
|
53
|
+
dependencies = [
|
|
54
|
+
"libloading",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[[package]]
|
|
58
|
+
name = "either"
|
|
59
|
+
version = "1.16.0"
|
|
60
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
61
|
+
checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
|
|
62
|
+
|
|
63
|
+
[[package]]
|
|
64
|
+
name = "half"
|
|
65
|
+
version = "2.7.1"
|
|
66
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
67
|
+
checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
|
|
68
|
+
dependencies = [
|
|
69
|
+
"cfg-if",
|
|
70
|
+
"crunchy",
|
|
71
|
+
"zerocopy",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[[package]]
|
|
75
|
+
name = "heck"
|
|
76
|
+
version = "0.5.0"
|
|
77
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
78
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "indoc"
|
|
82
|
+
version = "2.0.7"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
85
|
+
dependencies = [
|
|
86
|
+
"rustversion",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[[package]]
|
|
90
|
+
name = "libc"
|
|
91
|
+
version = "0.2.186"
|
|
92
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
+
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
94
|
+
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "libloading"
|
|
97
|
+
version = "0.9.0"
|
|
98
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
+
checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60"
|
|
100
|
+
dependencies = [
|
|
101
|
+
"cfg-if",
|
|
102
|
+
"windows-link",
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
[[package]]
|
|
106
|
+
name = "memoffset"
|
|
107
|
+
version = "0.9.1"
|
|
108
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
109
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
110
|
+
dependencies = [
|
|
111
|
+
"autocfg",
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
[[package]]
|
|
115
|
+
name = "once_cell"
|
|
116
|
+
version = "1.21.4"
|
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
119
|
+
|
|
120
|
+
[[package]]
|
|
121
|
+
name = "portable-atomic"
|
|
122
|
+
version = "1.13.1"
|
|
123
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
124
|
+
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "proc-macro2"
|
|
128
|
+
version = "1.0.106"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"unicode-ident",
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
[[package]]
|
|
136
|
+
name = "pyautogui_zzy_rust"
|
|
137
|
+
version = "0.9.54"
|
|
138
|
+
dependencies = [
|
|
139
|
+
"cudarc",
|
|
140
|
+
"half",
|
|
141
|
+
"pyo3",
|
|
142
|
+
"rayon",
|
|
143
|
+
"windows-sys",
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
[[package]]
|
|
147
|
+
name = "pyo3"
|
|
148
|
+
version = "0.23.5"
|
|
149
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
+
checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
|
|
151
|
+
dependencies = [
|
|
152
|
+
"cfg-if",
|
|
153
|
+
"indoc",
|
|
154
|
+
"libc",
|
|
155
|
+
"memoffset",
|
|
156
|
+
"once_cell",
|
|
157
|
+
"portable-atomic",
|
|
158
|
+
"pyo3-build-config",
|
|
159
|
+
"pyo3-ffi",
|
|
160
|
+
"pyo3-macros",
|
|
161
|
+
"unindent",
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
[[package]]
|
|
165
|
+
name = "pyo3-build-config"
|
|
166
|
+
version = "0.23.5"
|
|
167
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
168
|
+
checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
|
|
169
|
+
dependencies = [
|
|
170
|
+
"once_cell",
|
|
171
|
+
"target-lexicon",
|
|
172
|
+
]
|
|
173
|
+
|
|
174
|
+
[[package]]
|
|
175
|
+
name = "pyo3-ffi"
|
|
176
|
+
version = "0.23.5"
|
|
177
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
178
|
+
checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
|
|
179
|
+
dependencies = [
|
|
180
|
+
"libc",
|
|
181
|
+
"pyo3-build-config",
|
|
182
|
+
]
|
|
183
|
+
|
|
184
|
+
[[package]]
|
|
185
|
+
name = "pyo3-macros"
|
|
186
|
+
version = "0.23.5"
|
|
187
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
188
|
+
checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
|
|
189
|
+
dependencies = [
|
|
190
|
+
"proc-macro2",
|
|
191
|
+
"pyo3-macros-backend",
|
|
192
|
+
"quote",
|
|
193
|
+
"syn",
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
[[package]]
|
|
197
|
+
name = "pyo3-macros-backend"
|
|
198
|
+
version = "0.23.5"
|
|
199
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
200
|
+
checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
|
|
201
|
+
dependencies = [
|
|
202
|
+
"heck",
|
|
203
|
+
"proc-macro2",
|
|
204
|
+
"pyo3-build-config",
|
|
205
|
+
"quote",
|
|
206
|
+
"syn",
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
[[package]]
|
|
210
|
+
name = "quote"
|
|
211
|
+
version = "1.0.45"
|
|
212
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
213
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
214
|
+
dependencies = [
|
|
215
|
+
"proc-macro2",
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
[[package]]
|
|
219
|
+
name = "rayon"
|
|
220
|
+
version = "1.12.0"
|
|
221
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
222
|
+
checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
|
|
223
|
+
dependencies = [
|
|
224
|
+
"either",
|
|
225
|
+
"rayon-core",
|
|
226
|
+
]
|
|
227
|
+
|
|
228
|
+
[[package]]
|
|
229
|
+
name = "rayon-core"
|
|
230
|
+
version = "1.13.0"
|
|
231
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
232
|
+
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
|
|
233
|
+
dependencies = [
|
|
234
|
+
"crossbeam-deque",
|
|
235
|
+
"crossbeam-utils",
|
|
236
|
+
]
|
|
237
|
+
|
|
238
|
+
[[package]]
|
|
239
|
+
name = "rustversion"
|
|
240
|
+
version = "1.0.22"
|
|
241
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
242
|
+
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
|
243
|
+
|
|
244
|
+
[[package]]
|
|
245
|
+
name = "syn"
|
|
246
|
+
version = "2.0.117"
|
|
247
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
248
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
249
|
+
dependencies = [
|
|
250
|
+
"proc-macro2",
|
|
251
|
+
"quote",
|
|
252
|
+
"unicode-ident",
|
|
253
|
+
]
|
|
254
|
+
|
|
255
|
+
[[package]]
|
|
256
|
+
name = "target-lexicon"
|
|
257
|
+
version = "0.12.16"
|
|
258
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
259
|
+
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
|
260
|
+
|
|
261
|
+
[[package]]
|
|
262
|
+
name = "unicode-ident"
|
|
263
|
+
version = "1.0.24"
|
|
264
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
265
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
266
|
+
|
|
267
|
+
[[package]]
|
|
268
|
+
name = "unindent"
|
|
269
|
+
version = "0.2.4"
|
|
270
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
271
|
+
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "windows-link"
|
|
275
|
+
version = "0.2.1"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
278
|
+
|
|
279
|
+
[[package]]
|
|
280
|
+
name = "windows-sys"
|
|
281
|
+
version = "0.52.0"
|
|
282
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
+
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
|
284
|
+
dependencies = [
|
|
285
|
+
"windows-targets",
|
|
286
|
+
]
|
|
287
|
+
|
|
288
|
+
[[package]]
|
|
289
|
+
name = "windows-targets"
|
|
290
|
+
version = "0.52.6"
|
|
291
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
292
|
+
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
|
293
|
+
dependencies = [
|
|
294
|
+
"windows_aarch64_gnullvm",
|
|
295
|
+
"windows_aarch64_msvc",
|
|
296
|
+
"windows_i686_gnu",
|
|
297
|
+
"windows_i686_gnullvm",
|
|
298
|
+
"windows_i686_msvc",
|
|
299
|
+
"windows_x86_64_gnu",
|
|
300
|
+
"windows_x86_64_gnullvm",
|
|
301
|
+
"windows_x86_64_msvc",
|
|
302
|
+
]
|
|
303
|
+
|
|
304
|
+
[[package]]
|
|
305
|
+
name = "windows_aarch64_gnullvm"
|
|
306
|
+
version = "0.52.6"
|
|
307
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
308
|
+
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
|
309
|
+
|
|
310
|
+
[[package]]
|
|
311
|
+
name = "windows_aarch64_msvc"
|
|
312
|
+
version = "0.52.6"
|
|
313
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
314
|
+
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
|
315
|
+
|
|
316
|
+
[[package]]
|
|
317
|
+
name = "windows_i686_gnu"
|
|
318
|
+
version = "0.52.6"
|
|
319
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
320
|
+
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
|
321
|
+
|
|
322
|
+
[[package]]
|
|
323
|
+
name = "windows_i686_gnullvm"
|
|
324
|
+
version = "0.52.6"
|
|
325
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
326
|
+
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
|
327
|
+
|
|
328
|
+
[[package]]
|
|
329
|
+
name = "windows_i686_msvc"
|
|
330
|
+
version = "0.52.6"
|
|
331
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
332
|
+
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
|
333
|
+
|
|
334
|
+
[[package]]
|
|
335
|
+
name = "windows_x86_64_gnu"
|
|
336
|
+
version = "0.52.6"
|
|
337
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
338
|
+
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
|
339
|
+
|
|
340
|
+
[[package]]
|
|
341
|
+
name = "windows_x86_64_gnullvm"
|
|
342
|
+
version = "0.52.6"
|
|
343
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
344
|
+
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
|
345
|
+
|
|
346
|
+
[[package]]
|
|
347
|
+
name = "windows_x86_64_msvc"
|
|
348
|
+
version = "0.52.6"
|
|
349
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
350
|
+
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|
351
|
+
|
|
352
|
+
[[package]]
|
|
353
|
+
name = "zerocopy"
|
|
354
|
+
version = "0.8.54"
|
|
355
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
356
|
+
checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19"
|
|
357
|
+
dependencies = [
|
|
358
|
+
"zerocopy-derive",
|
|
359
|
+
]
|
|
360
|
+
|
|
361
|
+
[[package]]
|
|
362
|
+
name = "zerocopy-derive"
|
|
363
|
+
version = "0.8.54"
|
|
364
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
365
|
+
checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5"
|
|
366
|
+
dependencies = [
|
|
367
|
+
"proc-macro2",
|
|
368
|
+
"quote",
|
|
369
|
+
"syn",
|
|
370
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "pyautogui_zzy_rust"
|
|
3
|
+
version = "0.9.54"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
rust-version = "1.88"
|
|
6
|
+
|
|
7
|
+
[lib]
|
|
8
|
+
name = "_rust_core"
|
|
9
|
+
crate-type = ["cdylib", "rlib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
pyo3 = { version = "0.23", features = ["extension-module", "abi3-py37"] }
|
|
13
|
+
rayon = "1.10"
|
|
14
|
+
half = "2.6"
|
|
15
|
+
|
|
16
|
+
[target.'cfg(target_os = "windows")'.dependencies]
|
|
17
|
+
cudarc = { version = "0.19.8", default-features = false, features = ["std", "driver", "nvrtc", "fallback-dynamic-loading", "cuda-13000"] }
|
|
18
|
+
windows-sys = { version = "0.52", features = [
|
|
19
|
+
"Win32_UI_WindowsAndMessaging",
|
|
20
|
+
"Win32_UI_Input_KeyboardAndMouse",
|
|
21
|
+
"Win32_Foundation",
|
|
22
|
+
"Win32_System_SystemInformation",
|
|
23
|
+
"Win32_UI_HiDpi",
|
|
24
|
+
"Win32_Graphics_Gdi",
|
|
25
|
+
] }
|
|
26
|
+
|
|
27
|
+
[profile.release]
|
|
28
|
+
opt-level = 3
|
|
29
|
+
lto = "thin"
|
|
30
|
+
codegen-units = 1
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# 开发与发布
|
|
2
|
+
|
|
3
|
+
本项目的首要兼容目标是:现有 PyAutoGUI 调用代码无需修改。Rust 快速路径属于内部实现,失败时由 Python/Win32 兼容层处理。
|
|
4
|
+
|
|
5
|
+
## API 兼容规则
|
|
6
|
+
|
|
7
|
+
- 保留既有公共函数、常量和别名,例如 `move`/`moveRel`、`write`/`typewrite`。
|
|
8
|
+
- 保留原参数名称、位置参数顺序与默认行为;新增能力使用可选关键字或独立对象。
|
|
9
|
+
- Python 层继续负责参数规范化、暂停、failsafe 和跨平台语义。
|
|
10
|
+
- Rust 优化不得要求调用方导入 `_rust_core`。
|
|
11
|
+
- 每次修改公共函数前更新 `tests/unit/test_api_contract.py`,先证明旧调用仍可绑定。
|
|
12
|
+
|
|
13
|
+
## 环境准备
|
|
14
|
+
|
|
15
|
+
Windows 建议使用 PowerShell 7、Python 3.12、稳定版 Rust、MSVC Build Tools 和 Windows SDK:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
python -m venv .venv
|
|
19
|
+
.\.venv\Scripts\Activate.ps1
|
|
20
|
+
python -m pip install --upgrade pip
|
|
21
|
+
python -m pip install -e ".[dev,benchmark]"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
需要对 OpenCV/MSS 图像路径做性能测试时,再安装可选依赖:
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
python -m pip install -e ".[dev,benchmark,vision]"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 无副作用测试
|
|
31
|
+
|
|
32
|
+
默认测试目录是 `tests/unit`。`conftest.py` 会在导入 PyAutoGUI 前注入原生模块替身,再将平台适配器换成内存后端。因此测试期间不会移动鼠标、发送按键、滚轮输入、调整系统计时器或安装鼠标钩子。
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
python -m pytest
|
|
36
|
+
python -m pytest --cov=pyautogui_zzy --cov-report=term-missing
|
|
37
|
+
python -m pytest tests/unit/test_windows_backend_fallback.py
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`tests/unit/test_windows_backend_fallback.py` 模拟 User32 失败分支,只读取内存替身状态,不发送输入。上游遗留的 `tests/test_pyautogui.py` 和 `tests/test_automateboringstuff.py` 包含交互式及真实桌面操作,只用于人工兼容检查,不在默认收集范围。
|
|
41
|
+
|
|
42
|
+
完整本地门禁:
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
python tools/check.py
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
只检查一侧:
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
python tools/check.py --python-only
|
|
52
|
+
python tools/check.py --rust-only
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Rust 检查
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
cargo fmt --all -- --check
|
|
59
|
+
cargo test --locked --all-targets
|
|
60
|
+
cargo clippy --locked --all-targets -- -D warnings
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Rust 单元测试应优先覆盖纯算法、坐标换算、输入批次编译和错误分支;系统 API 集成测试必须避免真实输入,并单独标记。
|
|
64
|
+
|
|
65
|
+
## 性能基准
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
python -m pytest benchmarks --benchmark-only
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
参见 `benchmarks/README.md`。提交性能结论时记录 CPU、Windows 版本、Python/Rust 版本、电源计划、构建类型和样本 JSON。默认对比中位数,超过 10% 的变化需复核。
|
|
72
|
+
|
|
73
|
+
只读的实际桌面截图与找图基准:
|
|
74
|
+
|
|
75
|
+
```powershell
|
|
76
|
+
python tools/benchmark_native.py --iterations 30 --json .benchmarks/native.json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
该工具只读取桌面像素,不发送键鼠事件。执行时应使用 Release Wheel 或 Release 扩展。
|
|
80
|
+
|
|
81
|
+
## 构建与校验
|
|
82
|
+
|
|
83
|
+
```powershell
|
|
84
|
+
Remove-Item -Recurse -Force build, dist -ErrorAction SilentlyContinue
|
|
85
|
+
python -m build
|
|
86
|
+
python tools/verify_dist.py dist
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
也可以执行整套流程:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
python tools/check.py --build
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Windows wheel 使用 CPython 3.7 ABI3 标签,可由受支持的较新 CPython 复用。发布前还应在源码目录之外安装 wheel 并运行只读冒烟测试:
|
|
96
|
+
|
|
97
|
+
```powershell
|
|
98
|
+
$wheel = (Get-ChildItem dist\*.whl).FullName
|
|
99
|
+
python -m pip install --force-reinstall --no-deps $wheel
|
|
100
|
+
Push-Location $env:TEMP
|
|
101
|
+
python C:\path\to\project\tools\smoke_installed.py
|
|
102
|
+
Pop-Location
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 发布清单
|
|
106
|
+
|
|
107
|
+
1. 工作树干净,`Cargo.lock` 已提交。
|
|
108
|
+
2. `python tools/check.py --build` 全部通过。
|
|
109
|
+
3. wheel 名称包含 `cp37-abi3`,且只包含一个 `_rust_core` 原生扩展。
|
|
110
|
+
4. sdist 包含 Rust 源码、Cargo 锁文件、许可证和构建配置,不包含 `target/`。
|
|
111
|
+
5. 在源码目录外执行 `tools/smoke_installed.py`。
|
|
112
|
+
6. 记录基准结果并检查主要 API 契约。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright (c) 2014, Al Sweigart
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
* Neither the name of the PyAutoGUI nor the names of its
|
|
15
|
+
contributors may be used to endorse or promote products derived from
|
|
16
|
+
this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
include *.md
|
|
2
|
+
include LICENSE.txt
|
|
3
|
+
recursive-include docs *.bat
|
|
4
|
+
recursive-include docs *.py
|
|
5
|
+
recursive-include docs *.rst
|
|
6
|
+
recursive-include docs Makefile
|
|
7
|
+
recursive-include pyautogui_zzy *.py
|
|
8
|
+
recursive-include tests *.py
|
|
9
|
+
recursive-include tests *.json *.png
|
|
10
|
+
include Cargo.toml
|
|
11
|
+
include Cargo.lock
|
|
12
|
+
recursive-include src *.rs *.cu *.ptx
|
|
13
|
+
recursive-include benchmarks *.py
|
|
14
|
+
recursive-include tools *.py
|
|
15
|
+
recursive-include training *.py
|
|
16
|
+
include DEVELOPING.md
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
pyautogui-zzy
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
This project is a modified fork of PyAutoGUI.
|
|
5
|
+
|
|
6
|
+
Original work:
|
|
7
|
+
PyAutoGUI
|
|
8
|
+
Copyright (c) 2014, Al Sweigart
|
|
9
|
+
https://github.com/asweigart/pyautogui
|
|
10
|
+
BSD-3-Clause; the original notice is retained verbatim in LICENSE.txt.
|
|
11
|
+
|
|
12
|
+
Modifications in this fork:
|
|
13
|
+
Copyright (c) 2026, zzy
|
|
14
|
+
|
|
15
|
+
The original copyright notice is retained as required by clause 1 of the
|
|
16
|
+
BSD-3-Clause licence. This project is an independent fork: it is not
|
|
17
|
+
endorsed by, sponsored by, or affiliated with Al Sweigart or the PyAutoGUI
|
|
18
|
+
project. The name "pyautogui-zzy" identifies this fork only.
|