From 0d1a1cc7283dec8e5a53663506f3b919a1ccce44 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 May 2024 19:32:29 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- grayskull/config.py | 4 +++- grayskull/main.py | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/grayskull/config.py b/grayskull/config.py index d0068a03f..e9df19ca3 100644 --- a/grayskull/config.py +++ b/grayskull/config.py @@ -108,7 +108,9 @@ def get_py_version_available( def __post_init__(self): if not self.url_pypi_metadata.endswith("/{pkg_name}/json"): - self.url_pypi_metadata = self.url_pypi_metadata.rstrip("/") + "/{pkg_name}/json" + self.url_pypi_metadata = ( + self.url_pypi_metadata.rstrip("/") + "/{pkg_name}/json" + ) if self.from_local_sdist: self.local_sdist = self.local_sdist or self.name pkg_repo, pkg_name, pkg_version = parse_pkg_name_version(self.name) diff --git a/grayskull/main.py b/grayskull/main.py index 1cf9c31e3..dbef4143c 100644 --- a/grayskull/main.py +++ b/grayskull/main.py @@ -312,20 +312,28 @@ def generate_recipes_from_list(list_pkgs, args): try: # TODO: Remove before 3.0 release if args.url_pypi_metadata_deprecated and args.url_pypi_metadata: - raise RuntimeError("--pypi-url is deprecated in favor of --pypi-url-metadata and may not be passed in conjunction with --pypi-url-metadata") + raise RuntimeError( + "--pypi-url is deprecated in favor of --pypi-url-metadata and may not be passed in conjunction with --pypi-url-metadata" + ) # TODO: Remove before 3.0 release if args.url_pypi_metadata_deprecated is not None: - logging.warning("--pypi-url is deprecated; use --pypi-url-metadata instead") + logging.warning( + "--pypi-url is deprecated; use --pypi-url-metadata instead" + ) args.url_pypi_metadata = args.url_pypi_metadata_deprecated - + # If a PYPI mirror is selected, but the metadata URL is not # explicitly passed, assume the mirror can handle the standard # metadata endpoint and coerce the metadata URL appropriately in a # way that respects the DEFAULT settings from config. - if (args.url_pypi_mirror.rstrip("/") != DEFAULT_PYPI_URL) and (args.url_pypi_metadata.rstrip("/") == DEFAULT_PYPI_META_URL): - args.url_pypi_metadata = DEFAULT_PYPI_META_URL.replace(DEFAULT_PYPI_URL, args.url_pypi_mirror.rstrip("/")) - + if (args.url_pypi_mirror.rstrip("/") != DEFAULT_PYPI_URL) and ( + args.url_pypi_metadata.rstrip("/") == DEFAULT_PYPI_META_URL + ): + args.url_pypi_metadata = DEFAULT_PYPI_META_URL.replace( + DEFAULT_PYPI_URL, args.url_pypi_mirror.rstrip("/") + ) + recipe, config = create_python_recipe( pkg_name, is_strict_cf=args.is_strict_conda_forge,