Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extensions to detect freshenv builds #12358

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chrisjsewell
Copy link
Member

Some extensions cache data outside of the BuildEnvironment (usually for memory/performance reasons). For these extensions it would be helpful to detect when sphinx-build -E has been called, which in essence suggests the user wishes to remove cached data before building.

This PR adds the Sphinx.fresh_env_used public property, exposing Sphinx._fresh_env_used in an immutable manner.

Note, you could create some form of callback event for this, but I feel this is probably overkill and the property will suffice.

Some extensions cache data outside of the `BuildEnvironment` (usually for memory/performance reasons).
For these extensions it would be helpful to detect when `sphinx-build -E` has been called, which in essence suggests the user wishes to remove cached data before building.
@chrisjsewell
Copy link
Member Author

(Also added a docstring for the Sphinx.__init__)

sphinx/application.py Outdated Show resolved Hide resolved
sphinx/application.py Outdated Show resolved Hide resolved
@chrisjsewell chrisjsewell requested a review from picnixz May 7, 2024 09:25
sphinx/application.py Outdated Show resolved Hide resolved
sphinx/application.py Outdated Show resolved Hide resolved
@AA-Turner AA-Turner changed the title 👌 Allow extensions to detect freshenv builds Allow extensions to detect freshenv builds May 7, 2024
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.

None yet

2 participants