From patchwork Thu Nov 13 06:27:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Zhao X-Patchwork-Id: 74374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26D38CCFA18 for ; Thu, 13 Nov 2025 06:28:26 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.17967.1763015296035502141 for ; Wed, 12 Nov 2025 22:28:16 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@windriver.com header.s=PPS06212021 header.b=OjfGBxOh; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=3412a946d8=yi.zhao@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AD4RvDb3686157 for ; Wed, 12 Nov 2025 22:28:15 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=PPS06212021; bh=Ju1oSaayYvM4uhyc0cI/ 98xSXx3l3KcTiE2J3/hp8Lc=; b=OjfGBxOhmfgpxLx2LjxOwnS09TO5Qrm+8DnW vXZo+QocVT+/MSy7UDBiiyhXcCSAy1uJuwPfhGacurb4JQQH07FkqdR34z7MN5CD /TJn/iO6F/RBEgEs+Os3IHTEmecMQdVip5g07i+VvYUuvrw8QCmpqBPGKs8Wu+rD aeiBnlxX6spP9VfMynIsD1eXHYNC6Faxdi9v9t1paW+exu4xp2ph+4bqUeExPMrz uJGtKYIdnzd4qBkXmngKIs766gsUj6ag3VbIvgEciST0rjkknZ+p70LkNl4Kwseo 6GGOtnJOdbzF4zs3IDYuSQynYHiMd74jy1pOGZVcGMayisVZDQ== Received: from co1pr03cu002.outbound.protection.outlook.com (mail-westus2azon11010055.outbound.protection.outlook.com [52.101.46.55]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4aa68jpj8b-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 12 Nov 2025 22:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gLtKkcR+Zl5ULYCJSqC+6PISsYNN8L3ImSARGOJfCMwU6MtmQUTKLVO1Nu9nGTae0CIy2CHx0w7ufnltCPTnVQ8KWiJWQnosQZ+IgeEtdPBJwX6yuFoYeaWynhLc+ocEJIiVWlMuaqdt9y/AO2EUB8SWNKoQ5ZayJRIhfVGouSOtBjIK6qF0gKOBQtT0LCHC3XP2RuTXJMXGp3EprOdhWwxC46kUoh96KkZtjIoGWUs+n+jmR2wCacJoOc9KWzGeY6DIF8EW2r+Fm41tgf4WjIvVXAvYuKgs0uzKUBCKilyW7P4392a4fw94kiiqLuoaz6VyEMSgORdrQyAl7Yp+Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ju1oSaayYvM4uhyc0cI/98xSXx3l3KcTiE2J3/hp8Lc=; b=tdrDE1u1seDv8Mb7V/2GjjcXaPg3IWDiL4pQBfeu8zSWUV3NJXrAQRhAWdOtKintt2E1z6pOwa2bil4DmyMDXy4UujanMBMolEhCLJHeiKFSjWdozuXAKII1NRl8PtNe79HEEgJ48+aVoRS2Kb0CPkXXNuXlisJMN1lVXNvlh4se/Hxr4fc98/COZtmsR6TbIDXAQfcMfhOu7BPMfe5/t0UQIsrwBW/ntIwa0zDGaZIEhSSiQe8GI6OOF87/xZ7Mo+vVhjoG5EnjLWPu4MKey5+z+9wN5MNfXotn3ntQc0wXeWSxiMRB+JDk+R7r4/x0NJ3qwseBeJtW1vBozIwIzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DS0PR11MB6399.namprd11.prod.outlook.com (2603:10b6:8:c8::5) by DS0PR11MB7410.namprd11.prod.outlook.com (2603:10b6:8:151::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Thu, 13 Nov 2025 06:28:12 +0000 Received: from DS0PR11MB6399.namprd11.prod.outlook.com ([fe80::2b44:787c:e7ee:bfad]) by DS0PR11MB6399.namprd11.prod.outlook.com ([fe80::2b44:787c:e7ee:bfad%3]) with mapi id 15.20.9320.013; Thu, 13 Nov 2025 06:28:12 +0000 From: Yi Zhao To: openembedded-devel@lists.openembedded.org Subject: [meta-python][PATCH] python3-inotify: upgrade to 0.2.12 Date: Thu, 13 Nov 2025 14:27:59 +0800 Message-Id: <20251113062759.3940680-1-yi.zhao@windriver.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYCP286CA0136.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::20) To DS0PR11MB6399.namprd11.prod.outlook.com (2603:10b6:8:c8::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB6399:EE_|DS0PR11MB7410:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a755714-0b50-44fd-6dbd-08de227dd1f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|13003099007|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?mhYlvsObf9NzsbgCxc66VkhvqlTQ1j9?= =?utf-8?q?yzNNikP8nxoje5phves03ucuQt/s1Afut16zWFp8gJLIH2atKWAGR6aSo+fTAy0Ae?= =?utf-8?q?LDOe27kSy36/u50lfAp9pBOMJqKlrfhBX9por2KqqiownUja1dsQRskV+A+Kr//70?= =?utf-8?q?TjGu1foZyR7aIn8IICViXgihLRmhNKhGmowg9LnXjusXNef+7HMpHyQzZGohnu9Aa?= =?utf-8?q?uS6wsHDPqw+QRikLqzvWPhx+DzpZlOyaePEqxSD4AWigOI9KsaZCu5IFSoplNIIu6?= =?utf-8?q?Ijc6vY132BcRfPgAvjrZTBbB1RsTmaEmAHGFa/DQ3oaoqbSvPV1lbdNoQNN70Xp2t?= =?utf-8?q?Je9EYecTYeczsZphM8rj9m3DQOEEynnaHDx9w/Y7olmIiB0FtzZD6sOcN8jRwYXoH?= =?utf-8?q?mklY+2Bf2mJZVP8KH3CE5+I+usEoUGTy5S0vLdjxQVM2xB6JS1EJ6fUefuJMmmm0S?= =?utf-8?q?DctgbGLMmzyLyjHrb25vmJ5u38D6B5Dw0eQNvFhwYzc8TsQu7CS88iKNFRhy7Sfk6?= =?utf-8?q?X8DRqj+yQgB/p//alml59s/n7pD0cY5gDoGrfWWpoSK9ZAFV1Yqw0w9Qd5HorB+Iy?= =?utf-8?q?mkbV5a/sa4VziF7jQf45Mv3x3RqFjbmHRlHJJNEsaHiddCiVpB1hdvvhg5N80gSg1?= =?utf-8?q?rSbml+6mgBSB8tQSuLBVbP3lIJyKrRm0vybTUcV4Yit1zHq4wcxLdWwzqVFtmyt8j?= =?utf-8?q?BfMWbKO0t3Qk9MfJ95y6gJ4vaxivSuPPKKQOqlvK65h7zpdVPu35IoKvlCkJKP5Hk?= =?utf-8?q?RuBSoLW+bhbXNxSpYMyPSZj2Hw2Tb9E7ETbk3j/JehKQGgkskG25gs7XEhkjq1XNe?= =?utf-8?q?kP3UQWKnN4e37/xN+C11KXUQezdcJ21ikPYrQCwXlekG+bWa5r7O7hanogcLIb1r5?= =?utf-8?q?Mm9Lkuk7OfpITXtiTP8przGymg4ciiK7FAX10EiH3KGp2F5M4i14N+7LeZs1UWgt7?= =?utf-8?q?ogTP2Gy75PUPntPNuHgAGMOZ/Kiwgle7Xgn0vRnR61ytS+A1QMCpNAnq5BIRJxtgI?= =?utf-8?q?RpRC8BMWhlnf9TajFeDEiQEN45csHXyNzv+PANKEVmYnWU6w3acZclwLDkPEHwB+/?= =?utf-8?q?WwrMgN1b7bjj9uyQvLZ0a/icEHqXCLg0/ou5RVbi/4ZI3mxkBe6CTNdUfRt7M8XUi?= =?utf-8?q?4T4qEWaiWXHO/vuWztbI6gCfSapr0nzVcBTtx3naS92zJ95j9K0oDRwT325W7UNLy?= =?utf-8?q?KpXF434e0dnyY5j/3TkIj0v/MP0KJFl8eDg9eKY5lUK03psT8Pfih5sxNwl/Th7Bd?= =?utf-8?q?ohQjTQLIaXZqI3+QO/et8Vh41eFTMm632F4n1+ab6LJWGMF2z5J8eVSMAwNv0aDtf?= =?utf-8?q?QbhN1pzIugihVTHghuroirh+tOAiCP0t4/E1D1kF/J7z+x+ZkuEOaTOaxNO3UPF51?= =?utf-8?q?4tjkBmd4Nr/jOXq6E2nloM5jSANOBDy2Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB6399.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(13003099007)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?2NH91CGvaZWFP133FbVWEXIon2Zv?= =?utf-8?q?qzd64D7kIppyC45i8yPcWZiEnRRITNDtZNrIf4CGNJp7QkyTRlNZIsl/54ZcDDESb?= =?utf-8?q?TMv9cHpCgRUT0Ao9KeEs3HLSIQ4FLiKlutIB43S8RGe25ILM2cRkZgZCGRIqXSZYv?= =?utf-8?q?ipW/m0IEHvQY5Ogx8rUESZ9umhJANavduZP2A+3osrV5QMDFvKT4KfYcsVBfk59WN?= =?utf-8?q?K9EpjFqCcNKudMcZwFazttnD3vBCKvnfyRglgYAypH68vRJ8PopQdv1Hq0N+OnOSB?= =?utf-8?q?nj00JlBU+ra0qEqvYF+2ax1DQYO7LpbQrBK5FMzKL7+EXPwuRIfMRdCVGdKqhBIr8?= =?utf-8?q?XBL1n3LaGfl0Y/nYYKj9NB7cKsuISkOpr8NvEjQK4GYUvny212ObeSsr386ERK7Y+?= =?utf-8?q?4xWJHejtRAFuZPlhyhMbKLLoxVuzeRO24B0sfYPGdPIwPBMbdW5GRYXAMpoN+aW6v?= =?utf-8?q?VYfWWIvUstFP29kZisSF2xZHKuunfTs2EiuSzLYQK/ahM7K7NPwqgvTxCYnLO+Kcu?= =?utf-8?q?f5Y8umepsGZZpZwPeWxZ2N+N149AAhktuwjaRjwoZhVPC56WafjvcSuhcSZQjPhNy?= =?utf-8?q?x/v9H+GCnHuW3Jn7gVdPFrsQSTs+iTA27XUuo1PoieTNw31s6o/VZDUblJkx10u0B?= =?utf-8?q?+9yCgM7uRMUiScSF64q4OuGsTAb3zAH+lY5qiYMm5MMwKPUcUgVL8LxJdTlsC1cxO?= =?utf-8?q?65+k0PyyRtI+5dPA37rlrS6PIlUH/yG7OLSo3ir/YuHzUn5yM1yoSDGnr11bGd5zH?= =?utf-8?q?RAFvkHF6MU/57QpkIiDXmOfW6j7PWTRUopj7PV8419j5ih0z8/FSTET6CHxo3i/bc?= =?utf-8?q?j8a65DRtcfQ8W/q5yq38WirK+MmBh1NvLDzaYmkMPuDFLzDzDja9JdPgGFBIbbthc?= =?utf-8?q?vAemDjVqC/YXZ0QKTwL85UARe06c/VbZF2Lci5MdrW+dM42ZiG61+6sAGkO0xfIYb?= =?utf-8?q?Tocv3bXv363YiFsaSWxvgYqxIB1nobZlkjt7rVJRqU0h88jqmBPdsgTwNfB1KgxHG?= =?utf-8?q?Wz7RyoakLzs252y1hqXnr3wcQZ1p5wyKGPuHXxcUZhVTp7843Ozay9n/6lzrGexPs?= =?utf-8?q?M3C5QJldYkZZBkbw2Xy8LwG3/wD3WbkRRFVnrjx0ysjCCy6LxgLxXIU+61yJU1zZX?= =?utf-8?q?+RJ/A13EjHnf0S8V15lL/jEiuKu4iPR/j7fw3Sy0ZLnZt7kq1azJNpMZb9URrFrOH?= =?utf-8?q?gvd1SWma9upid5WFq3JcBdeytUZDP5/4tZCjaWDKLdaPYyyBjS9MQ6NLke7rqKpQ8?= =?utf-8?q?sc8BWDE7UVSGryhTWdbUs6TxPTifC/SLsQkF8DPVenh7XxDHX+N7mugnHSUdcywmH?= =?utf-8?q?7RdSo8eLuvNwufIdqCf3syPf3X1r0WQamJLVnOd1AO6SMx2NzRSlNmK7L4RNrxcsX?= =?utf-8?q?L9QNHTJ9bQdSv+hB11sBFklblTH/vrSfzvFjKSVQRXD+hq200PmMsuFrlcyAjgDke?= =?utf-8?q?wkoBCxBYNGYSaZODpnvw4zZS/uL2yqOB4LhpbFnDiMgcjL1OP1XGBj/MQHJzGxs3S?= =?utf-8?q?nV5zcUFLXF+R?= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a755714-0b50-44fd-6dbd-08de227dd1f6 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB6399.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2025 06:28:12.5484 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 49Rv7jZAjvxJeSBx6jb+JmjJpQZty9E/BWIm+4OSyk8SQKPOoq+NPNOV9j0hsxWR2MWROcfxNLjYsl5WAHxvBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7410 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTEzMDA0MyBTYWx0ZWRfX6+9VMG7i8UGc OqvUKx8uO9DbFMF3Ze6VhwwMFIdqm79wZrUCdiLPGKye/7OkCyL+BLSGyZEdJ0UrE+VVn9NSYaU 1DXSTRUPR07mVG/3wpamRyoCFbhbBsirNce+1XVPpIN+fUbI7wlz4btHogzKzIuXbA10UA8KVQc jCO2nqAeYfEMUixRF8HZDYp6pfE48lMQkso7gXXc2N+F0Uhjjr8ApojQjHE/dAgARoNdbIBWcW7 rIOB3lgPEvUpfhrcLI4pa2S1/JJfsssA48feWfFdUaDgB+gGA4fLJhaDSAI8MwzIOPp4DXfgyXj u9R44j7QkBjB3Zm+TQdNgn0niBRcJkuCF+yjJOf5DAT4+xiWI/Yn2orK1rgvt/hUTrvSDA9crAR 0XjyYRIBlkUPqteD81OD2LnCn+Xrzw== X-Proofpoint-GUID: 6eYsyeZkcnOtOJRH4zRjrmtoMPurSQvL X-Proofpoint-ORIG-GUID: 6eYsyeZkcnOtOJRH4zRjrmtoMPurSQvL X-Authority-Analysis: v=2.4 cv=ef0wvrEH c=1 sm=1 tr=0 ts=69157a7f cx=c_pps a=gGLfFga2G+uCUFnDxO+Iyw==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=NEAV23lmAAAA:8 a=CckQENj0AAAA:8 a=t7CeM3EgAAAA:8 a=UP_48DTtEkMPKlQ2ZN8A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-12_06,2025-11-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511130043 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 5AD4RvDb3686157 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 13 Nov 2025 06:28:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/121637 ChangeLog: https://github.com/dsoprea/PyInotify/releases/tag/0.2.11 https://github.com/dsoprea/PyInotify/releases/tag/0.2.12 License Update: Use LICENSE file instead of the specific line in setup.py. * Switch to PyPI instead of github source * Drop local patch new-test-inotify.patch as it can not be applied with updated test_inotify.py Ptest result: $ ptest-runner python3-inotify START: ptest-runner 2025-11-13T03:46 BEGIN: /usr/lib/python3-inotify/ptest PASS: tests/test_inotify.py:TestInotify.test__cycle PASS: tests/test_inotify.py:TestInotify.test__error_on_watch_nonexistent_folder PASS: tests/test_inotify.py:TestInotify.test__get_event_names SKIP: tests/test_inotify.py:TestInotify.test__international_naming_python2 # SKIP Not in Python 2 PASS: tests/test_inotify.py:TestInotify.test__international_naming_python3 PASS: tests/test_inotify.py:TestInotify.test__watch_list_of_paths PASS: tests/test_inotify.py:TestInotifyTree.test__automatic_new_watches_on_existing_paths PASS: tests/test_inotify.py:TestInotifyTree.test__automatic_new_watches_on_new_paths PASS: tests/test_inotify.py:TestInotifyTree.test__cycle PASS: tests/test_inotify.py:TestInotifyTree.test__renames PASS: tests/test_inotify.py:TestInotifyTrees.test__cycle ============================================================================ Testsuite summary # TOTAL: 11 # PASS: 10 # SKIP: 1 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 DURATION: 14 END: /usr/lib/python3-inotify/ptest 2025-11-13T03:46 STOP: ptest-runner TOTAL: 1 FAIL: 0 Signed-off-by: Yi Zhao --- .../python3-inotify/new-test-inotify.patch | 620 ------------------ .../python/python3-inotify_0.2.12.bb | 16 + .../python/python3-inotify_git.bb | 21 - 3 files changed, 16 insertions(+), 641 deletions(-) delete mode 100644 meta-python/recipes-devtools/python/python3-inotify/new-test-inotify.patch create mode 100644 meta-python/recipes-devtools/python/python3-inotify_0.2.12.bb delete mode 100644 meta-python/recipes-devtools/python/python3-inotify_git.bb diff --git a/meta-python/recipes-devtools/python/python3-inotify/new-test-inotify.patch b/meta-python/recipes-devtools/python/python3-inotify/new-test-inotify.patch deleted file mode 100644 index e462615e14..0000000000 --- a/meta-python/recipes-devtools/python/python3-inotify/new-test-inotify.patch +++ /dev/null @@ -1,620 +0,0 @@ -From 80010e27d774e8b722d569384492eaab2bc4ac61 Mon Sep 17 00:00:00 2001 -From: Joe Slater -Date: Thu, 27 Jul 2023 15:01:04 +0000 -Subject: [PATCH] working commit - -It is not safe to assume the values returned by add_watch(), -so we add a local helper get_wd() to retrieve them. This fixes -a problem in TestInotifyTree.test__cycle() where the -wd's for the 'aa' and 'bb' paths are not '2' and '3', -respectively. - -A second issue is that Inotify._get_event_names() should -return a set or sorted list to avoid comparison problems, -but that is not addressed here since it could be viewed as -changing the API. - -This test_inotify.py is based on the version in the fix_tests branch of -pyinotify as of commit d7d3c58... - -Upstream-Status: Submitted [github.com/dsoprea/PyInotify/pull/104] - -Signed-off-by: Joe Slater ---- - tests/test_inotify.py | 346 ++++++++++++++++++++++++++++++++---------- - 1 file changed, 262 insertions(+), 84 deletions(-) - -diff --git a/tests/test_inotify.py b/tests/test_inotify.py -index d9f1f84..d89a49e 100644 ---- a/tests/test_inotify.py -+++ b/tests/test_inotify.py -@@ -2,6 +2,7 @@ - - import os - import unittest -+import time - - import inotify.constants - import inotify.calls -@@ -15,6 +16,11 @@ except NameError: - else: - _HAS_PYTHON2_UNICODE_SUPPORT = True - -+# Inotify does not have a get for watch descriptors -+# -+def get_wd(i, path): -+ return i._Inotify__watches[path] -+ - - class TestInotify(unittest.TestCase): - def __init__(self, *args, **kwargs): -@@ -29,11 +35,11 @@ class TestInotify(unittest.TestCase): - @unittest.skipIf(_HAS_PYTHON2_UNICODE_SUPPORT is True, "Not in Python 3") - def test__international_naming_python3(self): - with inotify.test_support.temp_path() as path: -- inner_path = os.path.join(path, '新增資料夾') -+ inner_path = os.path.join(path, u'新增資料夾') - os.mkdir(inner_path) - - i = inotify.adapters.Inotify() -- i.add_watch(inner_path) -+ wd = i.add_watch(inner_path) - - with open(os.path.join(inner_path, 'filename'), 'w'): - pass -@@ -41,12 +47,27 @@ class TestInotify(unittest.TestCase): - events = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=256, cookie=0, len=16), ['IN_CREATE'], inner_path, 'filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=32, cookie=0, len=16), ['IN_OPEN'], inner_path, 'filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], inner_path, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=256, cookie=0, len=16), ['IN_CREATE'], inner_path, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=32, cookie=0, len=16), ['IN_OPEN'], inner_path, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], inner_path, 'filename'), - ] - -- self.assertEquals(events, expected) -+ if events != expected: -+ print("ACTUAL:") -+ print("") -+ -+ for i, event in enumerate(events): -+ print(event) -+ -+ print("") -+ -+ print("EXPECTED:") -+ print("") -+ -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - @unittest.skipIf(_HAS_PYTHON2_UNICODE_SUPPORT is False, "Not in Python 2") - def test__international_naming_python2(self): -@@ -55,7 +76,7 @@ class TestInotify(unittest.TestCase): - os.mkdir(inner_path) - - i = inotify.adapters.Inotify() -- i.add_watch(inner_path) -+ wd = i.add_watch(inner_path) - - with open(os.path.join(inner_path, u'filename料夾'), 'w'): - pass -@@ -63,12 +84,28 @@ class TestInotify(unittest.TestCase): - events = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=256, cookie=0, len=16), ['IN_CREATE'], inner_path, u'filename料夾'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=32, cookie=0, len=16), ['IN_OPEN'], inner_path, u'filename料夾'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], inner_path, u'filename料夾'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=256, cookie=0, len=16), ['IN_CREATE'], inner_path, u'filename料夾'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=32, cookie=0, len=16), ['IN_OPEN'], inner_path, u'filename料夾'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], inner_path, u'filename料夾'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=16, cookie=0, len=16), ['IN_CLOSE_NOWRITE'], inner_path, u'filename料夾'), - ] - -- self.assertEquals(events, expected) -+ if events != expected: -+ print("ACTUAL:") -+ print("") -+ -+ for i, event in enumerate(events): -+ print(event) -+ -+ print("") -+ -+ print("EXPECTED:") -+ print("") -+ -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - def test__cycle(self): - with inotify.test_support.temp_path() as path: -@@ -79,7 +116,7 @@ class TestInotify(unittest.TestCase): - os.mkdir(path2) - - i = inotify.adapters.Inotify() -- i.add_watch(path1) -+ wd = i.add_watch(path1) - - with open('ignored_new_file', 'w'): - pass -@@ -96,32 +133,47 @@ class TestInotify(unittest.TestCase): - - expected = [ - ( -- inotify.adapters._INOTIFY_EVENT(wd=1, mask=256, cookie=0, len=16), -+ inotify.adapters._INOTIFY_EVENT(wd=wd, mask=256, cookie=0, len=16), - ['IN_CREATE'], - path1, - 'seen_new_file' - ), - ( -- inotify.adapters._INOTIFY_EVENT(wd=1, mask=32, cookie=0, len=16), -+ inotify.adapters._INOTIFY_EVENT(wd=wd, mask=32, cookie=0, len=16), - ['IN_OPEN'], - path1, - 'seen_new_file' - ), - ( -- inotify.adapters._INOTIFY_EVENT(wd=1, mask=8, cookie=0, len=16), -+ inotify.adapters._INOTIFY_EVENT(wd=wd, mask=8, cookie=0, len=16), - ['IN_CLOSE_WRITE'], - path1, - 'seen_new_file' - ), - ( -- inotify.adapters._INOTIFY_EVENT(wd=1, mask=512, cookie=0, len=16), -+ inotify.adapters._INOTIFY_EVENT(wd=wd, mask=512, cookie=0, len=16), - ['IN_DELETE'], - path1, - 'seen_new_file' - ) - ] - -- self.assertEquals(events, expected) -+ if events != expected: -+ print("ACTUAL:") -+ print("") -+ -+ for i, event in enumerate(events): -+ print(event) -+ -+ print("") -+ -+ print("EXPECTED:") -+ print("") -+ -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - # This can't be removed until *after* we've read the events because - # they'll be flushed the moment we remove the watch. -@@ -131,7 +183,7 @@ class TestInotify(unittest.TestCase): - pass - - events = self.__read_all_events(i) -- self.assertEquals(events, []) -+ self.assertEqual(events, []) - - @staticmethod - def _open_write_close(*args): -@@ -167,23 +219,47 @@ class TestInotify(unittest.TestCase): - with inotify.test_support.temp_path() as path: - path1 = TestInotify._make_temp_path(path, 'aa') - path2 = TestInotify._make_temp_path(path, 'bb') -+ - i = inotify.adapters.Inotify([path1, path2]) -+ - TestInotify._open_write_close('ignored_new_file') - TestInotify._open_write_close(path1, 'seen_new_file') - TestInotify._open_write_close(path2, 'seen_new_file2') -+ -+ wd_path1 = get_wd(i, path1) -+ wd_path2 = get_wd(i, path2) -+ -+ - os.remove(os.path.join(path1, 'seen_new_file')) -+ - events = self.__read_all_events(i) -+ - expected = [ -- TestInotify._event_create(wd=1, path=path1, filename='seen_new_file'), -- TestInotify._event_open(wd=1, path=path1, filename='seen_new_file'), -- TestInotify._event_close_write(wd=1, path=path1, filename='seen_new_file'), -- TestInotify._event_create(wd=2, path=path2, filename='seen_new_file2'), -- TestInotify._event_open(wd=2, path=path2, filename='seen_new_file2'), -- TestInotify._event_close_write(wd=2, path=path2, filename='seen_new_file2'), -- TestInotify._event_general(wd=1, mask=512, type_name='IN_DELETE', -- path=path1, filename='seen_new_file') -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=256, cookie=0, len=16), ['IN_CREATE'], path1, u'seen_new_file'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=32, cookie=0, len=16), ['IN_OPEN'], path1, u'seen_new_file'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path1, u'seen_new_file'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, u'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, u'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, u'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=512, cookie=0, len=16), ['IN_DELETE'], path1, u'seen_new_file'), - ] -- self.assertEquals(events, expected) -+ -+ if events != expected: -+ print("ACTUAL:") -+ print("") -+ -+ for i, event in enumerate(events): -+ print(event) -+ -+ print("") -+ -+ print("EXPECTED:") -+ print("") -+ -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - def test__error_on_watch_nonexistent_folder(self): - i = inotify.adapters.Inotify() -@@ -201,7 +277,7 @@ class TestInotify(unittest.TestCase): - i = inotify.adapters.Inotify() - names = i._get_event_names(all_mask) - -- self.assertEquals(names, all_names) -+ self.assertEqual(names, all_names) - - - class TestInotifyTree(unittest.TestCase): -@@ -219,56 +295,101 @@ class TestInotifyTree(unittest.TestCase): - path1 = os.path.join(path, 'aa') - os.mkdir(path1) - -+ time.sleep(.10) -+ - path2 = os.path.join(path, 'bb') - os.mkdir(path2) - -+ time.sleep(.10) -+ - i = inotify.adapters.InotifyTree(path) - - with open('seen_new_file1', 'w'): - pass - -+ time.sleep(.10) -+ - with open(os.path.join(path1, 'seen_new_file2'), 'w'): - pass - -+ time.sleep(.10) -+ - with open(os.path.join(path2, 'seen_new_file3'), 'w'): - pass - -+ time.sleep(.10) -+ -+ wd_path = get_wd(i.inotify, path) -+ wd_path1 = get_wd(i.inotify, path1) -+ wd_path2 = get_wd(i.inotify, path2) -+ - os.remove(os.path.join(path, 'seen_new_file1')) -+ -+ time.sleep(.10) -+ - os.remove(os.path.join(path1, 'seen_new_file2')) -+ -+ time.sleep(.10) -+ - os.remove(os.path.join(path2, 'seen_new_file3')) - -+ time.sleep(.10) -+ - os.rmdir(path1) -+ -+ time.sleep(.10) -+ - os.rmdir(path2) - -- events = self.__read_all_events(i) -+ time.sleep(.10) - -+ events = self.__read_all_events(i) -+ events = sorted(events) -+ - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=256, cookie=0, len=16), ['IN_CREATE'], path, 'seen_new_file1'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=32, cookie=0, len=16), ['IN_OPEN'], path, 'seen_new_file1'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path, 'seen_new_file1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=256, cookie=0, len=16), ['IN_CREATE'], path, 'seen_new_file1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=32, cookie=0, len=16), ['IN_OPEN'], path, 'seen_new_file1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path, 'seen_new_file1'), - -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=256, cookie=0, len=16), ['IN_CREATE'], path1, 'seen_new_file2'), -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=32, cookie=0, len=16), ['IN_OPEN'], path1, 'seen_new_file2'), -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path1, 'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=256, cookie=0, len=16), ['IN_CREATE'], path1, 'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=32, cookie=0, len=16), ['IN_OPEN'], path1, 'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path1, 'seen_new_file2'), - -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'seen_new_file3'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'seen_new_file3'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'seen_new_file3'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'seen_new_file3'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'seen_new_file3'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'seen_new_file3'), - -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=512, cookie=0, len=16), ['IN_DELETE'], path, 'seen_new_file1'), -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=512, cookie=0, len=16), ['IN_DELETE'], path1, 'seen_new_file2'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=512, cookie=0, len=16), ['IN_DELETE'], path2, 'seen_new_file3'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=512, cookie=0, len=16), ['IN_DELETE'], path, 'seen_new_file1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=512, cookie=0, len=16), ['IN_DELETE'], path1, 'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=512, cookie=0, len=16), ['IN_DELETE'], path2, 'seen_new_file3'), - -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=1024, cookie=0, len=0), ['IN_DELETE_SELF'], path1, ''), -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=32768, cookie=0, len=0), ['IN_IGNORED'], path1, ''), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=1073742336, cookie=0, len=16), ['IN_ISDIR', 'IN_DELETE'], path, 'aa'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=1024, cookie=0, len=0), ['IN_DELETE_SELF'], path1, ''), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=32768, cookie=0, len=0), ['IN_IGNORED'], path1, ''), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=1073742336, cookie=0, len=16), ['IN_DELETE', 'IN_ISDIR'], path, 'aa'), - -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=1024, cookie=0, len=0), ['IN_DELETE_SELF'], path2, ''), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=32768, cookie=0, len=0), ['IN_IGNORED'], path2, ''), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=1073742336, cookie=0, len=16), ['IN_ISDIR', 'IN_DELETE'], path, 'bb'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=1024, cookie=0, len=0), ['IN_DELETE_SELF'], path2, ''), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=32768, cookie=0, len=0), ['IN_IGNORED'], path2, ''), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=1073742336, cookie=0, len=16), ['IN_DELETE', 'IN_ISDIR'], path, 'bb'), - ] - -- self.assertEquals(events, expected) -+ expected = sorted(expected) -+ -+ if events != expected: -+ print("ACTUAL:") -+ print("") -+ -+ for i, event in enumerate(events): -+ print(event) -+ -+ print("") -+ -+ print("EXPECTED:") -+ print("") -+ -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - def test__renames(self): - -@@ -283,26 +404,30 @@ class TestInotifyTree(unittest.TestCase): - new_path = os.path.join(path, 'new_folder') - - os.mkdir(old_path) -+ -+ wd_path = get_wd(i.inotify, path) - - events1 = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=1073742080, cookie=events1[0][0].cookie, len=16), ['IN_ISDIR', 'IN_CREATE'], path, 'old_folder'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=1073742080, cookie=events1[0][0].cookie, len=16), ['IN_CREATE', 'IN_ISDIR'], path, 'old_folder'), - ] - -- self.assertEquals(events1, expected) -- -+ self.assertEqual(events1, expected) - - os.rename(old_path, new_path) - -+ wd_old_path = get_wd(i.inotify, old_path) -+ - events2 = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=1073741888, cookie=events2[0][0].cookie, len=16), ['IN_MOVED_FROM', 'IN_ISDIR'], path, 'old_folder'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=1073741952, cookie=events2[1][0].cookie, len=16), ['IN_MOVED_TO', 'IN_ISDIR'], path, 'new_folder'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=1073741888, cookie=events2[0][0].cookie, len=16), ['IN_MOVED_FROM', 'IN_ISDIR'], path, 'old_folder'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=1073741952, cookie=events2[1][0].cookie, len=16), ['IN_MOVED_TO', 'IN_ISDIR'], path, 'new_folder'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=2048, cookie=0, len=0), ['IN_MOVE_SELF'], new_path, '') - ] - -- self.assertEquals(events2, expected) -+ self.assertEqual(events2, expected) - - - with open(os.path.join(new_path, 'old_filename'), 'w'): -@@ -318,21 +443,33 @@ class TestInotifyTree(unittest.TestCase): - events3 = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=256, cookie=0, len=16), ['IN_CREATE'], new_path, 'old_filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=32, cookie=0, len=16), ['IN_OPEN'], new_path, 'old_filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], new_path, 'old_filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=256, cookie=0, len=16), ['IN_CREATE'], new_path, 'old_filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=32, cookie=0, len=16), ['IN_OPEN'], new_path, 'old_filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], new_path, 'old_filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=64, cookie=events3[3][0].cookie, len=16), ['IN_MOVED_FROM'], new_path, 'old_filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=128, cookie=events3[4][0].cookie, len=16), ['IN_MOVED_TO'], new_path, 'new_filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=512, cookie=0, len=16), ['IN_DELETE'], new_path, 'new_filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=1024, cookie=0, len=0), ['IN_DELETE_SELF'], new_path, ''), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_old_path, mask=32768, cookie=0, len=0), ['IN_IGNORED'], new_path, ''), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=1073742336, cookie=0, len=16), ['IN_DELETE', 'IN_ISDIR'], path, 'new_folder'), -+ ] - -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=64, cookie=events3[3][0].cookie, len=16), ['IN_MOVED_FROM'], new_path, 'old_filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=128, cookie=events3[4][0].cookie, len=16), ['IN_MOVED_TO'], new_path, 'new_filename'), -+ if events3 != expected: -+ print("ACTUAL:") -+ print("") - -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=512, cookie=0, len=16), ['IN_DELETE'], new_path, 'new_filename'), -+ for i, event in enumerate(events3): -+ print(event) - -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=1024, cookie=0, len=0), ['IN_DELETE_SELF'], new_path, ''), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=32768, cookie=0, len=0), ['IN_IGNORED'], new_path, ''), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=1073742336, cookie=0, len=16), ['IN_ISDIR', 'IN_DELETE'], path, 'new_folder'), -- ] -+ print("") -+ -+ print("EXPECTED:") -+ print("") - -- self.assertEquals(events3, expected) -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - def test__automatic_new_watches_on_new_paths(self): - -@@ -346,39 +483,60 @@ class TestInotifyTree(unittest.TestCase): - path2 = os.path.join(path1, 'folder2') - - os.mkdir(path1) -+ -+ wd_path = get_wd(i.inotify, path) - - events = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=1073742080, cookie=0, len=16), ['IN_ISDIR', 'IN_CREATE'], path, 'folder1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path, mask=1073742080, cookie=0, len=16), ['IN_CREATE', 'IN_ISDIR'], path, 'folder1'), - ] - -- self.assertEquals(events, expected) -+ self.assertEqual(events, expected) - - - os.mkdir(path2) - -+ wd_path1 = get_wd(i.inotify, path1) -+ - events = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=1073742080, cookie=0, len=16), ['IN_ISDIR', 'IN_CREATE'], path1, 'folder2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=1073742080, cookie=0, len=16), ['IN_CREATE', 'IN_ISDIR'], path1, 'folder2'), - ] - -- self.assertEquals(events, expected) -+ self.assertEqual(events, expected) - - - with open(os.path.join(path2,'filename'), 'w'): - pass - -+ wd_path2 = get_wd(i.inotify, path2) -+ - events = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'filename'), - ] - -- self.assertEquals(events, expected) -+ if events != expected: -+ print("ACTUAL:") -+ print("") -+ -+ for i, event in enumerate(events): -+ print(event) -+ -+ print("") -+ -+ print("EXPECTED:") -+ print("") -+ -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - def test__automatic_new_watches_on_existing_paths(self): - -@@ -396,16 +554,33 @@ class TestInotifyTree(unittest.TestCase): - - with open(os.path.join(path2,'filename'), 'w'): - pass -+ -+ wd = get_wd(i.inotify, path2) - - events = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'filename'), -- (inotify.adapters._INOTIFY_EVENT(wd=3, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'filename'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'filename'), - ] - -- self.assertEquals(events, expected) -+ if events != expected: -+ print("ACTUAL:") -+ print("") -+ -+ for i, event in enumerate(events): -+ print(event) -+ -+ print("") -+ -+ print("EXPECTED:") -+ print("") -+ -+ for i, event in enumerate(expected): -+ print(event) -+ -+ raise Exception("Events not correct.") - - - class TestInotifyTrees(unittest.TestCase): -@@ -428,6 +603,9 @@ class TestInotifyTrees(unittest.TestCase): - - i = inotify.adapters.InotifyTrees([path1, path2]) - -+ wd_path1 = get_wd(i.inotify, path1) -+ wd_path2 = get_wd(i.inotify, path2) -+ - with open(os.path.join(path1, 'seen_new_file1'), 'w'): - pass - -@@ -437,13 +615,13 @@ class TestInotifyTrees(unittest.TestCase): - events = self.__read_all_events(i) - - expected = [ -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=256, cookie=0, len=16), ['IN_CREATE'], path1, 'seen_new_file1'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=32, cookie=0, len=16), ['IN_OPEN'], path1, 'seen_new_file1'), -- (inotify.adapters._INOTIFY_EVENT(wd=1, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path1, 'seen_new_file1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=256, cookie=0, len=16), ['IN_CREATE'], path1, 'seen_new_file1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=32, cookie=0, len=16), ['IN_OPEN'], path1, 'seen_new_file1'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path1, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path1, 'seen_new_file1'), - -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'seen_new_file2'), -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'seen_new_file2'), -- (inotify.adapters._INOTIFY_EVENT(wd=2, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=256, cookie=0, len=16), ['IN_CREATE'], path2, 'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=32, cookie=0, len=16), ['IN_OPEN'], path2, 'seen_new_file2'), -+ (inotify.adapters._INOTIFY_EVENT(wd=wd_path2, mask=8, cookie=0, len=16), ['IN_CLOSE_WRITE'], path2, 'seen_new_file2'), - ] - -- self.assertEquals(events, expected) -+ self.assertEqual(events, expected) --- -2.35.5 - diff --git a/meta-python/recipes-devtools/python/python3-inotify_0.2.12.bb b/meta-python/recipes-devtools/python/python3-inotify_0.2.12.bb new file mode 100644 index 0000000000..f442d2faa6 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-inotify_0.2.12.bb @@ -0,0 +1,16 @@ +SUMMARY = "An adapter to Linux kernel support for inotify directory-watching." +HOMEPAGE = "https://pypi.org/project/inotify/" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=8c16666ae6c159876a0ba63099614381" + +SRC_URI[sha256sum] = "9aee407f92c7d51a2ce50f3b78291a9094e334e34bd68e82bf60020795fa2c94" + +PYPI_PACKAGE = "inotify" +UPSTREAM_CHECK_PYPI_PACKAGE = "${PYPI_PACKAGE}" + +inherit pypi python_setuptools_build_meta ptest-python-pytest + +RDEPENDS:${PN} += " \ + python3-ctypes \ + python3-logging \ +" diff --git a/meta-python/recipes-devtools/python/python3-inotify_git.bb b/meta-python/recipes-devtools/python/python3-inotify_git.bb deleted file mode 100644 index e8d88250a3..0000000000 --- a/meta-python/recipes-devtools/python/python3-inotify_git.bb +++ /dev/null @@ -1,21 +0,0 @@ -SUMMARY = "An adapter to Linux kernel support for inotify directory-watching." -HOMEPAGE = "https://pypi.org/project/inotify/" -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://setup.py;md5=79b7ec72aa0d446a552d3cceb5799e41;beginline=28;endline=28" - -SRC_URI[sha256sum] = "974a623a338482b62e16d4eb705fb863ed33ec178680fc3e96ccdf0df6c02a07" - -SRC_URI = " \ - git://github.com/dsoprea/pyinotify.git;branch=master;protocol=https \ - file://new-test-inotify.patch \ -" - -SRCREV = "9be6a51d1660991562eefaaddefa757ca0e0e00f" - - -inherit setuptools3 ptest-python-pytest - -RDEPENDS:${PN} += " \ - python3-ctypes \ - python3-logging \ -"