From 057dff660555a1a849c4256ba4792697842b0d75 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 10 Apr 2023 13:35:48 -0700 Subject: [PATCH 1/2] Use `{{ name }}` in filename too Since `{{ name }}` is already templated elsewhere, template it in the filename of the archive too for consistency. --- grayskull/strategy/pypi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grayskull/strategy/pypi.py b/grayskull/strategy/pypi.py index a38dc9012..b027d58a8 100644 --- a/grayskull/strategy/pypi.py +++ b/grayskull/strategy/pypi.py @@ -132,8 +132,9 @@ def get_url_filename(metadata: dict, default: Optional[str] = None) -> str: for pkg_url in metadata["urls"]: if pkg_url["packagetype"] == "sdist": + name = metadata["info"]["name"] version = metadata["info"]["version"] - return pkg_url["filename"].replace(version, "{{ version }}") + return pkg_url["filename"].replace(name, "{{ name }}").replace(version, "{{ version }}") return default From 032d7745f451b71f19e1e0b0c11ca72cbc7c341f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 20:36:49 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- grayskull/strategy/pypi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grayskull/strategy/pypi.py b/grayskull/strategy/pypi.py index b027d58a8..1f806da77 100644 --- a/grayskull/strategy/pypi.py +++ b/grayskull/strategy/pypi.py @@ -134,7 +134,11 @@ def get_url_filename(metadata: dict, default: Optional[str] = None) -> str: if pkg_url["packagetype"] == "sdist": name = metadata["info"]["name"] version = metadata["info"]["version"] - return pkg_url["filename"].replace(name, "{{ name }}").replace(version, "{{ version }}") + return ( + pkg_url["filename"] + .replace(name, "{{ name }}") + .replace(version, "{{ version }}") + ) return default