From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14EFD4582E; Wed, 21 Aug 2024 11:06:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D1C940395; Wed, 21 Aug 2024 11:06:22 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 5285A4003C for ; Wed, 21 Aug 2024 11:06:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724231181; x=1755767181; h=message-id:date:subject:from:to:cc:references: in-reply-to:content-transfer-encoding:mime-version; bh=yrN/z8A0zYGz0Lc5JhA4oPBBNYUifVgrSKsmlhrehGA=; b=jFmKwJ2iJT95WhcHu+5yJ6JzH7cV1BMEjSw92g0Q8DvrmO0aFnGTyE1H 7ZMJ0tPCRKPW8mKnWWMcxyCby0QEzfRZMdSlBqkzi2t9hqACK782zyu2O Q3ipPWWi5LkODPjKwmUGuXWilGpQpEZ0kcTnTJlJy+lnCytMqK8/k6alH tmntzb0WvphMrCsnD0kq54Y76fq75IjdDc/O/kmslff9VtbZKFeXM3Tl9 nLxbgmt0Sual6CREQiwnTkviUbCRN/JjTuDkfcWeCDeIFr/djwM//m5iX SwDlGVtT2+PG3pliMLnM/RpZiJs2/ojW8endlh9h7mqTXb5dUu90vrgEo Q==; X-CSE-ConnectionGUID: EAQk8WjMSMaFxSnn7T8dYQ== X-CSE-MsgGUID: VwztNpG6TiuDXxjYKFxf5w== X-IronPort-AV: E=McAfee;i="6700,10204,11170"; a="45104574" X-IronPort-AV: E=Sophos;i="6.10,164,1719903600"; d="scan'208";a="45104574" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2024 02:06:19 -0700 X-CSE-ConnectionGUID: DAl5eqorT3iqK4kgpv6Blw== X-CSE-MsgGUID: SvOs4AGcR8K4rWSz2tbZOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,164,1719903600"; d="scan'208";a="91816392" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Aug 2024 02:06:18 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 02:06:18 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 02:06:17 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 21 Aug 2024 02:06:17 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 21 Aug 2024 02:06:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UQvtoaNExw0aF8UpDI7IHGubUnIxtaB59LQzRkHCaEM+lrhd7jiUaDnieBI5sRMa1A3fAX60isedCqVR+xZLlJaUoYDlkYbyF9fqvprdKWu+97A7ZUZ2z3T2k7yyASdoKicsrswiQyyhyGqByr0VSMFH/zsy4KSA8xwhSH5Hnqf7BacGE34TNwejLhIyIjNXhPbNDKDXV++pp4R48rqOX5Mpb6aWqo599ukILqG1WR7yqiMnm5aDDyeSEqyTn1vkKUtxTrSrJBya2uag+gDHVTjfHh5iLEiaQj/z3s7mxAAAkRofhRrcx3uZQl2B7jLjoCb23aIpJLUOFFq6JLl8ug== 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=vmWfHKkqCvvZp7F9gFT+bAkeZSXBmAIITSQ6rfk6QKA=; b=SvkotZFndduFEFUSjJidNy15O/CVcSszD03I9DTqR8Cf8jgXyr7kKtSEQzlPutVHQ9Zy6oE7LOQO+uyJ53WW1X4biBWZj/7VhseyVRl+2mrmF9/CuJ6afjYLqQ6rDDTPwGof24LefWX5VEo+EfdYWETNwZnIXjTygQHodVoFGmVBf3ff5h2zOqBNgDFbCdNNemVu4BSx6x12N5+MjS7qqYDVqNPg9gX4lY+u1TAJdWYCqQJjzWveED79mmdXdtUfAvHAUW8/ZJhxthn1jTihl9th9JhkXTgTjxesCENTGdRd10j9U3Owz8BQVVjkocKqfjsHIzqYiLSVSQ23UixqZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by DS7PR11MB7834.namprd11.prod.outlook.com (2603:10b6:8:ed::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.26; Wed, 21 Aug 2024 09:06:16 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a%4]) with mapi id 15.20.7897.014; Wed, 21 Aug 2024 09:06:15 +0000 Message-ID: Date: Wed, 21 Aug 2024 11:06:10 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/4] usertools/dpdk-hugepages.py: update coding style From: "Burakov, Anatoly" To: Robin Jarry , CC: References: <1c9f589c434cfb91c53dae7528cfc165c976b0c6.1724168117.git.anatoly.burakov@intel.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DUZPR01CA0098.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::29) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|DS7PR11MB7834:EE_ X-MS-Office365-Filtering-Correlation-Id: c6c95f5f-290e-444a-b341-08dcc1c0831c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZXZWQUVBV3NINXRHZGVjeDlOTDgrWjZzU25ZOFRadml6S0w1ZHdLZm1ETWR6?= =?utf-8?B?Snltdkp4ZHR5OEsxbFFRRUVsWmRueXFxMEpvZG1HTzhTaHYrWUhnYU9mK3F4?= =?utf-8?B?bkRZUXB4WVhVWTFsV01oRVNSQ21mOE1Cd2liUis2KzU1R0xiMlE0M0pvOTBw?= =?utf-8?B?RVN6c0lQcHRGNlpVdXQ2SGNWWXRvK3hac0VYVzlwK1lLMlhwYnRDOFpWWGhH?= =?utf-8?B?SGY2QzVFMHBUaC9iUVFUSUtj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WUtIUnVxdnE1aERON2lCS3BPdmJYYWI5QS9TR01PRW45UTA2?= =?utf-8?B?cndYS2VaUFo3QlFXVzZZS1JGQjFoMHZwMDJaUEdqS0dsUU1OYVplc1FQSkJi?= =?utf-8?B?VGJHUjl5Z2VHS1R6a1Z2OHNreDgva2RrQm9FM2lDalVnUEduWEpOK1lOSzJ2?= =?utf-8?B?NlNVQUc4WThMcmJGblZaZnJIdXVMQkVKcVNkeTVRQ0xYM1pSMGFMY2JaS0Rx?= =?utf-8?B?VG9uWExtZWZWSWt0ZkRHOTdnT1FrNmxuRWF5Q1JLNTVwejBaek5wVUNGWTZ1?= =?utf-8?B?SGswUEpmWVQwSkdUY2pnRjNuaS94SDlZQm9zY3F4Ti9ybTJRaGNJenFjeXRF?= =?utf-8?B?YWlNN3lVTlFHWTBONHhpYVY1L1oyTFB1N01rZzljYVdCZ1BBSnZlcXd0b08w?= =?utf-8?B?alJvTEsvWENoRHVxSUNTbHdrNmtTNVRDa2RZU3l1TDNiZlRVSFFvNWxFaXRo?= =?utf-8?B?dVlhSEE5c29ON2ptL2Y1d3JiRlJOd256cm51ZzV2VFRpUXJNdWgzOEYxVm1k?= =?utf-8?B?TytBdC8yRHVDNHdUelZCYzhMWFEwQ20vM1FhRnNTRUdrcWVvUFZrbmE2eWZP?= =?utf-8?B?MFZVL2FQSmZKN0ZzOGluaU56STRlWm9CT3Z1Nm5DVy9FcXdTTC9XOWhTK21I?= =?utf-8?B?dHhFM1ZBVUFpNTdqaWZUUT09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZXdGQ1A0b0lxYTdPUTZDOG50czh4THA3YkVHQjg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=?utf-8?B?SjMrbm95akZaVlhNU1VWTGo3bU5qSmRod2xyaUpScCs4MGVaUmJXMHZSK0o1?= =?utf-8?B?d1VMSG5uTkRPOTdpOCtrQU8wajVvNnI3WE9YdEt6V3ROZXFCS3V2MGovMWEr?= =?utf-8?B?ZzQ5SVc1TThPb0xqc3pXNzBYemdUVEVkRkF5UUNseCtOSjliTFdyT1pwa05j?= =?utf-8?B?ck9GSXBTTm5ZWVFISVhGSDZhUk10MEMxMThXQzlXZzRMa0lTU3Yyd1lZN0pQ?= =?utf-8?B?RHFVVWZpd040MVFlMGxrdThGRmNMZGVSK3RzR2l3VGQ2SVFkZlp5YllBeGNP?= =?utf-8?B?NEZKZ3pTQjhUSzFzTEtCeVptUU1lQXNqcTBEOE9jTnNMRWZ0dHQveWFmQnFn?= =?utf-8?B?b1E9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: c6c95f5f-290e-444a-b341-08dcc1c0831c X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 09:06:15.8328 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E7/0IHVkeHMRz8rSQtnQ+7qqivCPeikI7djNk1Fu5jsfxa1zCcotAfcYc1RWO1VC21hpXfhrIIsWf/QZpob7q6VB1+GHdDnyl76TXTwv2sg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7834 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 8/21/2024 10:52 AM, Burakov, Anatoly wrote: > On 8/20/2024 5:57 PM, Robin Jarry wrote: >> Anatoly Burakov, Aug 20, 2024 at 17:35: >>> Update coding style: >>> >>> - Make the code PEP-484 compliant >>> - Add more comments, improve readability, use f-strings everywhere >>> - Use quotes consistently >>> - Address all Python static analysis (e.g. mypy, pylint) warnings >>> - Improve error handling >>> - Refactor printing and sysfs/procfs access functions >>> - Sort output by NUMA node >>> >>> Signed-off-by: Anatoly Burakov >>> --- >>> >>> Notes: >>>     v1 -> v2: >>>       - Added commit that sorted output by NUMA node >>>     v2 -> v3: >>>       - Rewrite of the script as suggested by reviewers >> >> Instead of debating about coding style. I'd like to enforce black/ruff >> for new scripts and/or rewrites. >> >> The code looks good to me, but could you pass through one of these >> tools and send a v4? >> >>     black usertools/dpdk-hugepages.py >> >> or >> >>     ruff format usertools/dpdk-hugepages.py >> >> I think they output the exact same code formatting but I could be wrong. >> > > Hi, > > My IDE is already set up to auto-format with Ruff since our last > conversation, so this is already formatted. I ran ruff format command > just in case but it produced no changes. > > So, no v4 necessary unless you think there are any changes to be made > about the code :) > Actually, I take that back - I had a configuration mishap and didn't notice that I wasn't using Ruff for formatting on the machine I was creating the commits. Still, cpu_layout's formatting is not affected, but hugepage script is. However, after formatting with ruff, I can see that 1) most single quotes became double quotes, 2) some lines I broke up for readability, are no longer broken up, and 3) some lines I broke up to avoid exceeding the 80 symbols count, are no longer broken up. I'll see if using Black yields different results. -- Thanks, Anatoly