Skip to content

myst_heading_slug_func causes changes in config every time #636

@Knaifhogg

Description

@Knaifhogg

Describe the bug

context
When I set myst_heading_slug_func to a function, it does not share the same address the next time I run sphinx-build, which I believe causes all files to be re-run.

first run (successful build)

Running Sphinx v4.3.1
loading pickled environment... done
myst v0.18.0: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=['dollarmath', 'amsmath', 'deflist', 'html_admonition', 'html_image', 'colon_fence', 'smartquotes', 'replacements', 'linkify', 'substitution', 'tasklist'], disable_syntax=[], all_links_external=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, highlight_code_blocks=True, number_code_blocks=[], title_to_header=False, heading_anchors=5, heading_slug_func=<function slugify at 0x000001C9E51E0E50>, footnote_transition=True, words_per_minute=200, sub_delimiters=('{', '}'), linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area')
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [config changed ('myst_heading_slug_func')] 38 added, 0 changed, 0 removed

second run (successful build, but fresh build)

Running Sphinx v4.3.1
loading pickled environment... done
myst v0.18.0: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=['dollarmath', 'amsmath', 'deflist', 'html_admonition', 'html_image', 'colon_fence', 'smartquotes', 'replacements', 'linkify', 'substitution', 'tasklist'], disable_syntax=[], all_links_external=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, highlight_code_blocks=True, number_code_blocks=[], title_to_header=False, heading_anchors=5, heading_slug_func=<function slugify at 0x000001A5355F0E50>, footnote_transition=True, words_per_minute=200, sub_delimiters=('{', '}'), linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area')
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [config changed ('myst_heading_slug_func')] 38 added, 0 changed, 0 removed

Reproduce the bug

  1. py -m pip install python-slugify
  2. in conf.py add

from slugify import slugify

and

myst_heading_slug_func = slugify

  1. run sphinx-build

List your environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions