diff --git a/packages/jsii-pacmak/generate.sh b/packages/jsii-pacmak/generate.sh index 35af21b858..1584183c43 100644 --- a/packages/jsii-pacmak/generate.sh +++ b/packages/jsii-pacmak/generate.sh @@ -14,10 +14,10 @@ VERSION=$(node -p "require('./package.json').version.replace(/\\+[0-9a-f]+\$/, ' cat > lib/version.ts < { if (value.partOfCompilation) { diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 0a7a010423..e5915a99a1 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -18,6 +18,7 @@ import { warn } from '../logging'; import { md2rst } from '../markdown'; import { Target, TargetOptions } from '../target'; import { shell } from '../util'; +import { VERSION } from '../version'; import { renderSummary, PropertyDefinition } from './_utils'; import { NamingContext, @@ -2080,12 +2081,6 @@ class Package { ); code.closeFile('README.md'); - // Strip " (build abcdef)" from the jsii version - const jsiiVersionSimple = toReleaseVersion( - this.metadata.jsiiVersion.replace(/ .*$/, ''), - TargetName.PYTHON, - ); - const setupKwargs = { name: this.name, version: this.version, @@ -2109,7 +2104,7 @@ class Package { package_data: packageData, python_requires: '~=3.7', install_requires: [ - `jsii${toPythonVersionRange(`^${jsiiVersionSimple}`)}`, + `jsii${toPythonVersionRange(`^${VERSION}`)}`, 'publication>=0.0.3', 'typeguard~=2.13.3', ] diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap index fb35301af4..7323da788f 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap @@ -84,7 +84,7 @@ exports[`foo@1.2.3 depends on bar@^2.0.0-rc.42: /dotnet/Com.Acme.Foo/Com - + @@ -453,7 +453,7 @@ kwargs = json.loads( "python_requires": "~=3.7", "install_requires": [ "bar>=2.0.0.rc42, <3.0.0", - "jsii>=1337.42.1337, <1338.0.0", + "jsii<0.0.1", "publication>=0.0.3", "typeguard~=2.13.3" ], @@ -595,7 +595,7 @@ exports[`foo@1.2.3 depends on bar@^4.5.6-pre.1337: /dotnet/Com.Acme.Foo/ - + @@ -964,7 +964,7 @@ kwargs = json.loads( "python_requires": "~=3.7", "install_requires": [ "bar>=4.5.6.dev1337, <5.0.0", - "jsii>=1337.42.1337, <1338.0.0", + "jsii<0.0.1", "publication>=0.0.3", "typeguard~=2.13.3" ], @@ -1106,7 +1106,7 @@ exports[`foo@2.0.0-rc.42: /dotnet/Com.Acme.Foo/Com.Acme.Foo.csproj 1`] = - + @@ -1454,7 +1454,7 @@ kwargs = json.loads( }, "python_requires": "~=3.7", "install_requires": [ - "jsii>=1337.42.1337, <1338.0.0", + "jsii<0.0.1", "publication>=0.0.3", "typeguard~=2.13.3" ], @@ -1594,7 +1594,7 @@ exports[`foo@4.5.6-pre.1337: /dotnet/Com.Acme.Foo/Com.Acme.Foo.csproj 1` - + @@ -1942,7 +1942,7 @@ kwargs = json.loads( }, "python_requires": "~=3.7", "install_requires": [ - "jsii>=1337.42.1337, <1338.0.0", + "jsii<0.0.1", "publication>=0.0.3", "typeguard~=2.13.3" ],