#361 Stop using sphinxcontrib-issuetracker for docs.
Merged 4 years ago by lsedlar. Opened 4 years ago by jkaluza.
jkaluza/odcs issuetracker  into  master

file modified
-40
@@ -39,7 +39,6 @@ 

      'sphinx.ext.viewcode',

      'sphinx.ext.napoleon',

      'sphinxcontrib.autohttp.flask',

-     'sphinxcontrib.issuetracker',

  ]

  

  # Add any paths that contain templates here, relative to this directory.
@@ -194,42 +193,3 @@ 

  

  # To show __init__ in automodule docs.

  autoclass_content = 'both'

- 

- # Until Pagure support is merged: https://github.com/ignatenkobrain/sphinxcontrib-issuetracker/pull/15

- import requests  # noqa

- from sphinxcontrib.issuetracker import Issue  # noqa

- PAGURE_URL = '{0.url}/{0.project}/issue/{1}'

- PAGURE_API_URL = '{0.url}/api/0/{0.project}/issue/{1}'

- HEADERS = {

-     'User-Agent': 'sphinxcontrib-issuetracker'

- }

- 

- 

- def get(app, url):

-     try:

-         response = requests.get(url, headers=HEADERS)

-         if response.status_code == requests.codes.ok:

-             return response

-         elif response.status_code != requests.codes.not_found:

-             msg = 'GET {0.url} failed with code {0.status_code}'

-             app.warn(msg.format(response))

-     except IOError as e:

-         msg = 'GET {0} failed with error: {1}'

-         app.warn(msg.format(url, e))

- 

- 

- def lookup_pagure_issue(app, tracker_config, issue_id):

-     if not tracker_config.url:

-         raise ValueError('URL required, try: https://pagure.io/')

-     issue_url = PAGURE_URL.format(tracker_config, issue_id)

-     response = get(app, PAGURE_API_URL.format(tracker_config, issue_id))

-     if response:

-         title = response.json()['title']

-         closed = response.json()['status'] != 'Open'

-         return Issue(id=issue_id, title=title, closed=closed, url=issue_url)

-     else:

-         return Issue(id=issue_id, title=None, closed=False, url=issue_url)

- 

- 

- def setup(app):

-     app.connect('issuetracker-lookup-issue', lookup_pagure_issue)

The sphinxcontrib-issuetracker is no longer maintained and is not
compatible with latest Sphinx release. See this bug for more details:

https://github.com/ignatenkobrain/sphinxcontrib-issuetracker/issues/23

This Sphinx extension is supposed to replace #bugid with link pointing
to Pagure issue page. We have never been using that as far as I know.

Pull-Request has been merged by lsedlar

4 years ago