diff --git a/pyproject.toml b/pyproject.toml index 0b91b3c..5d52c8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "seatsio" -version = "83.2.0" +version = "83.3.0" description = "The official Seats.io Python SDK" readme = "README.md" requires-python = ">=3.9" @@ -26,7 +26,4 @@ Issues = "https://github.com/seatsio/seatsio-python/issues" [build-system] requires = ["setuptools"] -build-backend = "setuptools.build_meta" - -[tool.setuptools] -packages = ["seatsio"] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/release.mjs b/release.mjs index 0e20ccc..b67d65e 100755 --- a/release.mjs +++ b/release.mjs @@ -52,21 +52,21 @@ async function determineNextVersionNumber(previous) { return semver.inc(previous, versionToBump) } -async function ensurePyProjectVersionMatchesTheLatestTag() { - const pyproject = await fs.readFile("pyproject.toml", "utf8") - const match = pyproject.match(/^\s*version\s*=\s*"([^"]+)"\s*$/m) - if (!match) throw new Error("Could not find version in pyproject.toml") - const currentVersion = match[1] - if (currentVersion !== latestVersion) { - throw new Error(`pyproject.toml version (${currentVersion}) does not match latest release tag (${latestVersion})`) - } +async function bumpVersionInFiles() { + await replaceInFile("pyproject.toml", `version = "${latestVersion}"`, `version = "${nextVersion}"`) } -async function bumpVersionInFiles() { - await ensurePyProjectVersionMatchesTheLatestTag() - await $`uv version ${nextVersion}` - await gitAdd("pyproject.toml") - await gitAdd("uv.lock") +async function replaceInFile(filename, latestVersion, nextVersion) { + return await fs.readFile(filename, 'utf8') + .then(text => { + if (text.indexOf(latestVersion) < 0) { + throw new Error('Not the correct version. Could not find ' + latestVersion + ' in ' + filename) + } + return text + }) + .then(text => text.replace(latestVersion, nextVersion)) + .then(text => fs.writeFileSync(filename, text)) + .then(() => gitAdd(filename)) } async function gitAdd(filename) { diff --git a/uv.lock b/uv.lock index 57ac314..24ff74f 100644 --- a/uv.lock +++ b/uv.lock @@ -295,7 +295,7 @@ wheels = [ [[package]] name = "seatsio" -version = "83.2.0" +version = "83.3.0" source = { editable = "." } dependencies = [ { name = "future" },