Skip to content

Commit 60e5527

Browse files
authored
Enable py2docfx docs gen tool, remove the dockerimage docs validation (#38085)
* Enable py2docfx docs gen tool, remove the dockerimage docs validation * Remove the --no-venv-required flag from the command line which was a leftover copy/paste from the original PR * Change the version to a pre-release for testing as the released version doesn't appear to have these changes * Update py2docfx version since previous version had problems on Linux * Change the python command to add -u so the sdtout and stderr streams are unbuffered and we see the full output * Updates for feedback and to see what's going on with the output * Remove the Get-Content line which should have been removed in the last commit * Print the command output on actual different lines * Finish the sentence in the comment
1 parent 22c49da commit 60e5527

File tree

6 files changed

+170
-188
lines changed

6 files changed

+170
-188
lines changed

eng/pipelines/docindex.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@ jobs:
1414
DocRepoName: azure-docs-sdk-python
1515
DocValidationImageId: azuresdkimages.azurecr.io/pyrefautocr:latest
1616
steps:
17-
# Docs CI uses Python 3.9.13
17+
# py2docfx requires Python >= 3.11
1818
- task: UsePythonVersion@0
19-
displayName: 'Use Python 3.9.13'
19+
displayName: 'Use Python 3.11'
2020
inputs:
21-
versionSpec: '3.9.13'
21+
versionSpec: '3.11'
2222

2323
# Docs CI upgrades pip, wheel, and setuptools
2424
- pwsh: python -m pip install --upgrade pip wheel setuptools
2525
displayName: Update python tools for package verification
2626

27-
# Pull and build the docker image.
28-
- template: /eng/common/pipelines/templates/steps/docker-pull-image.yml
29-
parameters:
30-
ImageId: "$(DocValidationImageId)"
3127
# Sync docs repo onboarding files/folders
3228
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
3329
parameters:
@@ -41,6 +37,8 @@ jobs:
4137
- Name: $(DocRepoOwner)/$(DocRepoName)
4238
WorkingDirectory: $(DocRepoLocation)
4339

40+
- template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml
41+
4442
- task: Powershell@2
4543
inputs:
4644
pwsh: true
@@ -53,7 +51,7 @@ jobs:
5351
inputs:
5452
pwsh: true
5553
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
56-
arguments: -DocRepoLocation $(DocRepoLocation) -ImageId '$(DocValidationImageId)'
54+
arguments: -DocRepoLocation $(DocRepoLocation)
5755
displayName: Update Docs Onboarding for main branch
5856
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))
5957

@@ -92,7 +90,7 @@ jobs:
9290
parameters:
9391
BaseRepoBranch: $(DefaultBranch)
9492
BaseRepoOwner: $(DocRepoOwner)
95-
CommitMsg: "Update docs CI configuration"
93+
CommitMsg: "Update docs CI configuration Build: $(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
9694
TargetRepoName: $(DocRepoName)
9795
TargetRepoOwner: $(DocRepoOwner)
9896
WorkingDirectory: $(DocRepoLocation)

eng/pipelines/templates/stages/archetype-python-release.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ parameters:
99
TargetDocRepoOwner: ''
1010
TargetDocRepoName: ''
1111
PackageSourceOverride: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
12-
DocValidationImageId: "azuresdkimages.azurecr.io/pyrefautocr:latest"
1312

1413
stages:
1514
- ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}:
@@ -232,6 +231,15 @@ stages:
232231
- sdk/**/*.md
233232
- .github/CODEOWNERS
234233
- download: current
234+
235+
# py2docfx requires Python >= 3.11
236+
- task: UsePythonVersion@0
237+
displayName: 'Use Python 3.11'
238+
inputs:
239+
versionSpec: '3.11'
240+
241+
- template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml
242+
235243
- template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml
236244
parameters:
237245
PackageInfoLocations:
@@ -244,7 +252,6 @@ stages:
244252
- docs-ref-services/
245253
- metadata/
246254
PackageSourceOverride: ${{parameters.PackageSourceOverride}}
247-
DocValidationImageId: ${{parameters.DocValidationImageId}}
248255

249256
- deployment: UpdatePackageVersion
250257
displayName: "Update Package Version"
@@ -351,6 +358,14 @@ stages:
351358
Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}/
352359
displayName: Show visible artifacts
353360
361+
# py2docfx requires Python >= 3.11
362+
- task: UsePythonVersion@0
363+
displayName: 'Use Python 3.11'
364+
inputs:
365+
versionSpec: '3.11'
366+
367+
- template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml
368+
354369
- template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml
355370
parameters:
356371
PackageInfoLocations:
@@ -366,6 +381,5 @@ stages:
366381
- docs-ref-services/
367382
- metadata/
368383
PackageSourceOverride: ${{parameters.PackageSourceOverride}}
369-
DocValidationImageId: ${{parameters.DocValidationImageId}}
370384

371385
- template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
steps:
2+
- pwsh: |
3+
Write-Host "python -m pip install -r eng/scripts/docs/py2docfx_requirements.txt"
4+
python -m pip install -r eng/scripts/docs/py2docfx_requirements.txt
5+
# After install py2docfx,
6+
Write-Host "Testing the install. Running python -m py2docfx -h to display the help"
7+
python -m py2docfx -h
8+
displayName: Install py2docfx for package validation

eng/scripts/Language-Settings.ps1

-30
Original file line numberDiff line numberDiff line change
@@ -440,36 +440,6 @@ function Import-Dev-Cert-python
440440
"The variables SSL_CERT_DIR, SSL_CERT_FILE, and REQUESTS_CA_BUNDLE are now dynamically set in proxy_startup.py"
441441
}
442442

443-
# Defined in common.ps1 as:
444-
# $ValidateDocsMsPackagesFn = "Validate-${Language}-DocMsPackages"
445-
function Validate-Python-DocMsPackages ($PackageInfo, $PackageInfos, $PackageSourceOverride, $DocValidationImageId)
446-
{
447-
# While eng/common/scripts/Update-DocsMsMetadata.ps1 is still passing a single packageInfo, process as a batch
448-
if (!$PackageInfos) {
449-
$PackageInfos = @($PackageInfo)
450-
}
451-
452-
$allSucceeded = $true
453-
foreach ($item in $PackageInfos) {
454-
# If the Version is IGNORE that means it's a source install and those aren't run through ValidatePackage
455-
if ($item.Version -eq 'IGNORE') {
456-
continue
457-
}
458-
459-
$result = ValidatePackage `
460-
-packageName $item.Name `
461-
-packageVersion "==$($item.Version)" `
462-
-PackageSourceOverride $PackageSourceOverride `
463-
-DocValidationImageId $DocValidationImageId
464-
465-
if (!$result) {
466-
$allSucceeded = $false
467-
}
468-
}
469-
470-
return $allSucceeded
471-
}
472-
473443
function Get-python-EmitterName() {
474444
return "@azure-tools/typespec-python"
475445
}

0 commit comments

Comments
 (0)