From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1589008-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id AD1BA15846A for <garchives@archives.gentoo.org>; Wed, 10 Jan 2024 08:02:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9AC3E2A63; Wed, 10 Jan 2024 08:02:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CBB14E2A63 for <gentoo-commits@lists.gentoo.org>; Wed, 10 Jan 2024 08:02:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D784D343283 for <gentoo-commits@lists.gentoo.org>; Wed, 10 Jan 2024 08:02:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 77A2113A0 for <gentoo-commits@lists.gentoo.org>; Wed, 10 Jan 2024 08:02:09 +0000 (UTC) From: "Mike Frysinger" <vapier@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" <vapier@gentoo.org> Message-ID: <1704872543.a172acf0b81a9a1027f1b28cfae5b2ba4f5a32c6.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: lddtree.py pyproject.toml X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: a172acf0b81a9a1027f1b28cfae5b2ba4f5a32c6 X-VCS-Branch: master Date: Wed, 10 Jan 2024 08:02:09 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6e76a3b2-c2e7-42d3-b6da-caf787c8e6fa X-Archives-Hash: c46cf43c9cb91a41dc61bae3395099d8 commit: a172acf0b81a9a1027f1b28cfae5b2ba4f5a32c6 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> AuthorDate: Wed Jan 10 07:42:23 2024 +0000 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> CommitDate: Wed Jan 10 07:42:23 2024 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=a172acf0 pyproject.toml: add black & isort & mypy settings This should help stabilize the tool behavior for different developers. Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> lddtree.py | 4 +++- pyproject.toml | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/lddtree.py b/lddtree.py index b1fef16..3a41886 100755 --- a/lddtree.py +++ b/lddtree.py @@ -49,7 +49,8 @@ import os import re import shutil import sys -from typing import Any, Dict, Iterable, List, Optional, Tuple, Union, cast +from typing import Any, cast, Dict, Iterable, List, Optional, Tuple, Union + assert sys.version_info >= (3, 8), f"Python 3.8+ required, but found {sys.version}" @@ -63,6 +64,7 @@ except ImportError: from elftools.common import exceptions # type: ignore from elftools.elf.elffile import ELFFile # type: ignore + # pylint: enable=import-error diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ab0fde0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,42 @@ +# Copyright 2024 Gentoo Foundation +# Copyright 2024 Mike Frysinger <vapier@gentoo.org> +# Copyright 2024 The ChromiumOS Authors +# Distributed under the terms of the GNU General Public License v2 + +# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/ + + +# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html +[tool.black] +line-length = 88 +target-version = ["py38"] + + +# https://pycqa.github.io/isort/docs/configuration/options +[tool.isort] +py_version = "38" + +# Be compatible with `black` since it also matches what we want. +profile = "black" + +line_length = 88 +length_sort = false +force_single_line = true +lines_after_imports = 2 +from_first = false +case_sensitive = false +force_sort_within_sections = true +order_by_type = false + +# Allow importing multiple classes on a single line from these modules. +# https://google.github.io/styleguide/pyguide#s2.2-imports +single_line_exclusions = [ + "abc", + "collections.abc", + "typing", +] + + +# https://mypy.readthedocs.io/en/stable/config_file.html +[tool.mypy] +python_version = "3.8"