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

import tomli as tomllib for docs builds before Python 3.11 #219

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
# Ensure documentation examples are deterministically random.
import numpy
import stsci_rtd_theme
import tomli

if sys.version_info < (3, 11):
import tomli as tomllib
else:
import tomllib

from importlib_metadata import distribution

try:
Expand All @@ -46,7 +51,7 @@

# Get configuration information from pyproject.toml
with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as configuration_file:
conf = tomli.load(configuration_file)
conf = tomllib.load(configuration_file)
configuration = conf["project"]


Expand Down