diff --git a/conda_smithy/azure_ci_utils.py b/conda_smithy/azure_ci_utils.py index 17aeb526f..4f8feaa3f 100644 --- a/conda_smithy/azure_ci_utils.py +++ b/conda_smithy/azure_ci_utils.py @@ -6,6 +6,7 @@ from vsts.build.v4_1.models import ( BuildDefinition, BuildDefinitionReference, + BuildRepository, SourceRepositories, SourceRepository, ) @@ -133,12 +134,6 @@ def get_default_build_definition( ): import inspect - from vsts.build.v4_1.models import ( - BuildDefinition, - BuildRepository, - ) - from vsts.task_agent.v4_0.task_agent_client import TaskAgentClient - aclient = TaskAgentClient(config.instance_base_url, config.credentials) source_repo = get_repo_reference(config, github_org, repo_name) @@ -213,8 +208,6 @@ def get_default_build_definition( def register_repo(github_org, repo_name, config: AzureConfig = default_config): - from vsts.build.v4_1.models import BuildDefinitionReference - bclient = build_client() build_definition = get_default_build_definition( github_org, diff --git a/conda_smithy/cli.py b/conda_smithy/cli.py index 266c8eda8..5427f2ba1 100644 --- a/conda_smithy/cli.py +++ b/conda_smithy/cli.py @@ -48,8 +48,6 @@ def generate_feedstock_content( try: configure_feedstock.copytree(source_recipe_dir, target_recipe_dir) except Exception as e: - import sys - raise type(e)( str(e) + f" while copying file {source_recipe_dir}" ).with_traceback(sys.exc_info()[2]) @@ -570,7 +568,7 @@ class Regenerate(Subcommand): def __init__(self, parser): super().__init__( parser, - "Regenerate / update the CI support files of the " "feedstock.", + "Regenerate / update the CI support files of the feedstock.", ) scp = self.subcommand_parser scp.add_argument( diff --git a/conda_smithy/configure_feedstock.py b/conda_smithy/configure_feedstock.py index a0878e172..a9fb80d8a 100644 --- a/conda_smithy/configure_feedstock.py +++ b/conda_smithy/configure_feedstock.py @@ -819,7 +819,7 @@ def _collapse_subpackage_variants( def _is_config_skipped(config, top_level_loop_vars, list_of_metas): trimmed_config = {loop_var: config[loop_var] for loop_var in top_level_loop_vars} logger.debug("checking config: %s", trimmed_config) - for i, meta in enumerate(list_of_metas): + for meta in list_of_metas: trimmed_meta = { loop_var: meta.config.variant.get(loop_var) for loop_var in top_level_loop_vars @@ -2271,7 +2271,7 @@ def render_readme(jinja_env, forge_config, forge_dir, render_info=None): # align new style about with old style about logger.debug("subpackages_about\n %s", pprint.pformat(subpackages_about)) - for i, (name, about) in enumerate(subpackages_about): + for name, about in subpackages_about: if "repository" in about: about["dev_url"] = about["repository"] if "homepage" in about: diff --git a/conda_smithy/feedstock_tokens.py b/conda_smithy/feedstock_tokens.py index 59b40b130..8352bf90b 100644 --- a/conda_smithy/feedstock_tokens.py +++ b/conda_smithy/feedstock_tokens.py @@ -738,10 +738,7 @@ def add_feedstock_token_to_azure(user, project, feedstock_token, clobber): else: variables = ed.variables - if "FEEDSTOCK_TOKEN" in variables: - have_feedstock_token = True - else: - have_feedstock_token = False + have_feedstock_token = "FEEDSTOCK_TOKEN" in variables if not have_feedstock_token or (have_feedstock_token and clobber): variables["FEEDSTOCK_TOKEN"] = BuildDefinitionVariable( diff --git a/news/2518-pylint-finds.rst b/news/2518-pylint-finds.rst new file mode 100644 index 000000000..607890684 --- /dev/null +++ b/news/2518-pylint-finds.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Small code improvements as pointed out by pylint. (#2518) + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*