hippogriffe 0.2.0__py3-none-any.whl → 0.2.1__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
@@ -92,7 +92,7 @@ class _PublicApi:
92
92
  if isinstance(member, griffe.Alias):
93
93
  try:
94
94
  final_member = member.final_target
95
- except griffe.AliasResolutionError:
95
+ except (griffe.AliasResolutionError, griffe.CyclicAliasError):
96
96
  continue
97
97
  if member.name != final_member.name:
98
98
  # Renaming during import counts as private.
@@ -268,11 +268,23 @@ def _get_repo_url(repo_url: None | str) -> tuple[pathlib.Path, str]:
268
268
  else:
269
269
  toplevel = pathlib.Path(git_toplevel.stdout.decode().strip())
270
270
  commit_hash = git_head.stdout.decode().strip()
271
- raw_url = repo_url.removeprefix("https://").removeprefix("https://")
272
- if raw_url.startswith("github.com") or raw_url.startswith("gitlab.com"):
271
+ if "://" in repo_url:
272
+ protocol, repo_url = repo_url.split("://", 1)
273
+ protocol = f"{protocol}://"
274
+ else:
275
+ protocol = ""
276
+ supported_site = False
277
+ if repo_url.startswith("github.com"):
278
+ supported_site = True
279
+ fragment = "L{start}-L{end}"
280
+ elif repo_url.startswith("gitlab.com"):
281
+ supported_site = True
282
+ 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])
273
286
  repo_url = (
274
- f"{repo_url.removesuffix('/')}/blob/{commit_hash}/{{path}}"
275
- "#L{start}-{end}"
287
+ f"{protocol}{repo_url}/blob/{commit_hash}/{{path}}#{fragment}"
276
288
  )
277
289
  else:
278
290
  # We need to format the `repo_url` to what the repo expects, so we have to
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hippogriffe
3
- Version: 0.2.0
3
+ Version: 0.2.1
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>
@@ -295,4 +295,4 @@ plugins:
295
295
  - torch.Tensor
296
296
  ```
297
297
 
298
- List each object under whatever public path `somelib.Foo` that you would like it to be displayed under (and from which it must be accessilbe), not whatever private path `somelib._internal.foo.Foo` it is defined at.
298
+ List each object under whatever public path `somelib.Foo` that you would like it to be displayed under (and from which it must be accessible), not whichever private path `somelib._internal.foo.Foo` it is defined at.
@@ -1,12 +1,12 @@
1
1
  hippogriffe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- hippogriffe/_extension.py,sha256=5c5Hb4qW4v3UjGn2x2MwXB_8CI6PfLUOQ0kO0soflA0,15992
2
+ hippogriffe/_extension.py,sha256=xksWC82iABdTod9FUT0pHbDbDc3iPboBfXuy9NgMiLg,16401
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.0.dist-info/METADATA,sha256=Ud_6bXxxqtLRQltCwOPUzH2MfpzAHDcNCeWMfOrpTu8,16449
9
- hippogriffe-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- hippogriffe-0.2.0.dist-info/entry_points.txt,sha256=Et3dFNWG-biZ7XCvPI9na-buFT_hht1YT0p0JDNEQQM,158
11
- hippogriffe-0.2.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
12
- hippogriffe-0.2.0.dist-info/RECORD,,
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,,