mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-24 22:04:20 +00:00
pyautogui: init at 0.9.53
Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
parent
0af9db3847
commit
29990fb83d
59
pkgs/development/python-modules/pyautogui/default.nix
Normal file
59
pkgs/development/python-modules/pyautogui/default.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, python3Packages
|
||||
, pkgs
|
||||
, fetchzip
|
||||
, mouseinfo
|
||||
, pygetwindow
|
||||
, pymsgbox
|
||||
, pyperclip
|
||||
, pyrect
|
||||
, pyscreeze
|
||||
, pytweening
|
||||
, tkinter
|
||||
, xlib
|
||||
, xvfb-run
|
||||
, scrot
|
||||
}:
|
||||
buildPythonPackage rec {
|
||||
pname = "pyautogui";
|
||||
version = "0.9.53";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "asweigart";
|
||||
repo = "pyautogui";
|
||||
rev = "5e4acb870f2e7ce0ea1927cc5188bc2f5ab7bbbc";
|
||||
sha256 = "sha256-R9tcTqxUaqw63FLOGFRaO/Oz6kD7V6MPHdQ8A29NdXw=";
|
||||
};
|
||||
|
||||
checkInputs = [ xvfb-run scrot ];
|
||||
checkPhase = ''
|
||||
xvfb-run python -c 'import pyautogui'
|
||||
# The tests depend on some specific things that xvfb cant provide, like keyboard and mouse
|
||||
# xvfb-run python -m unittest tests.test_pyautogui
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# https://github.com/asweigart/pyautogui/issues/598
|
||||
./fix-locateOnWindow-and-xlib.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
mouseinfo
|
||||
pygetwindow
|
||||
pymsgbox
|
||||
xlib
|
||||
tkinter
|
||||
pyperclip
|
||||
pyscreeze
|
||||
pytweening
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "PyAutoGUI lets Python control the mouse and keyboard, and other GUI automation tasks.";
|
||||
homepage = "https://github.com/asweigart/pyautogui";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ lucasew ];
|
||||
};
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
diff --git a/pyautogui/__init__.py b/pyautogui/__init__.py
|
||||
index ec7d097..443b146 100644
|
||||
--- a/pyautogui/__init__.py
|
||||
+++ b/pyautogui/__init__.py
|
||||
@@ -216,9 +216,9 @@ try:
|
||||
|
||||
@raisePyAutoGUIImageNotFoundException
|
||||
def locateOnWindow(*args, **kwargs):
|
||||
- return pyscreeze.locateOnWindow(*args, **kwargs)
|
||||
+ return pyscreeze.locateOnScreen(*args, **kwargs)
|
||||
|
||||
- locateOnWindow.__doc__ = pyscreeze.locateOnWindow.__doc__
|
||||
+ locateOnWindow.__doc__ = pyscreeze.locateOnScreen.__doc__
|
||||
|
||||
|
||||
except ImportError:
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 196394d..6d90a88 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -29,8 +29,7 @@ setup(
|
||||
test_suite='tests',
|
||||
install_requires=['pyobjc-core;platform_system=="Darwin"',
|
||||
'pyobjc;platform_system=="Darwin"',
|
||||
- 'python3-Xlib;platform_system=="Linux" and python_version>="3.0"',
|
||||
- 'python-xlib;platform_system=="Linux" and python_version<"3.0"',
|
||||
+ 'python-xlib;platform_system=="Linux"',
|
||||
'pymsgbox',
|
||||
'PyTweening>=1.0.1',
|
||||
'pyscreeze>=0.1.21',
|
Loading…
Reference in New Issue
Block a user