Skip to content
Closed
Show file tree
Hide file tree
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: 5 additions & 4 deletions extremal_python_dependencies/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import re
import configparser
import tomllib
from typing import List

import toml
Expand Down Expand Up @@ -108,8 +109,8 @@ def get_tox_minversion():


def _pin_dependencies(mapfunc, inplace: bool):
with open("pyproject.toml", encoding="utf-8") as f:
d = toml.load(f)
with open("pyproject.toml", "rb") as f:
d = tomllib.load(f)
process_dependencies_in_place(d, mapfunc)

# Modify pyproject.toml so hatchling will allow direct references
Expand All @@ -136,8 +137,8 @@ def pin_dependencies(replacements: List[str], inplace: bool = False):
@app.command()
def add_dependency(dependency: str, inplace: bool = False):
"""Add a dependency to `pyproject.toml`."""
with open("pyproject.toml", encoding="utf-8") as f:
d = toml.load(f)
with open("pyproject.toml", "rb") as f:
d = tomllib.load(f)
d["project"]["dependencies"].append(dependency)
_save_pyproject_toml(d, inplace)

Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ classifiers = [
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

requires-python = ">=3.10"
requires-python = ">=3.11"

dependencies = [
"toml==0.10.2",
Expand Down Expand Up @@ -56,7 +55,7 @@ only-include = [
]

[tool.pylint.main]
py-version = "3.10"
py-version = "3.11"
disable = [
"missing-function-docstring",
]
Expand Down
Loading