Skip to content

Commit

Permalink
Allow access to __version__ with imports
Browse files Browse the repository at this point in the history
We move the top level imports into the 'setup' function in order to
allow setup.py to access the __version__ variable in the module without
having to have sphinx available.

I'm not sure if this is for the best but the ReadTheDocs build is
failing and it seems potentially related to this though I've no idea why
it is suddenly happening as we've not changed anything around this to my
understanding.
  • Loading branch information
michaeljones committed Sep 29, 2021
1 parent 327374d commit c3db3e0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions breathe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from breathe.directives.setup import setup as directive_setup
from breathe.file_state_cache import setup as file_state_cache_setup
from breathe.renderer.sphinxrenderer import setup as renderer_setup
__version__ = "4.31.0"

from sphinx.application import Sphinx

__version__ = "4.31.0"
def setup(app):

from breathe.directives.setup import setup as directive_setup
from breathe.file_state_cache import setup as file_state_cache_setup
from breathe.renderer.sphinxrenderer import setup as renderer_setup

from sphinx.application import Sphinx

app: Sphinx = app

def setup(app: Sphinx):
directive_setup(app)
file_state_cache_setup(app)
renderer_setup(app)
Expand Down

0 comments on commit c3db3e0

Please sign in to comment.