-
Notifications
You must be signed in to change notification settings - Fork 4
Fix releasing #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix releasing #131
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+59
to
+67
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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)) | |
| async function replaceInFile(filename, searchText, replacementText) { | |
| return await fs.readFile(filename, 'utf8') | |
| .then(text => { | |
| if (text.indexOf(searchText) < 0) { | |
| throw new Error('Not the correct version. Could not find ' + searchText + ' in ' + filename) | |
| } | |
| return text | |
| }) | |
| .then(text => text.replace(searchText, replacementText)) |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message incorrectly refers to the parameter as 'latestVersion' when it's actually the second parameter passed to the function. The error message should be more accurate to reflect that it's checking for the presence of the search text. For clarity, consider updating the error message to match the actual purpose of the check.
| 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)) | |
| async function replaceInFile(filename, searchText, nextVersion) { | |
| return await fs.readFile(filename, 'utf8') | |
| .then(text => { | |
| if (text.indexOf(searchText) < 0) { | |
| throw new Error('Could not find search text "' + searchText + '" in ' + filename) | |
| } | |
| return text | |
| }) | |
| .then(text => text.replace(searchText, nextVersion)) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the [tool.setuptools] packages configuration is likely the root cause of the incomplete release. Without explicitly specifying packages = ["seatsio"], setuptools won't know which package to include in the distribution, resulting in an empty or incomplete package. This configuration should be kept to ensure the seatsio package is properly included in the release.