MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / update_version

Function update_version

scripts/prepare_release.py:157–198  ·  view source on GitHub ↗
(version: str)

Source from the content-addressed store, hash-verified

155
156
157def update_version(version: str) -> None:
158 # 1. Replace "In Progress" in HISTORY.md
159 replace_in_file(
160 "HISTORY.md",
161 dict(
162 pattern=r"# In Progress\n",
163 repl=f"# TileDB v{version} Release Notes\n",
164 ),
165 )
166
167 # 2. replace major, minor, patch in tiledb/sm/c_api/tiledb_version.h
168 major, minor, patch = version.split(".")
169 logging.info(f"Updating 'tiledb_version.h' to {major}.{minor}.{patch}")
170 replace_in_file(
171 "tiledb/sm/c_api/tiledb_version.h",
172 dict(
173 pattern=r"#define TILEDB_VERSION_MAJOR \d+\n",
174 repl=f"#define TILEDB_VERSION_MAJOR {major}\n",
175 ),
176 dict(
177 pattern=r"#define TILEDB_VERSION_MINOR \d+\n",
178 repl=f"#define TILEDB_VERSION_MINOR {minor}\n",
179 ),
180 dict(
181 pattern=r"#define TILEDB_VERSION_PATCH \d+\n",
182 repl=f"#define TILEDB_VERSION_PATCH {patch}\n",
183 ),
184 )
185
186 # 3. replace version and release in doc/source/conf.py
187 logging.info(f"Updating 'sphinx conf.py' to {major}.{minor}.{patch}")
188 replace_in_file(
189 sphinx_conf_file,
190 dict(
191 pattern=r"version = '\d+\.\d+'\n",
192 repl=f"version = '{major}.{minor}'\n",
193 ),
194 dict(
195 pattern=r"release = '\d+\.\d+\.\d+'\n",
196 repl=f"release = '{major}.{minor}.{patch}'\n",
197 ),
198 )
199
200
201def replace_in_file(path: str, *replacement_kwargs: Dict[str, Any]) -> None:

Callers 1

mainFunction · 0.85

Calls 3

replace_in_fileFunction · 0.85
splitMethod · 0.80
infoMethod · 0.45

Tested by

no test coverage detected