From 4fe8e67d692ccb84d0186fb9debb42ff0aa078f8 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 6 May 2024 10:59:42 +0200 Subject: [PATCH] update toml imports --- docs/source/conf.py | 9 +++++++-- pyproject.toml | 12 ++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3eef2f6dcc..12e6a94f13 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,11 +15,16 @@ # All configuration values have a default value; values that are commented out # serve to show the default value. -import toml + import sys, os from pathlib import Path -config = toml.load("./sphinx.toml") +if sys.version_info > (3, 11): + import toml as tomllib +else: + import toml as tomllib + +config = tomllib.load("./sphinx.toml") # https://read-the-docs.readthedocs.io/en/latest/faq.html ON_RTD = os.environ.get("READTHEDOCS", None) == "True" diff --git a/pyproject.toml b/pyproject.toml index 392c4b8e38..e3e6cac9b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,18 +61,18 @@ black = [ "black", ] doc = [ + "docrepr", + "exceptiongroup", "ipykernel", + "ipython[test]", + "matplotlib", "setuptools>=18.5", - "sphinx>=1.3", "sphinx-rtd-theme", + "sphinx>=1.3", "sphinxcontrib-jquery", - "docrepr", - "matplotlib", "stack_data", + "tomli ; python_version<'3.11'", "typing_extensions", - "exceptiongroup", - "ipython[test]", - "toml", ] kernel = [ "ipykernel",