diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d24b53..446990a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: VERSION_TO_BUMP: ${{ inputs.versionToBump }} GH_TOKEN: ${{ github.token }} - run: rm -Rf node_modules - - run: uv build --sdist + - run: uv build - uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ diff --git a/pyproject.toml b/pyproject.toml index 5d52c8d..3ec14f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,5 +25,8 @@ Repository = "https://github.com/seatsio/seatsio-python/" Issues = "https://github.com/seatsio/seatsio-python/issues" [build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" \ No newline at end of file +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +include = ["seatsio*"] diff --git a/release.mjs b/release.mjs index b67d65e..0e20ccc 100755 --- a/release.mjs +++ b/release.mjs @@ -52,21 +52,21 @@ async function determineNextVersionNumber(previous) { return semver.inc(previous, versionToBump) } -async function bumpVersionInFiles() { - await replaceInFile("pyproject.toml", `version = "${latestVersion}"`, `version = "${nextVersion}"`) +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 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 bumpVersionInFiles() { + await ensurePyProjectVersionMatchesTheLatestTag() + await $`uv version ${nextVersion}` + await gitAdd("pyproject.toml") + await gitAdd("uv.lock") } 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" },