File: use_setuptools.py

package info (click to toggle)
python-tomli 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,208 kB
  • sloc: python: 1,129; makefile: 7
file content (12 lines) | stat: -rw-r--r-- 402 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
from pathlib import Path
import tomllib

import tomli_w  # type: ignore[import-not-found]

pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
data = tomllib.loads(pyproject_path.read_bytes().decode())
data["build-system"] = {
    "requires": ["setuptools>=69", "mypy[mypyc]>=1.13"],
    "build-backend": "setuptools.build_meta",
}
pyproject_path.write_bytes(tomli_w.dumps(data).encode())