Skip to content
Draft
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: 4 additions & 0 deletions eng/scripts/upload-bundler-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
getPackageVersion,
} from "../../core/packages/bundle-uploader/dist/src/index.js";
import { repoRoot } from "./helpers.js";
import { uploadPythonEmitterAssets } from "./upload-python-emitter-assets.js";

await bundleAndUploadPackages({
repoRoot: repoRoot,
Expand All @@ -27,5 +28,8 @@ await bundleAndUploadPackages({
"@azure-tools/typespec-client-generator-core",
"@azure-tools/typespec-azure-resource-manager",
"@azure-tools/typespec-azure-rulesets",
"@azure-tools/typespec-python",
],
});

await uploadPythonEmitterAssets(repoRoot);
28 changes: 28 additions & 0 deletions eng/scripts/upload-python-emitter-assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// @ts-check
import { createRequire } from "module";
import { dirname, resolve } from "path";
import { uploadStandalonePackageAssets } from "../../core/packages/bundle-uploader/dist/src/index.js";

/**
* Upload the pygen wheel from the installed @typespec/http-client-python package.
* The wheel is fetched at runtime in the browser by the inlined http-client-python code.
*
* @param {string} repoRoot
*/
export async function uploadPythonEmitterAssets(repoRoot) {
const typespecPythonRequire = createRequire(
resolve(repoRoot, "packages/typespec-python/package.json"),
);
const httpClientPythonEntry = typespecPythonRequire.resolve("@typespec/http-client-python");
const httpClientPythonPath = resolve(dirname(httpClientPythonEntry), "../..");
Comment thread
JennyPng marked this conversation as resolved.

await uploadStandalonePackageAssets({
packagePath: httpClientPythonPath,
assets: [
{
path: "generator/dist/pygen-*.whl",
contentType: "application/zip",
},
],
});
}
1 change: 1 addition & 0 deletions packages/typespec-azure-playground-website/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const TypeSpecPlaygroundConfig = {
"@azure-tools/typespec-autorest",
"@azure-tools/typespec-client-generator-core",
"@azure-tools/typespec-azure-rulesets",
"@azure-tools/typespec-python",
],
samples,
} as const;
Loading