Skip to content

Commit c1813ac

Browse files
committed
deps: update setuptools_scm, switch to tomli
1 parent 4a577d1 commit c1813ac

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ classifiers =
2626
[options]
2727
packages = setuptools_rust
2828
zip_safe = True
29-
install_requires = setuptools>=46.1; semantic_version>=2.6.0; toml>=0.9.0; typing_extensions>=3.7.4.3
30-
setup_requires = setuptools>=46.1; setuptools_scm[toml]>=3.4.3
29+
install_requires = setuptools>=46.1; semantic_version>=2.6.0; tomli>=1.2.1; typing_extensions>=3.7.4.3
30+
setup_requires = setuptools>=46.1; setuptools_scm>=6.3.2
3131
python_requires = >=3.6
3232

3333
[options.entry_points]

setuptools_rust/extension.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import Dict, List, Optional, Union
66

77
import semantic_version
8+
import tomli
89
from typing_extensions import Literal
910

1011

@@ -145,10 +146,8 @@ def __init__(
145146

146147
def get_lib_name(self):
147148
"""Parse Cargo.toml to get the name of the shared library."""
148-
# We import in here to make sure the the setup_requires are already installed
149-
import toml
150-
151-
cfg = toml.load(self.path)
149+
with open(self.path, "rb") as f:
150+
cfg = tomli.load(f)
152151
name = cfg.get("lib", {}).get("name")
153152
if name is None:
154153
name = cfg.get("package", {}).get("name")

0 commit comments

Comments
 (0)