import os

from alabaster import _version as version


def get_path():
    """
    Shortcut for users whose theme is next to their conf.py.
    """
    # Theme directory is defined as our parent directory
    return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


def update_context(app, pagename, templatename, context, doctree):
    context['alabaster_version'] = version.__version__

def setup(app):
    app.connect('html-page-context', update_context)

import os

from alabaster import _version as version


def get_path():
    """
    Shortcut for users whose theme is next to their conf.py.
    """
    # Theme directory is defined as our parent directory
    return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


def update_context(app, pagename, templatename, context, doctree):
    context['alabaster_version'] = version.__version__

def setup(app):
    app.connect('html-page-context', update_context)
    return {'version': version.__version__,
            'parallel_read_safe': True}

Declare extension version and parallel read safety
Declare extension version and parallel read safety

This is necessary for Sphinx' parallel read feature to work, since we import alabaster all the time now.
  import os
  
  from alabaster import _version as version
  
  
  def get_path():
      """
      Shortcut for users whose theme is next to their conf.py.
      """
      # Theme directory is defined as our parent directory
      return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
  
  
  def update_context(app, pagename, templatename, context, doctree):
      context['alabaster_version'] = version.__version__
  
  def setup(app):
      app.connect('html-page-context', update_context)
+     return {'version': version.__version__,
+             'parallel_read_safe': True}
  
Declare extension version and parallel read safety
## Code Before:
import os

from alabaster import _version as version


def get_path():
    """
    Shortcut for users whose theme is next to their conf.py.
    """
    # Theme directory is defined as our parent directory
    return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


def update_context(app, pagename, templatename, context, doctree):
    context['alabaster_version'] = version.__version__

def setup(app):
    app.connect('html-page-context', update_context)

## Instruction:
Declare extension version and parallel read safety
## Code After:
import os

from alabaster import _version as version


def get_path():
    """
    Shortcut for users whose theme is next to their conf.py.
    """
    # Theme directory is defined as our parent directory
    return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


def update_context(app, pagename, templatename, context, doctree):
    context['alabaster_version'] = version.__version__

def setup(app):
    app.connect('html-page-context', update_context)
    return {'version': version.__version__,
            'parallel_read_safe': True}
