From 6165227b7aff8d2de11182e69862699c13442a42 Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Wed, 25 Oct 2023 15:01:28 +0200 Subject: [PATCH] Update linters --- .pre-commit-config.yaml | 8 ++++---- boa/cli/boa.py | 1 - boa/cli/convert.py | 1 - boa/core/build.py | 3 --- boa/core/metadata.py | 2 -- boa/core/recipe_output.py | 1 - boa/core/run_build.py | 3 +-- boa/core/variant_arithmetic.py | 1 - boa/schemas/model.py | 1 - tests/test_rendering.py | 2 -- 10 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d6a1b0a..db72d442 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,16 @@ repos: - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.10.1 hooks: - id: black args: [--safe, --quiet] - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.16.0 hooks: - id: blacken-docs additional_dependencies: [black==22.3.0] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -20,7 +20,7 @@ repos: # - id: isort # exclude: tests/data - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 args: diff --git a/boa/cli/boa.py b/boa/cli/boa.py index 8bdde00f..b10a1bf9 100644 --- a/boa/cli/boa.py +++ b/boa/cli/boa.py @@ -26,7 +26,6 @@ def main(config=None): - parser = argparse.ArgumentParser( description="Boa, the fast, mamba powered-build tool for conda packages." ) diff --git a/boa/cli/convert.py b/boa/cli/convert.py index d82272f4..d3d29b8f 100644 --- a/boa/cli/convert.py +++ b/boa/cli/convert.py @@ -43,7 +43,6 @@ def order_output_dict(d): def main(docname): - with open(docname, "r") as fi: lines = fi.readlines() context = {} diff --git a/boa/core/build.py b/boa/core/build.py index 5c7ac7f4..26ee620a 100644 --- a/boa/core/build.py +++ b/boa/core/build.py @@ -237,7 +237,6 @@ def select_files(files, include_files, exclude_files): def bundle_conda(metadata, initial_files, env, files_selector=None): - files = post_process_files(metadata, initial_files) # first filter is so that info_files does not pick up ignored files @@ -374,7 +373,6 @@ def bundle_conda(metadata, initial_files, env, files_selector=None): def write_build_scripts(m, script, build_file): - with utils.path_prepended(m.config.host_prefix): with utils.path_prepended(m.config.build_prefix): env = environ.get_dict(m=m) @@ -467,7 +465,6 @@ def write_build_scripts(m, script, build_file): def execute_build_script(m, src_dir, env, provision_only=False): - script_list = utils.ensure_list(m.get_value("build/script", None)) if script_list: script = "\n".join(script_list) diff --git a/boa/core/metadata.py b/boa/core/metadata.py index ac5fc204..ecf92145 100644 --- a/boa/core/metadata.py +++ b/boa/core/metadata.py @@ -51,7 +51,6 @@ def build_string_from_metadata(metadata): ("mro", "mro-base", 3), ("mro", "mro-base_impl", 3), ): - for ms in metadata.ms_depends("run"): for name in ensure_list(names): if ms.name == name and name in build_pkg_names: @@ -97,7 +96,6 @@ def build_string_from_metadata(metadata): class MetaData: - path: str uses_new_style_compiler_activation: bool = False uses_vcs_in_meta: bool = False diff --git a/boa/core/recipe_output.py b/boa/core/recipe_output.py index 6fbeeff8..7d28d14a 100644 --- a/boa/core/recipe_output.py +++ b/boa/core/recipe_output.py @@ -590,7 +590,6 @@ def set_final_build_id(self, meta, all_outputs): self.data["build"]["run_exports"] = final_run_exports or None def finalize_solve(self, all_outputs): - self._solve_env("build", all_outputs) self._solve_env("host", all_outputs) self._solve_env("run", all_outputs) diff --git a/boa/core/run_build.py b/boa/core/run_build.py index ba535e4e..b80691dc 100644 --- a/boa/core/run_build.py +++ b/boa/core/run_build.py @@ -112,7 +112,7 @@ def recursive_add(target): sorted_recipes = toposort.toposort(sort_recipes) num_recipes = len(sorted_recipes) - console.print(f"Found {num_recipes} recipe{'s'[:num_recipes^1]}") + console.print(f"Found {num_recipes} recipe{'s'[:num_recipes ^ 1]}") for rec in sorted_recipes: console.print(f" - {rec}") @@ -198,7 +198,6 @@ def build_recipe( rerun_build: bool = False, pyproject_recipes=False, ): - ydoc = render(recipe_path, config=config, is_pyproject_recipe=pyproject_recipes) # We need to assemble the variants for each output variants = {} diff --git a/boa/core/variant_arithmetic.py b/boa/core/variant_arithmetic.py index 885fc487..c1d8b226 100644 --- a/boa/core/variant_arithmetic.py +++ b/boa/core/variant_arithmetic.py @@ -121,7 +121,6 @@ def get_dependency_variants(variant_keys, conda_build_config, config): def apply_variants(output, variants, cbc): - final_outputs = [] # this is all a bit hacky ... will have to clean that up eventually diff --git a/boa/schemas/model.py b/boa/schemas/model.py index 09aafc11..6f63be30 100644 --- a/boa/schemas/model.py +++ b/boa/schemas/model.py @@ -214,7 +214,6 @@ class Config: class About(BaseModel): - # URLs home: Optional[str] = None dev_url: Optional[str] = None diff --git a/tests/test_rendering.py b/tests/test_rendering.py index d4dbfece..c3400865 100644 --- a/tests/test_rendering.py +++ b/tests/test_rendering.py @@ -63,7 +63,6 @@ def get_outputs( def test_variants_zipping(): - cbc, sorted_outputs = get_outputs("cbc1.yaml") assert cbc == { "python": ["3.6", "3.7", "3.8"], @@ -217,7 +216,6 @@ def test_compiler(): def call_render(recipe): - os.chdir(recipe.parent) print(["boa", "render", str(recipe.resolve()), "--json"])