Skip to content
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(pacmak): runtime dependency should match pacmak release #4013

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/jsii-pacmak/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ VERSION=$(node -p "require('./package.json').version.replace(/\\+[0-9a-f]+\$/, '
cat > lib/version.ts <<HERE
// Generated at $(date -u +"%Y-%m-%dT%H:%M:%SZ") by generate.sh

/** The short version number for this JSII compiler (e.g: \`X.Y.Z\`) */
/** The short version number for this jsii-pacmak release (e.g: \`X.Y.Z\`) */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const VERSION: string = '${VERSION}';

/** The qualified version number for this JSII compiler (e.g: \`X.Y.Z (build #######)\`) */
/** The qualified version number for this jsii-pacmak release (e.g: \`X.Y.Z (build #######)\`) */
export const VERSION_DESC = '${VERSION} (build ${commit:0:7}${suffix:-})';
HERE
6 changes: 2 additions & 4 deletions packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as xmlbuilder from 'xmlbuilder';

import { TargetName } from '..';
import * as logging from '../../logging';
import { VERSION } from '../../version';
import { TARGET_FRAMEWORK } from '../dotnet';
import { toNuGetVersionRange, toReleaseVersion } from '../version-utils';
import { DotNetNameUtils } from './nameutils';
Expand Down Expand Up @@ -119,13 +120,10 @@ export class FileGenerator {
const embeddedResource = itemGroup1.ele('EmbeddedResource');
embeddedResource.att('Include', this.tarballFileName);

// Strip " (build abcdef)" from the jsii version
const jsiiVersion = assembly.jsiiVersion.replace(/ .*$/, '');

const itemGroup2 = rootNode.ele('ItemGroup');
const packageReference = itemGroup2.ele('PackageReference');
packageReference.att('Include', 'Amazon.JSII.Runtime');
packageReference.att('Version', toNuGetVersionRange(`^${jsiiVersion}`));
packageReference.att('Version', toNuGetVersionRange(`^${VERSION}`));

dependencies.forEach((value: DotNetDependency) => {
if (value.partOfCompilation) {
Expand Down
9 changes: 2 additions & 7 deletions packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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',
]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.