Skip to content

Commit

Permalink
Rework RTD URL to work with the url checker
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiirola committed Aug 30, 2024
1 parent 3f18ce5 commit 98c5510
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/url_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
# Exclude:
# - Jenkins because it's behind a firewall
# - RTD because a magically-generated string triggers failures
exclude_urls: 'https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html#%s'
exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html
10 changes: 6 additions & 4 deletions pyomo/common/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@

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

_RTD_URL = "https://pyomo.readthedocs.io/en/%s/errors.html"


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


_DEBUG = logging.DEBUG
Expand Down

0 comments on commit 98c5510

Please sign in to comment.