Skip to content

Commit 09ca7cc

Browse files
janjaguschclaude
andcommitted
fix: complete integration test mock infrastructure for dominodatalab
- Add mock endpoint for version-specific PyPI API (/pypi/dominodatalab/2.0.0/json) - Include 'urls' field in main PyPI endpoint for grayskull sdist discovery - Add spdx.org/* to transparent URLs (grayskull license discovery) - Store full PyPI metadata response for reproducible testing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0eff808 commit 09ca7cc

File tree

3 files changed

+151
-2
lines changed

3 files changed

+151
-2
lines changed

tests_integration/lib/_definitions/dominodatalab/__init__.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
from pathlib import Path
23

34
from fastapi import APIRouter
@@ -18,11 +19,25 @@ def get_router(self) -> APIRouter:
1819

1920
@router.get("/pypi.org/pypi/dominodatalab/json")
2021
def handle_pypi_json_api():
22+
# Must include 'urls' with sdist info for grayskull to find the package
2123
return {
22-
# rest omitted
23-
"info": {"name": "dominodatalab", "version": "2.0.0"}
24+
"info": {"name": "dominodatalab", "version": "2.0.0"},
25+
"urls": [
26+
{
27+
"packagetype": "sdist",
28+
"url": "https://files.pythonhosted.org/packages/d8/6d/1e321187451c1cc1670e615497474f9c54f04ad5f4ff7e831ea2dc3eeb23/dominodatalab-2.0.0.tar.gz",
29+
}
30+
],
2431
}
2532

33+
@router.get("/pypi.org/pypi/dominodatalab/2.0.0/json")
34+
def handle_pypi_version_json_api():
35+
return json.loads(
36+
Path(__file__)
37+
.parent.joinpath("pypi_version_json_response.json")
38+
.read_text()
39+
)
40+
2641
return router
2742

2843
def prepare(self, helper: AbstractIntegrationTestHelper):

tests_integration/lib/_definitions/dominodatalab/pypi_version_json_response.json

Lines changed: 133 additions & 0 deletions
Large diffs are not rendered by default.

tests_integration/lib/_shared.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def get_transparent_urls() -> set[str]:
7676
"https://pypi.io/packages/source/*",
7777
"https://pypi.org/packages/source/*",
7878
"https://files.pythonhosted.org/packages/*",
79+
"https://spdx.org/*", # Needed for grayskull license discovery
7980
"https://api.anaconda.org/package/conda-forge/conda-forge-pinning",
8081
"https://api.anaconda.org/download/conda-forge/conda-forge-pinning/*",
8182
"https://binstar-cio-packages-prod.s3.amazonaws.com/*",

0 commit comments

Comments
 (0)