8000 Remove unused CHM handling by hugovk · Pull Request #148 · python/release-tools · GitHub
[go: up one dir, main page]

Skip to content

Remove unused CHM handling #148

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

Merged
merged 1 commit into from
Jul 31, 2024
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
Remove unused CHM handling
  • Loading branch information
hugovk committed Jul 24, 2024
commit 33e8c1924dbcc8b500f2690a08e8b93335ea66e7
25 changes: 12 additions & 13 deletions add_to_pydotorg.py
Original file line number Diff line number Diff line change
10000 Expand Up @@ -122,7 +122,6 @@
("Windows embeddable package (32-bit)", 1, False, ""),
),
(rx(r"\.exe$"), ("Windows installer (32-bit)", 1, v < (3, 9), "")),
(rx(r"\.chm$"), ("Windows help file", 1, False, "")),
(
rx(r"-macosx10\.5(_rev\d)?\.(dm|pk)g$"),
(
Expand Down Expand Up @@ -259,26 +258,26 @@
for rfile in os.listdir(path.join(ftp_root, reldir)):
if not path.isfile(path.join(ftp_root, reldir, rfile)):
continue

if rfile.endswith((".asc", ".sig", ".crt", ".sigstore", ".spdx.json")):
continue

for prefix in ("python", "Python"):
if rfile.startswith(prefix):
break
else:
print(f" File {reldir}/{rfile} has wrong prefix")
continue
if rfile.endswith(".chm"):
if rfile[:-4] != "python" + release.replace(".", ""):
print(f" File {reldir}/{rfile} has a different version")
continue
else:
try:
prefix, rest = rfile.split("-", 1)
except: # noqa: E722
prefix, rest = rfile, ""
if not rest.startswith((release + "-", release + ".")):
print(f" File {reldir}/{rfile} has a different version")
continue

try:
prefix, rest = rfile.split("-", 1)
except: # noqa: E722
prefix, rest = rfile, ""

Check warning on line 275 in add_to_pydotorg.py

View check run for this annotation

Codecov / codecov/patch

add_to_pydotorg.py#L272-L275

Added lines #L272 - L275 were not covered by tests

if not rest.startswith((release + "-", release + ".")):
print(f" File {reldir}/{rfile} has a different version")
continue

Check warning on line 279 in add_to_pydotorg.py

View check run for this annotation

Codecov / codecov/patch

add_to_pydotorg.py#L277-L279

Added lines #L277 - L279 were not covered by tests

for rx, info in get_file_descriptions(release):
if rx.search(rfile):
file_desc, os_pk, add_download, add_desc = info
Expand Down
2 changes: 1 addition & 1 deletion size.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
sort_order = {
ext: i
for i, ext in enumerate(
("tgz", "tar.bz2", "tar.xz", "pdb.zip", "amd64.msi", "msi", "chm", "dmg")
("tgz", "tar.bz2", "tar.xz", "pdb.zip", "amd64.msi", "msi", "dmg")
)
}

Expand Down
4 changes: 1 addition & 3 deletions tests/test_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
("file.pdb.zip", False),
("file.amd64.msi", False),
("file.msi", False),
("file.chm", False),
("file.dmg", False),
("file.ext", True),
],
Expand All @@ -30,8 +29,7 @@ def test_ignore(filename: str, expected: bool) -> None:
("file.pdb.zip", 3),
("file.amd64.msi", 4),
("file.msi", 5),
("file.chm", 6),
("file.dmg", 7),
("file.dmg", 6),
("file.ext", 9999),
],
)
Expand Down
5 changes: 0 additions & 5 deletions windows-release/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ parameters:
displayName: "Run ARM64 PGO (requires custom VM)"
type: boolean
default: true
- name: DoCHM
displayName: "Produce compiled help document (pre-3.11)"
type: boolean
default: false
- name: DoLayout
displayName: "Produce full layout artifact"
type: boolean
Expand Down Expand Up @@ -109,7 +105,6 @@ variables:
IsRealSigned: true
${{ else }}:
IsRealSigned: false
DoCHM: ${{ parameters.DoCHM }}
DoFreethreaded: ${{ parameters.DoFreethreaded }}
DoLayout: ${{ parameters.DoLayout }}
DoMSIX: ${{ parameters.DoMSIX }}
Expand Down
7 changes: 0 additions & 7 deletions windows-release/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,13 @@ jobs:
env:
BUILDDIR: $(Build.BinariesDirectory)\Doc

- script: Doc\make.bat htmlhelp
displayName: 'Build CHM docs'
condition: and(succeeded(), eq(variables['DoCHM'], 'true'))
env:
BUILDDIR: $(Build.BinariesDirectory)\Doc

- task: CopyFiles@2
displayName: 'Assemble artifact: Doc'
inputs:
sourceFolder: $(Build.BinariesDirectory)\Doc
targetFolder: $(Build.ArtifactStagingDirectory)\Doc
contents: |
html\**\*
htmlhelp\*.chm

- task: PublishPipelineArtifact@0
displayName: 'Publish artifact: doc'
Expand Down
10 changes: 0 additions & 10 deletions windows-release/stage-publish-pythonorg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ jobs:
git clone https://github.com/python/cpython-bin-deps --branch gpg --single-branch --depth 1 --progress -v "gpg"
gpg/gpg2.exe --import "$(gpgkey.secureFilePath)"
$files = gci -File "msi\*\*", "embed\*.zip"
if ("$(DoCHM)" -ieq "true") {
$files = $files + (gci -File "doc\htmlhelp\*.chm")
}
$files.FullName | %{
gpg/gpg2.exe -ba --batch --passphrase $(GPGPassphrase) $_
"Made signature for $_"
Expand Down Expand Up @@ -148,7 +145,6 @@ jobs:
-server $(PyDotOrgServer)
-hostkey $(PyDotOrgHostKey)
-keyfile "$(sshkey.secureFilePath)"
-doc_htmlhelp doc\htmlhelp
-embed embed
-sbom sbom
workingDirectory: $(Build.BinariesDirectory)
Expand Down Expand Up @@ -187,9 +183,6 @@ jobs:
- ${{ each alg in parameters.HashAlgorithms }}:
- powershell: |
$files = gci -File "msi\*\*.exe", "embed\*.zip"
if ("$(DoCHM)" -ieq "true") {
$files = $files + (gci -File "doc\htmlhelp\python*.chm")
}
$hashes = $files | `
Sort-Object Name | `
Format-Table Name, @{
Expand All @@ -206,9 +199,6 @@ jobs:
- powershell: |
"Copying:"
$files = gci -File "msi\*\python*.asc", "embed\*.asc"
if ("$(DoCHM)" -ieq "true") {
$files = $files + (gci -File "doc\htmlhelp\*.asc")
}
$files.FullName
$d = mkdir "$(Build.ArtifactStagingDirectory)\hashes" -Force
move $files $d -Force
Expand Down
13 changes: 0 additions & 13 deletions windows-release/uploadrelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
The subdirectory on the host to copy files to.
.Parameter tests
The path to run download tests in.
.Parameter doc_htmlhelp
Optional path besides -build to locate CHM files.
.Parameter embed
Optional path besides -build to locate ZIP files.
#>
Expand All @@ -28,7 +26,6 @@ param(
[Parameter(Mandatory=$true)][string]$keyfile,
[string]$target="/srv/www.python.org/ftp/python",
[string]$tests=${env:TEMP},
[string]$doc_htmlhelp=$null,
[string]$embed=$null,
[string]$sbom=$null
)
Expand Down Expand Up @@ -69,20 +66,10 @@ $plink = find-putty-tool "plink"
"Upload using $pscp and $plink"
""

if ($doc_htmlhelp) {
$chm = gci -EA 0 $doc_htmlhelp\python*.chm, $doc_htmlhelp\python*.chm.asc
} else {
$chm = gci -EA 0 $build\python*.chm, $build\python*.chm.asc
}

$d = "$target/$($p[0])/"
& $plink -batch -hostkey $hostkey -noagent -i $keyfile "$user@$server" mkdir $d
& $plink -batch -hostkey $hostkey -noagent -i $keyfile "$user@$server" chgrp downloads $d
& $plink -batch -hostkey $hostkey -noagent -i $keyfile "$user@$server" chmod "a+rx" $d
if ($chm) {
& $pscp -batch -hostkey $hostkey -noagent -i $keyfile $chm.FullName "$user@${server}:$d"
if (-not $?) { throw "Failed to upload $chm" }
}

$dirs = gci "$build" -Directory
if ($embed) {
Expand Down
0