Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 24, 2024
1 parent d558699 commit 0d1a1cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion grayskull/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 14 additions & 6 deletions grayskull/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0d1a1cc

Please sign in to comment.