Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flawed conda-forge-only meta.yaml lint #1 (already-exists lint): Multiple PyPI sources #1905

Open
ytausch opened this issue Apr 5, 2024 · 0 comments
Labels

Comments

@ytausch
Copy link
Contributor

ytausch commented Apr 5, 2024

Comment:

This lint may behave unexpectedly if a conda recipe specifies multiple URL sources starting with a https://pypi.io prefix since only the last one is considered.

url = None
for source_section in sources_section:
if str(source_section.get("url")).startswith(
"https://pypi.io/packages/source/"
):
url = source_section["url"]
if url:
# get pypi name from urls like "https://pypi.io/packages/source/b/build/build-0.4.0.tar.gz"
pypi_name = url.split("/")[6]
mapping_request = requests.get(
"https://raw.githubusercontent.com/regro/cf-graph-countyfair/master/mappings/pypi/name_mapping.yaml"
)
if mapping_request.status_code == 200:
mapping_raw_yaml = mapping_request.content
mapping = get_yaml().load(mapping_raw_yaml)
for pkg in mapping:
if pkg.get("pypi_name", "") == pypi_name:
conda_name = pkg["conda_name"]
hints.append(
f"A conda package with same name ({conda_name}) already exists."
)

ytausch added a commit to ytausch/conda-smithy that referenced this issue Apr 5, 2024
ytausch added a commit to ytausch/conda-smithy that referenced this issue Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant