mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-16 11:31:02 +02:00
fix: derive runtime versions from release metadata
This commit is contained in:
parent
1c30abc51d
commit
8aea27bfbe
18 changed files with 231 additions and 50 deletions
26
scripts/public-npm-release-metadata.test.mjs
Normal file
26
scripts/public-npm-release-metadata.test.mjs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import { describe, it } from 'node:test';
|
||||
|
||||
import { publicNpmPackageVersionToPythonVersion } from './public-npm-release-metadata.mjs';
|
||||
|
||||
describe('publicNpmPackageVersionToPythonVersion', () => {
|
||||
it('keeps stable public npm versions unchanged for Python wheels', () => {
|
||||
assert.equal(publicNpmPackageVersionToPythonVersion('1.2.3'), '1.2.3');
|
||||
});
|
||||
|
||||
it('converts semantic-release rc versions to PEP 440 rc versions', () => {
|
||||
assert.equal(publicNpmPackageVersionToPythonVersion('0.1.0-rc.1'), '0.1.0rc1');
|
||||
assert.equal(publicNpmPackageVersionToPythonVersion('2.0.0-rc.12'), '2.0.0rc12');
|
||||
});
|
||||
|
||||
it('rejects unsupported prerelease and build metadata forms', () => {
|
||||
assert.throws(
|
||||
() => publicNpmPackageVersionToPythonVersion('1.2.3-beta.1'),
|
||||
/Unsupported public npm prerelease for Python runtime version/,
|
||||
);
|
||||
assert.throws(
|
||||
() => publicNpmPackageVersionToPythonVersion('1.2.3+build.1'),
|
||||
/Unsupported public npm build metadata for Python runtime version/,
|
||||
);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue