Skip to content

Commit 1b19cf4

Browse files
committed
chore: update setup boilerplate
1 parent 55a5a53 commit 1b19cf4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

setup_boilerplate.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Package(setup_boilerplate.Package):
4444
import docutils.utils
4545
import setuptools
4646

47-
__version__ = '2022.01.03'
47+
__version__ = '2022.08.27'
4848

4949
_LOG = logging.getLogger(__name__)
5050

@@ -197,6 +197,10 @@ def visit_reference(self, node: docutils.nodes.reference) -> None:
197197
path = pathlib.Path(node.attributes['refuri'])
198198
if path.is_absolute():
199199
return
200+
if '#' in path.name:
201+
# reference points to a section in a file
202+
# we ignore the section part when checking if file exists
203+
path = path.with_name(path.name[:path.name.index('#')])
200204
try:
201205
resolved_path = path.resolve(strict=True)
202206
except FileNotFoundError:
@@ -225,7 +229,7 @@ def resolve_relative_rst_links(text: str, base_link: str) -> str:
225229
And all link of the form :target: link become :target: absolute_link.
226230
227231
Where absolute_link is made by concatenating base_link to link with no separator added
228-
in between. So in most cases base_link should and with a slash.
232+
in between. So in most cases base_link should end with a slash.
229233
"""
230234
document = parse_rst(text)
231235
finder = RelativeRefFinder(HERE, document)

test/test_setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import typing as t
1313
import unittest
1414

15-
__version__ = '2022.08.15'
15+
__version__ = '2022.08.27'
1616

1717

1818
def run_program(*args, glob: bool = False) -> None:
@@ -95,6 +95,7 @@ def import_module_member(module_name: str, member_name: str) -> t.Any:
9595

9696
LINK_EXAMPLES = [
9797
(None, 'setup.py', True), ('this file', 'setup.py', True), (None, 'test/test_setup.py', True),
98+
(None, 'test/test_setup.py#L98', True), ('line 5 of this file', 'setup.py#L5', True),
9899
(None, 'http://site.com', False), (None, '../something/else', False), (None, 'no.thing', False),
99100
(None, '/my/abs/path', False)]
100101

0 commit comments

Comments
 (0)