Skip to content

Commit

Permalink
Replace remaining pypi.io with pypi.org (conda#556)
Browse files Browse the repository at this point in the history
Official domain is pypi.org

Also changed some variable names to make flake8 happy about line length
  • Loading branch information
beenje authored Sep 4, 2024
1 parent c4d2bf9 commit 83d7b07
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/test_py_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,29 +125,29 @@ def test_get_sdist_metadata_packages_top_level():
# This package only includes a pyproject.toml (no setup.py)
# As setuptools is used, the module name can be retrieved
# from top_level.txt in the sdist
pkg_name = "tangods-achtung"
pkg_name_nor = pkg_name.replace("-", "_")
name = "tangods-achtung"
name_nor = name.replace("-", "_")
pkg_ver = "0.11.1"
sdist_metadata = get_sdist_metadata(
f"https://pypi.io/packages/source/t/{pkg_name}/{pkg_name_nor}-{pkg_ver}.tar.gz",
Configuration(name=pkg_name, version=pkg_ver),
f"https://pypi.org/packages/source/t/{name}/{name_nor}-{pkg_ver}.tar.gz",
Configuration(name=name, version=pkg_ver),
)
assert sdist_metadata["name"] == pkg_name
assert sdist_metadata["name"] == name
assert sdist_metadata["packages"] == ["achtung"]


def test_get_sdist_metadata_no_top_level():
"""Regression test when top_level.txt doesn't exist"""
# This package only includes a pyproject.toml (no setup.py)
# As hatchling is used, there is no top_level.txt file
pkg_name = "gidgetlab-kit"
pkg_name_nor = pkg_name.replace("-", "_")
name = "gidgetlab-kit"
name_nor = name.replace("-", "_")
pkg_ver = "0.7.2"
sdist_metadata = get_sdist_metadata(
f"https://pypi.io/packages/source/g/{pkg_name}/{pkg_name_nor}-{pkg_ver}.tar.gz",
Configuration(name=pkg_name, version=pkg_ver),
f"https://pypi.org/packages/source/g/{name}/{name_nor}-{pkg_ver}.tar.gz",
Configuration(name=name, version=pkg_ver),
)
assert sdist_metadata["name"] == pkg_name
assert sdist_metadata["name"] == name
# No solution to retrieve packages for now
assert sdist_metadata.get("packages") is None

Expand Down

0 comments on commit 83d7b07

Please sign in to comment.