Skip to content

extension: fix env.app deprecation warning#300

Merged
jnikula merged 1 commit into
masterfrom
env-app-deprecation
Jan 17, 2026
Merged

extension: fix env.app deprecation warning#300
jnikula merged 1 commit into
masterfrom
env-app-deprecation

Conversation

@jnikula

@jnikula jnikula commented Jan 16, 2026

Copy link
Copy Markdown
Owner

Switch from env.app.emit() to env.events.emit() to fix the Sphinx deprecation warning introduced in version v9.0.0:

RemovedInSphinx11Warning: 'sphinx.environment.BuildEnvironment.app' is deprecated

The env.events.emit() interface has been there since Sphinx v3.0.0, so there shouldn't be any need to bump dependencies for this.

See also sphinx-doc/sphinx#14119

Switch from env.app.emit() to env.events.emit() to fix the Sphinx
deprecation warning introduced in version v9.0.0:

RemovedInSphinx11Warning: 'sphinx.environment.BuildEnvironment.app' is deprecated

The env.events.emit() interface has been there since Sphinx v3.0.0, so
there shouldn't be any need to bump dependencies for this.

See also sphinx-doc/sphinx#14119
@jnikula jnikula requested a review from BrunoMSantos January 16, 2026 22:30

@BrunoMSantos BrunoMSantos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see these recent clean ups in sphinx, even if they break a couple of things along the way.

Just to confirm, this is still valid on older Sphinx versions, right?

@jnikula

jnikula commented Jan 17, 2026

Copy link
Copy Markdown
Owner Author

Just to confirm, this is still valid on older Sphinx versions, right?

It should work with Sphinx v3.0.0 and later, based on looking at Sphinx git history, but I was only able to test v6.2.1. Earlier Sphinx would have required an earlier Python version, and I didn't want to go through that rabbit hole.

@jnikula jnikula merged commit 6b7df8b into master Jan 17, 2026
8 checks passed
@jnikula jnikula deleted the env-app-deprecation branch January 17, 2026 18:59
@BrunoMSantos

Copy link
Copy Markdown
Collaborator

It should work with Sphinx v3.0.0 and later, based on looking at Sphinx git history, but I was only able to test v6.2.1. Earlier Sphinx would have required an earlier Python version, and I didn't want to go through that rabbit hole.

Ah, sure. I only meant to check that self.env.events was not a new API that was missing in earlier versions. I think that's far enough ;)

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.

2 participants