-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use annotations from the __future__ (#1433)
The goal here is to reduce the use of the name "Scenario" in the docs, to control where it appears when the docs are included at ops.readthedocs.io. Using `from __future__ import annotations` seems to make Sphinx much happier when doing the class signatures, avoiding odd text like `~scenario.state.CloudCredential` instead of the expected link with text "CloudCredential" and destination that class. When adding those imports, pyupgrade transformed all the type annotations. I've run all the tests with 3.8, 3.9, 3.10, 3.11, and 3.12 and they all pass, and I've manually tested in 3.8 and everything seems to work without any problems. I like this much more, so it seems like a win-win. You may find it easier to review commit-by-commit, as [one commit is completely automated](7f250a1), running `pyupgrade`, and it is responsible for the majority of lines changed. Also removes a couple of references to the name "Scenario", as the original intent of this change was to clean up references in the docs. Migrated from canonical/ops-scenario#203
- Loading branch information
1 parent
f3372b9
commit a4b1d2e
Showing
3 changed files
with
169 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.