Commit Graph

19 Commits

Author SHA1 Message Date
Bénédikt Tran
1852d0f087
intersphinx: Fix double forward slashes in inventory urls (#12807) 2024-08-22 10:11:12 +01:00
Adam Turner
0b17bb1029
Always define the builder and `testroot when using the app` fixtureture (#12775) 2024-08-12 22:34:03 +01:00
James Addison
655d1c7213
intersphinx: Reduce log message severity when an ambiguous target resolves to a duplicate (#12587) 2024-08-11 17:22:37 +01:00
Adam Turner
d03156e078
Format `tests/` (#12760) 2024-08-11 14:58:56 +01:00
Shengyu Zhang
03d684fe9f
intersphinx: Handle a negative `intersphinx_cache_limit` (#12514)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-31 08:16:10 +01:00
Adam Turner
46671f2e10
intersphinx: Add a type for project data (#12657) 2024-07-23 23:17:58 +01:00
Adam Turner
1f2891530d
Use `app.status and app.warning` in tests (#12663) 2024-07-23 15:35:55 +01:00
Adam Turner
e174df2762
Rename `normalize_intersphinx_mapping to validate_intersphinx_mapping` (#12643) 2024-07-22 13:32:44 +01:00
Bénédikt Tran
aacca3064e
Remove support for the Sphinx 0.5 `intersphinx_mapping` format (#12083)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-22 12:59:59 +01:00
Chris Sewell
dabacdf5f8
Turn `show_warning_types` on by default (#12597)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-20 21:07:06 +01:00
James Addison
799ae16a01
Intersphinx: log warnings for ambiguous target resolutions. (#12329)
This commit adds detection of ambiguous ``std:label`` and ``std:term`` references (due to case-insensitivity)
during loading and resolution of Intersphinx targets,
and emits a warning if found.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
2024-06-17 12:42:22 +02:00
Chris Sewell
49726c28f4 Split `sphinx.ext.intersphinx._load`
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 15:30:55 +01:00
Adam Turner
3b907a1caa Import INVENTORY_FILENAME from canonical location 2024-04-25 13:35:06 +01:00
James Addison
df3cde65fa
[tests] linkcheck: bind each test HTTP server to a unique port per-testcase (#12126)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-04 11:25:53 +02:00
Chris Sewell
04bd0df100
👌 Improve external role warnings (and revert object fallback) (#12193)
The key issue this commit seeks to address, is that existing tools / documentation often lead users to mistakenly use object types and not role names, a classic example being `function` not `func`

Previously, the warning message for using e.g. `` external:function`target` `` (with `py` as the default domain), would be:

```
WARNING: role for external cross-reference not found: function
```

This gives no information to the user on how to fix the issue, even though there is actually quite an easy fix

This commit adds logic to create more specific / helpful warning messages, e.g.

```
WARNING: role for external cross-reference not found in domains 'py', 'std': 'function' (perhaps you meant one of: 'py:func', 'py:obj')
```

This goes through the same original logic but, if the role is not found, it will look if the role name is actually an available object type on the domain(s), and then suggest its related roles.

This commit also reverts #12133, which provided a (silent) fallback to auto convert an object type to a role name.
2024-03-25 14:39:51 +01:00
Bénédikt Tran
885818bb7f
[tests] move utilities and static data into dedicated modules and remove `html5lib` (#12173)
Since #12168, HTML files are now XML compliant, hence ``html5lib`` is no more needed as a testing dependencies.
2024-03-25 11:03:44 +01:00
Chris Sewell
565d4104d5
👌 Handle external references pointing to object types (#12133)
This commit fixes the issue of `objects.inv` denoting object names, whilst the `external` role only allows for role names. 

As an example, take the `objects.inv` for the sphinx documentation, which contains:

```
py:function
    compile                  : usage/domains/python.html#compile
```

A user might understandably expect that they could reference this using `` :external:py:function:`compile` ``, but actually this would previously error with:

```
WARNING: role for external cross-reference not found: py:function
```

this is because, `function` is the object type, yet `external` expects the related role name `func`.

It should not be necessary for the user to know about this distinction,
so in this commit, we add logic, to first look if the name relates to a role name (as previous, to not be back-breaking) but, if not, then also look if the name relates to an object that has a known role and, if so, use that.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-19 13:42:50 +01:00
Michael Goerz
265ffeedbd
[intersphinx] allow case-insensitive match of label-refs through intersphinx (#12033) 2024-03-02 12:39:51 +01:00
Adam Turner
462404cb25 Organise tests into directories 2024-01-17 03:56:35 +00:00