Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/nichepca/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: nichepca
description: |
A Python package for PCA-based spatial domain identification in single-cell spatial transcriptomics data.
project_home: https://github.com/imsb-uke/nichepca
documentation_home: https://nichepca.readthedocs.io/en/latest/
tutorials_home: https://nichepca.readthedocs.io/en/latest/notebooks/example.html
documentation_home: https://nichepca.readthedocs.io/
tutorials_home: https://nichepca.readthedocs.io/page/notebooks/example.html
install:
pypi: nichepca
tags:
Expand Down
12 changes: 12 additions & 0 deletions scripts/src/ecosystem_scripts/validate_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import argparse
import json
import os
import re
import shutil
import sys
from collections import defaultdict
Expand Down Expand Up @@ -48,6 +49,11 @@ def append(self, obj: Exception | None) -> None:
return super().append(obj)


RE_RTD = re.compile(
r"https?://(?P<domain>.*\.(?:readthedocs\.io|rtfd\.io|readthedocs-hosted\.com))/(?P<version>en/[^/]+)(?P<path>.*)"
)


class LinkChecker:
"""Track known links and validate URLs."""

Expand All @@ -65,6 +71,12 @@ def check_and_register(self, url: str, context: str) -> None | ValidationError:
context
Context information for error messages (e.g., file being validated)
"""
if m := re.fullmatch(RE_RTD, url):
new_url = f"https://{m['domain']}/" + (f"page{m['path']}" if m["path"].strip("/") else "")
msg = (
f"Please use the default version in ReadTheDocs URLs instead of {m['version']!r}:\n{url}\n->\n{new_url}"
)
return ValidationError(msg)
if url in self.known_links:
msg = f"{context}: Duplicate link: {url}"
return ValidationError(msg)
Expand Down