portolan-python 0.1.7__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {portolan_python-0.1.7 → portolan_python-0.1.8}/.coverage +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/PKG-INFO +1 -1
- {portolan_python-0.1.7 → portolan_python-0.1.8}/docs/distribution.md +4 -4
- {portolan_python-0.1.7 → portolan_python-0.1.8}/docs/examples.md +2 -2
- {portolan_python-0.1.7 → portolan_python-0.1.8}/pyproject.toml +1 -1
- {portolan_python-0.1.7 → portolan_python-0.1.8}/src/portolan/registry.py +9 -1
- {portolan_python-0.1.7 → portolan_python-0.1.8}/tests/test_registry_api.py +6 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/uv.lock +1 -1
- {portolan_python-0.1.7 → portolan_python-0.1.8}/.github/workflows/release.yml +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/.gitignore +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/Makefile +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/README.md +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/docs/development.md +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/docs/scope.md +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/src/portolan/__init__.py +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/src/portolan/catalog.py +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/src/portolan/py.typed +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/src/portolan/validation.py +0 -0
- {portolan_python-0.1.7 → portolan_python-0.1.8}/tests/test_catalog_api.py +0 -0
|
Binary file
|
|
@@ -8,8 +8,8 @@ preferred package index for published versions.
|
|
|
8
8
|
Push a tag that matches the version in `pyproject.toml`:
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
git tag v0.1.
|
|
12
|
-
git push origin v0.1.
|
|
11
|
+
git tag v0.1.8
|
|
12
|
+
git push origin v0.1.8
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The release workflow runs the tests, builds both distributions, checks their
|
|
@@ -25,7 +25,7 @@ Install the wheel attached to a release:
|
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
python -m pip install \
|
|
28
|
-
https://github.com/jemacchi/portolan-python/releases/download/v0.1.
|
|
28
|
+
https://github.com/jemacchi/portolan-python/releases/download/v0.1.8/portolan_python-0.1.8-py3-none-any.whl
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
This path needs no package index account.
|
|
@@ -35,7 +35,7 @@ This path needs no package index account.
|
|
|
35
35
|
Install a published version from PyPI with:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
python -m pip install portolan-python==0.1.
|
|
38
|
+
python -m pip install portolan-python==0.1.8
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Omit the version constraint to install the latest published version.
|
|
@@ -10,14 +10,14 @@ GitHub:
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
python -m pip install \
|
|
13
|
-
https://github.com/jemacchi/portolan-python/releases/download/v0.1.
|
|
13
|
+
https://github.com/jemacchi/portolan-python/releases/download/v0.1.8/portolan_python-0.1.8-py3-none-any.whl
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
You can also install the source at a specific tag:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
python -m pip install \
|
|
20
|
-
"portolan-python @ git+https://github.com/jemacchi/portolan-python.git@v0.1.
|
|
20
|
+
"portolan-python @ git+https://github.com/jemacchi/portolan-python.git@v0.1.8"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## List collections and assets
|
|
@@ -61,6 +61,9 @@ def load_registry_entries(
|
|
|
61
61
|
registry_id = link.get("portolan_registry:id")
|
|
62
62
|
if not isinstance(href, str) or not isinstance(registry_id, str):
|
|
63
63
|
continue
|
|
64
|
+
resolved_url = urljoin(registry_url, href)
|
|
65
|
+
if not _is_remote_url(resolved_url):
|
|
66
|
+
continue
|
|
64
67
|
status = link.get("portolan_registry:status")
|
|
65
68
|
if status != "valid" and not include_stale:
|
|
66
69
|
continue
|
|
@@ -72,7 +75,7 @@ def load_registry_entries(
|
|
|
72
75
|
entries.append(
|
|
73
76
|
RegistryCatalogEntry(
|
|
74
77
|
id=registry_id,
|
|
75
|
-
url=
|
|
78
|
+
url=resolved_url,
|
|
76
79
|
title=title if isinstance(title, str) else None,
|
|
77
80
|
status=status if isinstance(status, str) else None,
|
|
78
81
|
bbox=_horizontal_bbox(link.get("bbox")),
|
|
@@ -114,6 +117,11 @@ def _horizontal_bbox(value: object) -> tuple[float, float, float, float] | None:
|
|
|
114
117
|
return (float(value[0]), float(value[1]), float(value[half]), float(value[half + 1]))
|
|
115
118
|
|
|
116
119
|
|
|
120
|
+
def _is_remote_url(url: str) -> bool:
|
|
121
|
+
parsed = urlparse(url)
|
|
122
|
+
return parsed.scheme in {"http", "https"} and bool(parsed.netloc)
|
|
123
|
+
|
|
124
|
+
|
|
117
125
|
def download_registry_catalog(
|
|
118
126
|
catalog_url: str,
|
|
119
127
|
output_dir: Path,
|
|
@@ -178,6 +178,12 @@ def test_load_registry_entries_skips_invalid_link_shapes() -> None:
|
|
|
178
178
|
{"rel": "item", "href": "https://example.test/item.json"},
|
|
179
179
|
{"rel": "child", "href": "https://example.test/missing-id/catalog.json"},
|
|
180
180
|
{"rel": "child", "href": 5, "portolan_registry:id": "bad-href"},
|
|
181
|
+
{
|
|
182
|
+
"rel": "child",
|
|
183
|
+
"href": "javascript:alert(1)",
|
|
184
|
+
"portolan_registry:id": "unsafe-scheme",
|
|
185
|
+
"portolan_registry:status": "valid",
|
|
186
|
+
},
|
|
181
187
|
{
|
|
182
188
|
"rel": "child",
|
|
183
189
|
"href": "https://example.test/no-status/catalog.json",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|