fix python versions

This commit is contained in:
Caelan Sayler
2025-06-14 15:57:59 +01:00
committed by Caelan
parent 5c952c0710
commit 8cda06cfd7
5 changed files with 23 additions and 162 deletions

View File

@@ -4,6 +4,7 @@ param(
$originalLocation = Get-Location
# setting cargo workspace version
$scriptDir = "$PSScriptRoot/.."
$path = Join-Path $scriptDir "Cargo.toml"
Write-Host "Setting version to $version"
@@ -17,9 +18,28 @@ Write-Host "Setting version to $version"
}
} | Set-Content $path
# setting nodejs version
Set-Location "$scriptDir/src/lib-nodejs"
npm version $version --no-git-tag-version
# setting pyproject.toml version
$pyprojectPath = [IO.Path]::Combine($scriptDir, 'src', 'lib-python', 'pyproject.toml')
$pythonVersion = $version
if ($pythonVersion -match '-g') {
$pythonVersion = $pythonVersion -replace '-g', '.dev+'
}
(Get-Content $pyprojectPath) | ForEach-Object {
if ($_ -match '^version\s*=\s*".*"') {
$_ -replace '^version\s*=\s*".*"', "version = `"$pythonVersion`""
}
else {
$_
}
} | Set-Content $pyprojectPath
# copying README.md
Copy-Item -Path "$scriptDir/README_NUGET.md" -Destination "$scriptDir/src/lib-nodejs/README.md" -Force
Copy-Item -Path "$scriptDir/README_NUGET.md" -Destination "$scriptDir/src/lib-rust/README.md" -Force