Skip to content

Commit 5120cd1

Browse files
committed
Update scripts/release.py to use pyproject.toml
1 parent a47e153 commit 5120cd1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

scripts/release.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import argparse
2-
import configparser
32
import datetime
43
import pathlib
54
import re
65
import shlex
76
import subprocess
87
import sys
8+
import tomllib
99

1010
PROJECT = pathlib.Path(__file__).parent.parent
1111

1212
# These files contain the version string that needs to be updated
1313
citation_file = pathlib.Path('CITATION.cff')
1414
version_files = [
15-
pathlib.Path('setup.cfg'),
15+
pathlib.Path('pyproject.toml'),
1616
citation_file,
1717
]
1818

@@ -201,10 +201,9 @@ def maybe_push(
201201

202202

203203
def get_current_version() -> str:
204-
parser = configparser.ConfigParser()
205-
with open(PROJECT / 'setup.cfg') as f:
206-
parser.read_file(f)
207-
return parser.get('metadata', 'version')
204+
with open(PROJECT / 'pyproject.toml', 'rb') as f:
205+
pyproject = tomllib.load(f)
206+
return pyproject['project']['version']
208207

209208

210209
def call(*args: str) -> None:

0 commit comments

Comments
 (0)