James Addison
5211c01646
Enable reporting HTTP 401 hyperlinks as broken in linkcheck ( #11684 )
...
Co-authored-by: picnixz <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-09 12:33:40 +00:00
James Addison
d66d51ad8c
test_build_linkcheck: test_defaults: fix line-number assertion when using docutils 0.21b+ ( #11818 )
...
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2023-12-30 13:38:30 +01:00
Adam Turner
cb0c6a359b
Add `sphinx.util._strip_escape_sequences
`
2023-09-20 23:55:00 +01:00
Dmitry Shachnev
2f025a4b22
linkcheck: Fix conversion from UTC time to the UNIX epoch ( #11649 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-28 03:39:13 +00:00
Adam Turner
08dbaa793e
Fix SIM117 (use single 'with' statement)
2023-08-14 00:18:13 +01:00
Adam Turner
d4169a32e7
Use `parsedate_tz
` in the linkcheck builder
2023-08-13 22:11:15 +01:00
James Addison
06c1339bb3
Ensure that `linkcheck_anchors
` is properly respected ( #11544 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-02 02:55:37 +01:00
Jean-François B
4958d2abf1
Fix flake8 E231 reported linting failure
2023-08-02 02:04:55 +01:00
picnixz
82bc15aec3
Enable skipping anchor verification on a per-URL basis ( #11489 )
...
Add a new ``linkcheck_anchors_ignore_for_url`` configuration variable.
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-24 12:15:42 +01:00
James Addison
450ad637ac
Begin using session-based HTTP requests in the linkcheck builder ( #11503 )
...
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 22:23:08 +01:00
James Addison
c583e0f9b0
Add client connection-pool contention coverage to the `linkcheck
` tests ( #11402 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-07-23 16:24:12 +01:00
James Addison
2b333265cb
Add a connection-count measurement to the `linkcheck
` tests ( #11374 )
2023-07-23 16:06:23 +01:00
Adam Turner
d71c781187
Re-structure the `linkcheck
` builder ( #11499 )
...
Re-organise and re-structure the ``linkcheck`` builder:
- All functions defined within functions are factored out into top-level functions or class methods
- Classes and methods have been re-arranged (Builder, PostTransform, Checker, Worker)
- TLS verification on ``sphinx.util.requests`` has been changed to not pass the ``Config`` object all the way down
- The ``Hyperlink`` object now stores the document path
- ``BuildEnvironment`` and ``Config`` objects are used to extract properties and are not stored as class attributes
2023-07-23 00:01:41 +01:00
James Addison
566e4e74a0
Use HTTP/1.1 in linkcheck test webservers ( #11392 )
2023-07-22 20:12:32 +01:00
James Addison
bef7fc2e45
Refactor HTTP handlers in `linkcheck
` builder tests ( #11426 )
2023-07-20 22:20:53 +01:00
James Addison
13720de50c
Treat SSL failures as broken links in the linkcheck builder ( #11431 )
...
TLS operates at a lower layer than HTTP, and so if there is a TLS-related error from a host,
it seems unlikely that retrying with a different higher-layer protocol request
(HTTP GET instead of HTTP HEAD) could succeed.
We should not make additional HTTP requests that we do not believe will succeed.
2023-07-20 21:38:21 +01:00
James Addison
e45fb5e61b
Reduce the lifetime of `response
` in the linkcheck builder ( #11432 )
...
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-20 21:14:00 +01:00
James Addison
c9d0933e5d
linkcheck: Use context managers for HTTP requests ( #11318 )
...
This closes HTTP responses when no content reads are required, as
when requests are made in streaming mode, ``requests`` doesn't know
whether the caller may intend to later read content from a streamed
HTTP response object and holds the socket open.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-09 17:09:35 +01:00
Martin Liška
a80e3fd377
Use a shared file-system lock in `create_server
` ( #11294 )
...
With parallel run of tests, one gets "Address already in use" errors
as all tests attempt to bind to the same port. Fix it with a shared
file-system lock.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-04-06 22:24:49 +01:00
Adam Turner
97f07ca83c
Speed up `test_linkcheck
`
2023-03-24 00:29:27 +00:00
Adam Turner
c8f4a03dac
Fix COM812
2023-02-18 01:58:05 +00:00
Adam Turner
f4c8a0a68e
Insert `from __future__ import annotations
`
2023-01-01 20:48:37 +00:00
Adam Turner
b91f6617ed
Enable Ruff's pylint 'PLC2201' check
...
Address all cases where the comparison order check is violated
2022-12-30 00:06:11 +00:00
Jean-François B
7418d2ccc4
Deactivate (provisorily) Python12-dev testing ( #11035 )
...
* fix flake8 warnings
* Deactivate (provisorily) testing with 3.12-dev
(refs:
https://github.com/sphinx-doc/sphinx/pull/10995#issuecomment-1330310586
)
* Escape # in tox.ini for tox 4 compatibility ('du-latest' tests)
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
2022-12-16 12:41:54 +01:00
n-peugnet
1553cc3b36
linkcheck: Check the source URL of raw directives
...
Add raw directives' source URL to the list of links to check with linkcheck.
By the way, refactor HyperlinkCollector by adding `add_uri` function.
Add test for linkcheck raw directives source URL
2022-08-17 14:57:58 +02:00
Adam Turner
24e3b7c8c8
.read_text()
-> .read_text(encoding='utf8')
2022-04-27 03:04:19 +01:00
Adam Turner
55669f6cfc
Specify encoding
2022-04-22 04:21:12 +01:00
Adam Turner
5775912455
Collapse single line docstrings
2022-02-20 03:13:45 +00:00
Adam Turner
6bb7b891a1
Remove copyright and licence fields
2022-02-20 03:06:23 +00:00
Adam Turner
5694e0ce60
Fix module docstring indentation
2022-02-20 00:35:13 +00:00
Adam Turner
4f5a3269a6
Fix module docstring first line
2022-02-20 00:11:08 +00:00
Adam Turner
6b8bccec59
Remove module titles in docstrings
2022-02-19 23:17:29 +00:00
Takeshi KOMIYA
b84771dcd2
A happy new year!
2022-01-01 18:45:03 +09:00
Christian Roth
10023da895
linkcheck: Exclude links from matched documents
2021-12-08 10:01:45 +01:00
oleg.hoefling
36a6fcaef1
don't print file extension twice in linkcheck warnings
...
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-09-27 22:12:57 +02:00
Takeshi KOMIYA
a35b009adc
Fix #9435 : linkcheck: Failed to check anchors in github.com
...
The approach of `rewrite_github_anchor` makes some anchors valid. But
it also makes other kind of anchors invalid. This disables the handler
to make them valid again (while 4.1.x release).
2021-07-18 13:03:57 +09:00
Takeshi KOMIYA
5e5bca98f7
Merge branch '4.x' into 6525_linkcheck_warn_redirects
2021-07-07 02:09:50 +09:00
Takeshi KOMIYA
7e71b759d7
Merge branch '4.x' into 4.0.x
2021-06-13 17:20:01 +09:00
Justin Mathews
36c662eca5
positive test assertion
...
Co-authored-by: François Freitag <mail@franek.fr>
2021-06-10 11:43:14 -04:00
Justin Mathews
9b2a1e20e2
explicitly close the connection
...
Co-authored-by: François Freitag <mail@franek.fr>
2021-06-10 11:42:36 -04:00
Justin Mathews
134a8d8f54
reuse existing test link
...
Co-authored-by: François Freitag <mail@franek.fr>
2021-06-10 11:41:47 -04:00
Justin Mathews
a4621fb73e
test with http
...
Co-authored-by: François Freitag <mail@franek.fr>
2021-06-10 11:41:11 -04:00
Justin Mathews
db9adaceaf
Trigger the bad web server behaviour with the http_server context manager instead of relying on an external website.
2021-06-09 23:40:40 -04:00
Justin Mathews
57c866caf1
catch ConnectionError on HEAD
2021-06-07 17:53:36 -04:00
Justin Mathews
84d4a5b97a
failing test for linkcheck of US Patent page
2021-06-07 17:53:32 -04:00
Takeshi KOMIYA
92335bd6e6
Close #9016 : linkcheck builder failed to check the anchors of github.com
2021-06-01 00:31:15 +09:00
Takeshi KOMIYA
988a79de65
linkcheck: Emit a warning for disallowed redirects
...
Now linkcheck builder integrates `linkcheck_warn_redirects` into
`linkcheck_allowed_redirects`. As a result, linkcheck builder will
emit a warning when "disallowed" redirection detected via
`linkcheck_allowed_redirects`.
2021-05-31 21:53:09 +09:00
Takeshi KOMIYA
4201a84b35
Add testcase for combination of allow_redirects and warn_redirects
2021-05-21 02:04:01 +09:00
Takeshi KOMIYA
ce9e2e6c74
Rename linkcheck_ignore_redirects to linkcheck_allowed_redirects
2021-05-20 23:26:16 +09:00
Takeshi KOMIYA
707319aab2
Close #6525 : linkcheck: Add linkcheck_ignore_redirects
...
Add a new confval; linkcheck_ignore_redirects to ignore hyperlinks
that are redirected as expected.
2021-05-16 02:48:03 +09:00