Skip to content

Commit ce3a509

Browse files
committed
breaking: make minimum Python 3.11
Updates the minimum Python version to 3.11 for its built-in tomllib and removes the toml dependency. toml wasn't pickling properly, causing issues with multiprocessing
1 parent aa0cb33 commit ce3a509

File tree

5 files changed

+197
-200
lines changed

5 files changed

+197
-200
lines changed

blurry/markdown/front_matter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import re
2+
import tomllib
23
from collections.abc import MutableMapping
34
from pathlib import Path
45
from typing import Any
56
from typing import TypeGuard
67

7-
import toml
88
from mistune import BlockState
99
from mistune import Markdown
1010

@@ -30,7 +30,7 @@ def get_data(doc: str) -> tuple[str, MutableMapping]:
3030
if toml_block_match:
3131
toml_part = toml_block_match.group(1)
3232
try:
33-
data = toml.loads(toml_part)
33+
data = tomllib.loads(toml_part)
3434
except Exception as e:
3535
print("Parsing TOML failed: ", e)
3636
try:

blurry/settings.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import tomllib
12
from os import environ
23
from typing import TypedDict
34

4-
import toml
5-
65
from blurry.constants import CURR_DIR
76
from blurry.constants import ENV_VAR_PREFIX
87
from blurry.constants import SETTINGS_FILENAME
@@ -51,7 +50,7 @@ class Settings(TypedDict):
5150

5251
def update_settings():
5352
try:
54-
blurry_config = toml.load(open(SETTINGS_FILENAME))
53+
blurry_config = tomllib.load(open(SETTINGS_FILENAME, "rb"))
5554
user_settings = blurry_config["blurry"]
5655
for setting, value in user_settings.items():
5756
SETTINGS[setting.upper()] = value

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import nox
22

33

4-
@nox.session(python=["3.13", "3.12", "3.11", "3.10"])
4+
@nox.session(python=["3.13", "3.12", "3.11"])
55
def tests(session):
66
session.install("pytest", ".")
77
session.run("pytest")
88

99

10-
@nox.session(python=["3.13", "3.12", "3.11", "3.10"])
10+
@nox.session(python=["3.13", "3.12", "3.11"])
1111
def typecheck(session):
1212
session.install("pyright", ".")
1313
session.run("pyright")

0 commit comments

Comments
 (0)