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

Enable py2docfx docs gen tool, remove the dockerimage docs validation #38085

Merged
merged 12 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
16 changes: 7 additions & 9 deletions eng/pipelines/docindex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@ jobs:
DocRepoName: azure-docs-sdk-python
DocValidationImageId: azuresdkimages.azurecr.io/pyrefautocr:latest
steps:
# Docs CI uses Python 3.9.13
# py2docfx requires Python >= 3.11
- task: UsePythonVersion@0
displayName: 'Use Python 3.9.13'
displayName: 'Use Python 3.11'
inputs:
versionSpec: '3.9.13'
versionSpec: '3.11'

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

# Pull and build the docker image.
- template: /eng/common/pipelines/templates/steps/docker-pull-image.yml
parameters:
ImageId: "$(DocValidationImageId)"
# Sync docs repo onboarding files/folders
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
Expand All @@ -41,6 +37,8 @@ jobs:
- Name: $(DocRepoOwner)/$(DocRepoName)
WorkingDirectory: $(DocRepoLocation)

- template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml

- task: Powershell@2
inputs:
pwsh: true
Expand All @@ -53,7 +51,7 @@ jobs:
inputs:
pwsh: true
filePath: eng/common/scripts/Update-DocsMsPackages.ps1
arguments: -DocRepoLocation $(DocRepoLocation) -ImageId '$(DocValidationImageId)'
arguments: -DocRepoLocation $(DocRepoLocation)
displayName: Update Docs Onboarding for main branch
condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true')))

Expand Down Expand Up @@ -92,7 +90,7 @@ jobs:
parameters:
BaseRepoBranch: $(DefaultBranch)
BaseRepoOwner: $(DocRepoOwner)
CommitMsg: "Update docs CI configuration"
CommitMsg: "Update docs CI configuration Build: $(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
TargetRepoName: $(DocRepoName)
TargetRepoOwner: $(DocRepoOwner)
WorkingDirectory: $(DocRepoLocation)
Expand Down
20 changes: 17 additions & 3 deletions eng/pipelines/templates/stages/archetype-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ parameters:
TargetDocRepoOwner: ''
TargetDocRepoName: ''
PackageSourceOverride: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
DocValidationImageId: "azuresdkimages.azurecr.io/pyrefautocr:latest"

stages:
- ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}:
Expand Down Expand Up @@ -232,6 +231,15 @@ stages:
- sdk/**/*.md
- .github/CODEOWNERS
- download: current

# py2docfx requires Python >= 3.11
- task: UsePythonVersion@0
displayName: 'Use Python 3.11'
inputs:
versionSpec: '3.11'

- template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml

- template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml
parameters:
PackageInfoLocations:
Expand All @@ -244,7 +252,6 @@ stages:
- docs-ref-services/
- metadata/
PackageSourceOverride: ${{parameters.PackageSourceOverride}}
DocValidationImageId: ${{parameters.DocValidationImageId}}

- deployment: UpdatePackageVersion
displayName: "Update Package Version"
Expand Down Expand Up @@ -351,6 +358,14 @@ stages:
Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}/
displayName: Show visible artifacts

# py2docfx requires Python >= 3.11
- task: UsePythonVersion@0
displayName: 'Use Python 3.11'
inputs:
versionSpec: '3.11'

- template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml

- template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml
parameters:
PackageInfoLocations:
Expand All @@ -366,6 +381,5 @@ stages:
- docs-ref-services/
- metadata/
PackageSourceOverride: ${{parameters.PackageSourceOverride}}
DocValidationImageId: ${{parameters.DocValidationImageId}}

- template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
steps:
- pwsh: |
$py2docfxVer = Get-Content eng/scripts/docs/py2docfx.version.txt
Write-Host "python -m pip install py2docfx==$py2docfxVer"
python -m pip install py2docfx==$py2docfxVer
# After install py2docfx,
Write-Host "Testing the install. Running python -m py2docfx -h to display the help"
python -m py2docfx -h
displayName: Install py2docfx for package validation
30 changes: 0 additions & 30 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -427,36 +427,6 @@ function Import-Dev-Cert-python
"The variables SSL_CERT_DIR, SSL_CERT_FILE, and REQUESTS_CA_BUNDLE are now dynamically set in proxy_startup.py"
}

# Defined in common.ps1 as:
# $ValidateDocsMsPackagesFn = "Validate-${Language}-DocMsPackages"
function Validate-Python-DocMsPackages ($PackageInfo, $PackageInfos, $PackageSourceOverride, $DocValidationImageId)
{
# While eng/common/scripts/Update-DocsMsMetadata.ps1 is still passing a single packageInfo, process as a batch
if (!$PackageInfos) {
$PackageInfos = @($PackageInfo)
}

$allSucceeded = $true
foreach ($item in $PackageInfos) {
# If the Version is IGNORE that means it's a source install and those aren't run through ValidatePackage
if ($item.Version -eq 'IGNORE') {
continue
}

$result = ValidatePackage `
-packageName $item.Name `
-packageVersion "==$($item.Version)" `
-PackageSourceOverride $PackageSourceOverride `
-DocValidationImageId $DocValidationImageId

if (!$result) {
$allSucceeded = $false
}
}

return $allSucceeded
}

danieljurek marked this conversation as resolved.
Show resolved Hide resolved
function Get-python-EmitterName() {
return "@azure-tools/typespec-python"
}
Expand Down
Loading