Skip to content

Allow parallel execution#330

Open
giampaolo wants to merge 1 commit intosunpy:mainfrom
giampaolo:fix-parallel
Open

Allow parallel execution#330
giampaolo wants to merge 1 commit intosunpy:mainfrom
giampaolo:fix-parallel

Conversation

@giampaolo
Copy link
Copy Markdown

PR Description

Properly fix #297.
For the time being, I'm using this monkey patch in my own conf.py:

def setup(app):
    # ablog doesn't implement env-merge-info so it's not parallel-read safe.
    # Patch it here: merge worker envs into the main one, then declare it safe.
    def _merge_ablog_posts(app, env, docnames, other):
        if hasattr(other, "ablog_posts"):
            if not hasattr(env, "ablog_posts"):
                env.ablog_posts = {}
            env.ablog_posts.update(other.ablog_posts)

    app.connect("env-merge-info", _merge_ablog_posts)
    app.extensions["ablog"].parallel_read_safe = True

This PR would avoid that, and allow parallel execution via python3 -m sphinx -b html --jobs=auto . _build/html

AI Assistance Disclosure

AI tools were used for:

  • [ x ] Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding
  • No AI tools were used

Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
@SilverRainZ
Copy link
Copy Markdown
Contributor

I am not ABlog developer, just a user like you. I think you can update src/ablog/tests/test_parallel.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ablog isn't safe for parallel reading

2 participants