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 1F56E4582E; Wed, 21 Aug 2024 11:17:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D540640E49; Wed, 21 Aug 2024 11:17:23 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mails.dpdk.org (Postfix) with ESMTP id CFABB40E48 for ; Wed, 21 Aug 2024 11:17:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724231842; x=1755767842; h=message-id:date:subject:from:to:cc:references: in-reply-to:content-transfer-encoding:mime-version; bh=RzLxVwaxahyomC5C71lQfWK8GLq+rc0GYL+L3R5KLJI=; b=R1j+fgt57krVkviN0n8SU7o33sS5ALX5jLJRin6XySlbkeZBPo9u2g3V CdSgqL+1CzLYb+H1+84zYkJFT/XP5qRFvWGm16YlJ5Df+P/wh6Btz2j69 dyujrijzQFUcCJ5fV3FEPjFSeXSmAxSr6CY/NZG5Lr2yR3SaD4hay15ss 1YgYYJx/664sXYC59xu43heCW7BRHUyrE1e0xcd/WEwBaNm3d4FCo+WAx aUDCPXy721nynxLv+uvy6U3YPLEnr2K9r0pMoEEvbiVqDeE08+NxbWXIY AOU4HwTiyZXWwUg9kLrSj6A2Np2MJnwown5UIFy4EUFrxBxWGhCMkcl7R w==; X-CSE-ConnectionGUID: EBTkqdDNSBi7ritQr8oslA== X-CSE-MsgGUID: LmIXChyFQXeaOwTaFjdmwg== X-IronPort-AV: E=McAfee;i="6700,10204,11170"; a="22713301" X-IronPort-AV: E=Sophos;i="6.10,164,1719903600"; d="scan'208";a="22713301" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2024 02:16:31 -0700 X-CSE-ConnectionGUID: oMRfoTWcTmyEIJf8O5259Q== X-CSE-MsgGUID: wWh2IOM4SCuwHtHamCzPJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,164,1719903600"; d="scan'208";a="98508028" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Aug 2024 02:16:31 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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:16:30 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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:16:30 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.48) by edgegateway.intel.com (192.55.55.70) 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:16:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fdGTkt/V9n7C1E+QXeQx+4PCSuwxTnUdh37xI8F+IxNHVP4x/iSkVUQJkfBHQt+jR0LEJQvnWtdpX1u3M/bYRrA5ZUbiWS18jg8xYha4YY2+F/3st7WT3VOmxmy5TaqX/+ozKf2EKuR6VIJPxWkJnx9jBJNoYyh9eyULLBp2gMqinBnTz0qaR+mONvuwwd5jex9lpEBcFHM3S3Tp1zMZLHJBA9u2fDU2of4UEUPaDm5u2XYPKlV0T3sjeM/cDH+XXIYc/CZzsFnMHgdxRtrutWOKvH7FH1yKjArbOVbSyLJElB8qXXVPvHkI1Q+kU+R3MPK9f7Y68bJYiuLMRjqFUA== 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=Zws3MQLs5aKZ8h3f3bh03tz3mg9YNBN7n6uIsbhC4N4=; b=o9wvqEDEaaWpH4bnQ7q67lgHmSvzsFJm5xdRr5wySUS7Cg0Wkkm1lTew6l+Lad1f5fISdtwj9fhHTZgSanjwFY67x1Asms7ro5O+Fv15EtA4vQV5mBq2E9afJcA2AAsLp3hnictg5yLvlKQ1Y2tghz7M12suckvffOHO0Lw2pbzYaEViEQH7zLhKomFzlul8sO/ntYMnvatbZRoNximagk0VjUwPdwtxgq93VeF1PnVPa92/FdL1CwIkcvkwG/IuKWwQEIyg7JrPCOOXHVX9hHASkIB97uXu4JjqlwRfwTXFo70F56TmwISSgz6MGcS6Qa9EDj8dAIKctJnpm0TSww== 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 SA1PR11MB6894.namprd11.prod.outlook.com (2603:10b6:806:2b1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Wed, 21 Aug 2024 09:16:28 +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:16:28 +0000 Message-ID: <5f7fcc6e-5e36-47e9-aed7-875a9d44d1e7@intel.com> Date: Wed, 21 Aug 2024 11:16:22 +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: DUZPR01CA0327.eurprd01.prod.exchangelabs.com (2603:10a6:10:4ba::17) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|SA1PR11MB6894:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d413bca-0b10-4a9f-6519-08dcc1c1eff1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?NWJHQk5KTWVpMkNhd2EwRGswVytLVVFrT1Q0MWFnYkY1LzNiUXJ2V1hDUUJX?= =?utf-8?B?V2tWRjR6aUZ0cmdSYUlGR2hGSUR1OHNuY3RjN21SdG1aMG9GMWdlTmVKa2J5?= =?utf-8?B?K3NXeHd0NTVTMlZ6Y0hocGF1S3FBTmYvQXNsNS96WEMvb0I3bjBCdFkxTkln?= =?utf-8?B?ekxKazBscnVlU1pIQ0RwQkNPUjNwSGYxU2RTZWFGMXViZFBlY3NLSnN2V29k?= =?utf-8?B?RVdGTWMrWHZJekZ4SGRad3NNZ0FsZVVRb0d3Smx0RzhUVksyTU9IR1V2L011?= =?utf-8?B?dG5BMWlVMEhTei9rQ1BLUlNPVGdiYVhVb3lZN1NzcVY5UXdDNWZEYWJLdkFQ?= =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kxzQmtMZW1SbUFuV0FX?= =?utf-8?B?cDNWUEdmSTg5djAvdmlCUkVTMWtKdDRQYzMwK2pvb0FBVTRDYi85ZTZ1b2tT?= =?utf-8?B?Q0VyZFozVmdvRjByVStEajgvRnVtUTl6MklmK2tZVTZ2YXlZbUNDUkFadElt?= =?utf-8?B?RFpKbmxhak9NOVpuWUowM2hmLzIvRDdoV0Y4bmo4dnlpQ1BTNjk5cCs3NGxj?= =?utf-8?B?bXp1MmRKck04bzVWbXljVHphZXlXL1Fyc1dWaDUrN09OK09EdkhiT2ExSGpC?= =?utf-8?B?VFRaWnVUcHdRRXMrS3ZGOHBwRWJiMXN1SzI5ZmtIMnRZWmhGam03c2ErNmpK?= =?utf-8?B?NVZMTXhJM3lNbHdxb2FVbVZYTndCaGJ2YmtvQllYRzR4SW4vcWczUDBPRDI5?= =?utf-8?B?ZjZLSDQyNWo5cEtWUDA4QW41Vm53ZnRRMzl2Wmhua3EwMlJ0N0o3WnhIQ3Fq?= =?utf-8?B?OEwwZ1B2NTcxYTc0VnhGKzNTY0xsQTBUU3Z0RWZKTzFIVCtuM2svRjlHMGh4?= =?utf-8?B?REFMV3hTbFo5aWQ5YklQSDZjSkJEVkV1cUZWS2pXUlg3U0FFZkF6RGZ5M2Fh?= =?utf-8?B?dHRWU00yMCtOeG5lektmdz09?= 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)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eVVoK1pDZEJYRUNDRUJndXozR3Jzbll1aTQ1L0lzZ25uVm5mVFhZZjR3Z3lJ?= =?utf-8?B?MEJCa2ZtSEMwQ2ZPN0dQeGRKL0Z6SitnYVBmeWdUeHF5SkV6Mlp5R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VvTHZPa0k0b1BwQkxNeVN6Q0tFd1R5?= =?utf-8?B?REg4SnRGcW9McEJLRE13azh6OGlMbWlyWkZwdEF0Rk9kNGpZcDVmQ3M3S1k1?= =?utf-8?B?NnlQcHYzN0QwRkovaXpSWEc1Q1krS0JhMDdaNjFoRDZjNXlTTU9iODVNOUNE?= =?utf-8?B?d1dENWx2anhWNzlvbDQ3UDdJaWJUM2M4T0lVSmhIdWExMjlNMUlUSVk3bTIz?= =?utf-8?B?ZGttbnViMlIzZkxjRWlNU21ENFJrcmE1MndBM1lHUkMyb1JQVklKVE5pM1NI?= =?utf-8?B?TWc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5d413bca-0b10-4a9f-6519-08dcc1c1eff1 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:16:27.9306 (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: 8oDZrV97ipDhzI7NPC8Vkt/OGVHiNKBHIl3AOCehOInu0w3DXoV54jaYiLqRM0LNzCLzDZKMTsLW57+IIaqgpDDdAYZupIHdWej8+6Dlxfo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6894 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 11:06 AM, Burakov, Anatoly wrote: > 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. Regarding line length, it seems that it's configurable. Perhaps we could include a Ruff/Black configuration file with DPDK to solve this problem once and for all? Adding --line-length=79 to ruff config addresses the last issue, but it wouldn't be necessary if there was a Ruff configuration file in the repo. I can live with first two things that I highlighted. -- Thanks, Anatoly