Remove setuptools_scm and set version in pyproject.toml (#6550)

This commit is contained in:
Amaury Chamayou 2024-10-09 11:53:58 +01:00 коммит произвёл GitHub
Родитель c70e2be956
Коммит d61931a4ab
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 16 добавлений и 9 удалений

Просмотреть файл

@ -1,12 +1,10 @@
[build-system]
requires = ["setuptools>=71.0", "setuptools_scm>=8"]
requires = ["setuptools>=71.0"]
build-backend = "setuptools.build_meta"
[project]
name = "ccf"
# Automatically extract version number from git environment
# See https://github.com/pypa/setuptools_scm for details
dynamic = ["version"]
version = "6.0.0-dev1"
authors = [
{ name="CCF Team", email="CCF-Sec@microsoft.com" },
]
@ -33,11 +31,6 @@ script-files = [
"utils/verify_quote.sh"
]
[tool.setuptools_scm]
version_file = "src/ccf/version.py"
root = ".."
git_describe_command = "git describe --tags --long --match \"ccf-*\""
[project.urls]
Homepage = "https://github.com/microsoft/ccf"
Issues = "https://github.com/microsoft/ccf/issues"

Просмотреть файл

@ -68,6 +68,16 @@ def main():
release_notes = {}
links_found = []
# Check that pyproject.toml is up to date
# Once we have upgraded to Python 3.11, we can use tomllib to parse pyproject.toml
pyproject_version = None
with open("python/pyproject.toml") as pyproject:
for line in pyproject:
if line.startswith("version"):
_, version = line.split("=")
pyproject_version = version.strip().strip('"')
assert pyproject_version is not None, "Could not find version in pyproject.toml"
# Parse file, bucketing lines into each version's release notes
current_release_notes = None
with open(args.changelog) as f:
@ -75,6 +85,10 @@ def main():
if match := version_header.match(line):
log_version = match.group(1)
current_release_notes = []
if not release_notes:
assert (
log_version == pyproject_version
), f"First version in CHANGELOG must match version in pyproject.toml: {pyproject_version}"
release_notes[log_version] = current_release_notes
elif match := link_definition.match(line):
link_version = match.group(1)