Skip to content

Commit 85a5a4d

Browse files
authored
fix conflicting versions (#198)
1 parent ff23b00 commit 85a5a4d

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ tag = False
44
current_version = 1.0.129
55
message = Bump version: {current_version} → {new_version} [skip ci]
66

7-
[bumpversion:file:setup.py]
8-
search = version="{current_version}"
9-
replace = version="{new_version}"
7+
[bumpversion:file:pyproject.toml]
8+
search = version = "{current_version}"
9+
replace = version = "{new_version}"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "graph_weather"
33
requires-python = ">=3.11"
4-
version = "1.0.89"
4+
version = "1.0.129"
55
description = "Graph-based AI Weather models"
66
authors = [
77
{name = "Jacob Prince-Bieker", email = "jacob@bieker.tech"},

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
"""Setup"""
22

3+
import re
34
from pathlib import Path
45

56
from setuptools import find_packages, setup
67

78
this_directory = Path(__file__).parent
89
long_description = (this_directory / "README.md").read_text()
910

11+
12+
# Read version from pyproject.toml (single source of truth)
13+
def get_version():
14+
pyproject_path = this_directory / "pyproject.toml"
15+
content = pyproject_path.read_text()
16+
match = re.search(r'^version\s*=\s*"([^"]+)"', content, re.MULTILINE)
17+
if match:
18+
return match.group(1)
19+
raise RuntimeError("Unable to find version string in pyproject.toml")
20+
21+
1022
setup(
1123
name="graph_weather",
12-
version="1.0.129",
24+
version=get_version(),
1325
packages=find_packages(),
1426
url="https://github.com/openclimatefix/graph_weather",
1527
license="MIT License",

0 commit comments

Comments
 (0)