From 9f2ca8934b3c5a8129d45c2363baf5dddbb1a9e1 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 12:53:55 -0400 Subject: [PATCH 1/9] publish tar --- eng/pipelines/ci-template.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index 0e062bfb8a9..97a0fe79416 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -139,7 +139,16 @@ steps: - script: | pnpm pack AbsolutePkgPath=$(find "$(pwd)" -name "autorest-python-*" -maxdepth 1) + echo "##vso[task.setvariable variable=PackagePath]$AbsolutePkgPath" cd ../.. pnpm install $AbsolutePkgPath -w --verbose displayName: Test tarball workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}/ + + - task: PublishBuildArtifacts@1 + displayName: Publish ${{ parameters.folderName }} package + inputs: + pathToPublish: '$(PackagePath)' + artifactName: ${{ eq(parameters.folderName, 'typespec-python') && '@azure-tools/typespec-python' || '@autorest/python' }} + publishLocation: 'Container' + From c959825ed6e5fb86ed16da68766d24e21eb46ee2 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 13:13:24 -0400 Subject: [PATCH 2/9] try diff package name --- eng/pipelines/ci-template.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index 97a0fe79416..8b0299840a7 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -138,8 +138,11 @@ steps: - script: | pnpm pack - AbsolutePkgPath=$(find "$(pwd)" -name "autorest-python-*" -maxdepth 1) + AbsolutePkgPath=$(find "$(pwd)" -name "*.tgz" -maxdepth 1) echo "##vso[task.setvariable variable=PackagePath]$AbsolutePkgPath" + # Extract full tarball filename (remove path only) + TarballName=$(basename "$AbsolutePkgPath") + echo "##vso[task.setvariable variable=TarballName]$TarballName" cd ../.. pnpm install $AbsolutePkgPath -w --verbose displayName: Test tarball @@ -149,6 +152,6 @@ steps: displayName: Publish ${{ parameters.folderName }} package inputs: pathToPublish: '$(PackagePath)' - artifactName: ${{ eq(parameters.folderName, 'typespec-python') && '@azure-tools/typespec-python' || '@autorest/python' }} + artifactName: '$(TarballName)' publishLocation: 'Container' From 87765c9ac4ed4832e02f7b102c2750021b31bf31 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 13:27:46 -0400 Subject: [PATCH 3/9] publish in pipeline --- eng/pipelines/ci-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index 8b0299840a7..45d57e8c3f6 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -153,5 +153,5 @@ steps: inputs: pathToPublish: '$(PackagePath)' artifactName: '$(TarballName)' - publishLocation: 'Container' + publishLocation: 'pipeline' From defd618191dcc762c05f22030bcc91e6ef7b4192 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 13:44:14 -0400 Subject: [PATCH 4/9] try as pipeline artifact --- eng/pipelines/ci-template.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index 45d57e8c3f6..46b64cc4939 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -148,10 +148,9 @@ steps: displayName: Test tarball workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}/ - - task: PublishBuildArtifacts@1 + - task: PublishPipelineArtifact@1 displayName: Publish ${{ parameters.folderName }} package inputs: - pathToPublish: '$(PackagePath)' - artifactName: '$(TarballName)' - publishLocation: 'pipeline' - + targetPath: "$(PackagePath)" + artifactName: "$(TarballName)" + publishLocation: "pipeline" From a33d3f163abffd7b1a14040bf0809e626caff9d8 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 14:10:02 -0400 Subject: [PATCH 5/9] try without artifactName input --- eng/pipelines/ci-template.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index 46b64cc4939..2c062c63c59 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -152,5 +152,4 @@ steps: displayName: Publish ${{ parameters.folderName }} package inputs: targetPath: "$(PackagePath)" - artifactName: "$(TarballName)" publishLocation: "pipeline" From de45039968f3e5ab766567b4f1abdf96ebcf59c6 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 14:33:36 -0400 Subject: [PATCH 6/9] add docs --- docs/developer/readme.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/developer/readme.md b/docs/developer/readme.md index c8868ec51dc..cd16dc30f3b 100644 --- a/docs/developer/readme.md +++ b/docs/developer/readme.md @@ -1,6 +1,14 @@ -# Developing and Contributing to Python AutoRest +# Developing and Contributing -Docs will be added. See the [main docs][main_docs] for some information. +## Testing `@azure-tools/typespec-python` Tarballs - -[main_docs]: https://github.com/Azure/autorest/blob/master/docs/developer/readme.md \ No newline at end of file +To test an unpublished branded emitter tarball, please follow these steps: + +1. Go to the pipelines and find the run you'd like to test [here](https://dev.azure.com/azure-sdk/public/_build?definitionId=1316&_a=summary) +2. Open the run and find the artifacts published as part of that run. +3. Choose the published artifact you'd like to test, there will be one for each matrix run. +4. Click on the three dots and click "Copy download url" +5. Copy-paste that url, then head over to the [`emitter-package.json`](https://github.com/Azure/azure-sdk-for-python/blob/main/eng/emitter-package.json) in the [`azure-sdk-for-python`](https://github.com/Azure/azure-sdk-for-python/tree/main) repo +6. Paste the url as the version for the `"@azure-tools/typespec-python"` package +7. Run `tsp-client generate-lock-file` from the `azure-sdk-for-python/eng` folder +8. Go to the sdk you'd like to regenerate with the tarball, then run `tsp-client update` how you normally would From 56aa5b6da0d4efcd7c8a28e7ed3c8ebcd562ef7a Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 14:35:20 -0400 Subject: [PATCH 7/9] only publish if package doesn't exist --- eng/pipelines/ci-template.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index 2c062c63c59..f77eb439846 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -153,3 +153,5 @@ steps: inputs: targetPath: "$(PackagePath)" publishLocation: "pipeline" + artifactName: "$(TarballName)" + condition: and(succeeded(), not(variables['System.ArtifactExists'])) From f8ead3b67265f7054f0a8903a708611007fb6eb1 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 14:45:49 -0400 Subject: [PATCH 8/9] continue on error --- eng/pipelines/ci-template.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index f77eb439846..d28cb6b0ad5 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -155,3 +155,4 @@ steps: publishLocation: "pipeline" artifactName: "$(TarballName)" condition: and(succeeded(), not(variables['System.ArtifactExists'])) + continueOnError: true From d12855d74c8d1c7a5c47271b043e37ef380a5b6b Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Mon, 6 Oct 2025 14:46:51 -0400 Subject: [PATCH 9/9] remove condition --- eng/pipelines/ci-template.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/ci-template.yml b/eng/pipelines/ci-template.yml index d28cb6b0ad5..cc565f49ed1 100644 --- a/eng/pipelines/ci-template.yml +++ b/eng/pipelines/ci-template.yml @@ -154,5 +154,4 @@ steps: targetPath: "$(PackagePath)" publishLocation: "pipeline" artifactName: "$(TarballName)" - condition: and(succeeded(), not(variables['System.ArtifactExists'])) continueOnError: true