hippogriffe 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.
hippogriffe/_extension.py CHANGED
@@ -273,19 +273,10 @@ def _get_repo_url(repo_url: None | str) -> tuple[pathlib.Path, str]:
273
273
  protocol = f"{protocol}://"
274
274
  else:
275
275
  protocol = ""
276
- supported_site = False
277
276
  if repo_url.startswith("github.com"):
278
- supported_site = True
279
277
  fragment = "L{start}-L{end}"
280
278
  elif repo_url.startswith("gitlab.com"):
281
- supported_site = True
282
279
  fragment = "L{start}-{end}"
283
- if supported_site:
284
- # Expect url in the form `https://github.com/org/repo`, strip any trailing paths
285
- repo_url = "/".join(repo_url.split("/")[:3])
286
- repo_url = (
287
- f"{protocol}{repo_url}/blob/{commit_hash}/{{path}}#{fragment}"
288
- )
289
280
  else:
290
281
  # We need to format the `repo_url` to what the repo expects, so we have to
291
282
  # hardcode this in.
@@ -293,6 +284,9 @@ def _get_repo_url(repo_url: None | str) -> tuple[pathlib.Path, str]:
293
284
  "`hippogriffe.show_source_links` currently only supports "
294
285
  "`repo_url: https://github.com/...` and `repo_url: https://gitlab.com/...`."
295
286
  )
287
+ # Expect url in the form `https://github.com/org/repo`, strip any trailing paths
288
+ repo_url = "/".join(repo_url.split("/")[:3])
289
+ repo_url = f"{protocol}{repo_url}/blob/{commit_hash}/{{path}}#{fragment}"
296
290
  return toplevel, repo_url
297
291
 
298
292
 
@@ -363,7 +357,11 @@ class HippogriffeExtension(griffe.Extension):
363
357
  with contextlib.suppress(BaseException):
364
358
  obj = eval(obj, context)
365
359
  # Then if it's in the public API, convert it over.
366
- if isinstance(obj, type) and obj is not type(None):
360
+ if (
361
+ isinstance(obj, type)
362
+ and obj is not type(None)
363
+ and not hasattr(obj, "__pdoc__")
364
+ ):
367
365
  new_path, _ = public_api[f"{obj.__module__}.{obj.__qualname__}"]
368
366
  return wl.TextDoc(new_path)
369
367
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hippogriffe
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Tweaks for `mkdocstrings[python]`
5
5
  Project-URL: repository, https://github.com/patrick-kidger/hippogriffe
6
6
  Author-email: Patrick Kidger <contact@kidger.site>
@@ -1,12 +1,12 @@
1
1
  hippogriffe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- hippogriffe/_extension.py,sha256=xksWC82iABdTod9FUT0pHbDbDc3iPboBfXuy9NgMiLg,16401
2
+ hippogriffe/_extension.py,sha256=d60NW7VnWolEKYF-62WUp9o4RAviB3eXnHUC2zQJCWI,16352
3
3
  hippogriffe/_plugin.py,sha256=9omje-ROpvo24YYSIcul8XjKwuzFhV7rE9a1f3XDUws,4307
4
4
  hippogriffe/assets/_hippogriffe.css,sha256=BgyZLCaOaZNgQErdUb01vpNso4ilUMmoZ5d_OeVpfRE,147
5
5
  hippogriffe/templates/material/hippogriffe/class.html.jinja,sha256=5i624gIuZfnf5toH3jWclzg1qlekqIZ2ODbpzeZcULw,954
6
6
  hippogriffe/templates/material/hippogriffe/fn.html.jinja,sha256=vxrWOPkPkGD3Po9hbcYlyEjsJKhJmOHic4G5t2J0djc,196
7
7
  hippogriffe/templates/material/hippogriffe/hippogriffe.jinja,sha256=KxTBKY0XqiFzqTT1iqFxhN2GhmtwLT4GWc8S86zyjOc,583
8
- hippogriffe-0.2.1.dist-info/METADATA,sha256=OtX66dUYL4Mh0RXkQiq4M5l7MeoKlnUXDKAMS56GTYE,16450
9
- hippogriffe-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- hippogriffe-0.2.1.dist-info/entry_points.txt,sha256=Et3dFNWG-biZ7XCvPI9na-buFT_hht1YT0p0JDNEQQM,158
11
- hippogriffe-0.2.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
- hippogriffe-0.2.1.dist-info/RECORD,,
8
+ hippogriffe-0.2.2.dist-info/METADATA,sha256=LI0Hi2TiM-0WwREciAuktiduV-u50M8otJwMmlkE7r4,16450
9
+ hippogriffe-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ hippogriffe-0.2.2.dist-info/entry_points.txt,sha256=Et3dFNWG-biZ7XCvPI9na-buFT_hht1YT0p0JDNEQQM,158
11
+ hippogriffe-0.2.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
+ hippogriffe-0.2.2.dist-info/RECORD,,