コード例 #1
0
ファイル: conf.py プロジェクト: stu12345/airflow
    'sphinx.ext.coverage',
    'sphinx.ext.viewcode',
    'sphinx.ext.graphviz',
    'sphinxarg.ext',
    'sphinxcontrib.httpdomain',
    'sphinxcontrib.jinja',
    'sphinx.ext.intersphinx',
    'autoapi.extension',
    'exampleinclude',
    'docroles',
    'removemarktransform',
]

autodoc_default_options = {'show-inheritance': True, 'members': True}

jinja_contexts = {'config_ctx': {"configs": default_config_yaml()}}

viewcode_follow_imported_members = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
コード例 #2
0
# -- Options for sphinxcontrib.jinjac ------------------------------------------
# See: https://github.com/tardyp/sphinx-jinja

# Jinja context
if PACKAGE_NAME == 'apache-airflow':
    deprecated_options: Dict[str, Dict[str, Tuple[str, str,
                                                  str]]] = defaultdict(dict)
    for (section, key), (
        (deprecated_section, deprecated_key,
         since_version)) in AirflowConfigParser.deprecated_options.items():
        deprecated_options[deprecated_section][
            deprecated_key] = section, key, since_version

    jinja_contexts = {
        'config_ctx': {
            "configs": default_config_yaml(),
            "deprecated_options": deprecated_options
        },
        'quick_start_ctx': {
            'doc_root_url':
            f'https://airflow.apache.org/docs/apache-airflow/{PACKAGE_VERSION}/'
            if FOR_PRODUCTION else
            ('http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/'
             )
        },
    }
elif PACKAGE_NAME.startswith('apache-airflow-providers-'):

    def _load_config():
        templates_dir = os.path.join(PACKAGE_DIR, 'config_templates')
        file_path = os.path.join(templates_dir, "config.yml")
コード例 #3
0
ファイル: conf.py プロジェクト: zjasonliang/airflow
    'sphinxcontrib.httpdomain',
    'sphinxcontrib.jinja',
    'sphinx.ext.intersphinx',
    'autoapi.extension',
    'exampleinclude',
    'docroles',
    'removemarktransform',
]

autodoc_default_options = {
    'show-inheritance': True,
    'members': True
}

jinja_contexts = {
    'config_ctx': {"configs": default_config_yaml()}
}

viewcode_follow_imported_members = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
コード例 #4
0
ファイル: conf.py プロジェクト: weiplanet/airflow
# == Extensions configuration ==================================================

# -- Options for sphinxcontrib.jinjac ------------------------------------------
# See: https://github.com/tardyp/sphinx-jinja

# Jinja context
if PACKAGE_NAME == 'apache-airflow':
    deprecated_options: Dict[str, Dict[str, Tuple[str, str,
                                                  str]]] = defaultdict(dict)
    for (section, key), (
        (deprecated_section, deprecated_key,
         since_version)) in AirflowConfigParser.deprecated_options.items():
        deprecated_options[deprecated_section][
            deprecated_key] = section, key, since_version

    configs = default_config_yaml()

    # We want the default/example we show in the docs to reflect the value _after_
    # the config has been templated, not before
    # e.g. {{dag_id}} in default_config.cfg -> {dag_id} in airflow.cfg, and what we want in docs
    keys_to_format = ["default", "example"]
    for conf_section in configs:
        for option in conf_section["options"]:
            for key in keys_to_format:
                if option[key] and "{{" in option[key]:
                    option[key] = option[key].replace("{{",
                                                      "{").replace("}}", "}")

    jinja_contexts = {
        'config_ctx': {
            "configs": configs,
コード例 #5
0
# == Extensions configuration ==================================================

# -- Options for sphinxcontrib.jinjac ------------------------------------------
# See: https://github.com/tardyp/sphinx-jinja

# Jinja context
if PACKAGE_NAME == 'apache-airflow':
    deprecated_options: Dict[str, Dict[str, Tuple[str, str, str]]] = defaultdict(dict)
    for (section, key), (
        (deprecated_section, deprecated_key, since_version)
    ) in AirflowConfigParser.deprecated_options.items():
        deprecated_options[deprecated_section][deprecated_key] = section, key, since_version

    jinja_contexts = {
        'config_ctx': {"configs": default_config_yaml(), "deprecated_options": deprecated_options},
        'quick_start_ctx': {
            'doc_root_url': f'https://airflow.apache.org/docs/apache-airflow/{PACKAGE_VERSION}/'
            if FOR_PRODUCTION
            else (
                'http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/'
            )
        },
    }
elif PACKAGE_NAME.startswith('apache-airflow-providers-'):

    def _load_config():
        templates_dir = os.path.join(PACKAGE_DIR, 'config_templates')
        file_path = os.path.join(templates_dir, "config.yml")
        if not os.path.exists(file_path):
            return {}