diff --git a/whey_conda/__init__.py b/whey_conda/__init__.py index cfa5ec1..c99d39f 100644 --- a/whey_conda/__init__.py +++ b/whey_conda/__init__.py @@ -56,7 +56,7 @@ # this package from whey_conda.config import WheyCondaParser -__all__ = ["CondaBuilder"] +__all__ = ("CondaBuilder", ) __author__: str = "Dominic Davis-Foster" __copyright__: str = "2020-2021 Dominic Davis-Foster" @@ -187,6 +187,7 @@ def write_conda_about(self) -> None: about = {} + # pylint: disable=loop-invariant-statement for category, url in self.config["urls"].items(): if category.lower() in {"homepage", "home page"}: about["home"] = url @@ -212,6 +213,7 @@ def write_conda_about(self) -> None: author = [] maintainer = [] + # pylint: disable=use-list-comprehension for entry in self.config["authors"]: if entry["name"]: author.append(entry["name"]) @@ -225,6 +227,8 @@ def write_conda_about(self) -> None: elif author: about["extra"] = {"maintainers": author} + # pylint: enable=loop-invariant-statement,use-list-comprehension + about_json_file = self.info_dir / "about.json" about_json_file.dump_json(about, indent=2) self.report_written(about_json_file) @@ -275,7 +279,7 @@ def create_conda_archive(self, wheel_contents_dir: PathLike, build_number: int = # Ensure the digest and size are updated for "conda" rather than "pip" if ".dist-info/INSTALLER,sha256=" in line: record_lines[idx] = get_record_entry( - dist_info_dir / "INSTALLER", + dist_info_dir / "INSTALLER", # pylint: disable=loop-invariant-statement relative_to=wheel_contents_dir, ) elif ".dist-info/direct_url.json,sha256=" in line: @@ -286,7 +290,7 @@ def create_conda_archive(self, wheel_contents_dir: PathLike, build_number: int = # Remove double blank line caused by removal of entries file.write_clean('\n'.join(record_lines).replace("\n\n", '\n')) - elif file.name in {"REQUESTED", "direct_url.json"}: + elif file.name in {"REQUESTED", "direct_url.json"}: # pylint: disable=loop-invariant-statement continue if file.is_file(): @@ -385,6 +389,7 @@ def build_conda(self) -> str: def pip_install_wheel(wheel_file: PathLike, target_dir: PathLike, verbose: bool = False) -> None: + # pylint: disable=use-tuple-over-list command = [ "pip", "install", @@ -397,6 +402,7 @@ def pip_install_wheel(wheel_file: PathLike, target_dir: PathLike, verbose: bool "--no-warn-conflicts", "--disable-pip-version-check", ] + # pylint: enable=use-tuple-over-list process = Popen(command, stdout=PIPE) (output, err) = process.communicate() diff --git a/whey_conda/config.py b/whey_conda/config.py index 2e826d4..c2d4e1b 100644 --- a/whey_conda/config.py +++ b/whey_conda/config.py @@ -33,7 +33,7 @@ from dom_toml.parser import TOML_TYPES, AbstractConfigParser, BadConfigError, construct_path from typing_extensions import Literal -__all__ = ["WheyCondaParser"] +__all__ = ("WheyCondaParser", ) class WheyCondaParser(AbstractConfigParser): @@ -124,7 +124,7 @@ def parse_conda_extras( extras = config["conda-extras"] - path_elements = [*self.table_name, "conda-extras"] + path_elements = [*self.table_name, "conda-extras"] # pylint: disable=use-tuple-over-list if isinstance(extras, str): extras_lower = extras.lower()