Skip to content

Commit 98c5510

Browse files
committed
Rework RTD URL to work with the url checker
1 parent 3f18ce5 commit 98c5510

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.github/workflows/url_check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
# Exclude:
3030
# - Jenkins because it's behind a firewall
3131
# - RTD because a magically-generated string triggers failures
32-
exclude_urls: 'https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html#%s'
32+
exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html

pyomo/common/log.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@
3333

3434
_indentation_re = re.compile(r'\s*')
3535

36+
_RTD_URL = "https://pyomo.readthedocs.io/en/%s/errors.html"
37+
3638

3739
def RTD(_id):
3840
_id = str(_id).lower()
39-
assert _id[0] in 'wex'
40-
return "https://pyomo.readthedocs.io/en/%s/errors.html#%s" % (
41-
'stable' if (releaselevel == 'final' or in_testing_environment()) else 'latest',
42-
_id,
41+
_release = (
42+
'stable' if releaselevel == 'final' or in_testing_environment() else 'latest'
4343
)
44+
assert _id[0] in 'wex'
45+
return (_RTD_URL % (_release,)) + f"#{_id}"
4446

4547

4648
_DEBUG = logging.DEBUG

0 commit comments

Comments
 (0)