Skip to content

Add translations setup#20

Merged
m-aciek merged 29 commits into
mainfrom
copilot/add-translations-setup
Apr 30, 2026
Merged

Add translations setup#20
m-aciek merged 29 commits into
mainfrom
copilot/add-translations-setup

Conversation

@m-aciek
Copy link
Copy Markdown
Owner

@m-aciek m-aciek commented Apr 15, 2026

Packages needed for Japanese PDF: python/docsbuild-scripts#149 (comment)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 057be18d98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/build.yaml Outdated
@m-aciek
Copy link
Copy Markdown
Owner Author

m-aciek commented Apr 20, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd5dfb615e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/schedule.yaml
@m-aciek
Copy link
Copy Markdown
Owner Author

m-aciek commented Apr 21, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 551b615946

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/schedule.yaml Outdated
Comment thread .github/workflows/schedule.yaml Outdated
@m-aciek
Copy link
Copy Markdown
Owner Author

m-aciek commented Apr 22, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5d68dc403

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/schedule.yaml Outdated
artifacts = Path("artifacts")
site = Path("_site")
name_re = re.compile(
r"^python-(\d+\.\d+)[\d.]*(?:-(?!docs|pdf)([a-zA-Z][a-zA-Z0-9_-]*))?-(?:docs|pdf)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse language tag correctly for translated PDF artifacts

The artifact regex here allows hyphens inside the language capture, so translated PDF names like python-3.14.0-fr-docs-pdf-a4.zip are parsed with language fr-docs (the capture greedily consumes -docs and leaves -pdf for the suffix). That sends translated PDFs to _site/fr-docs/<version>/ instead of _site/fr/<version>/, so PDF downloads are missing from the expected language directory.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/schedule.yaml Outdated
artifacts = Path("artifacts")
site = Path("_site")
name_re = re.compile(
r"^python-(\d+\.\d+)[\d.]*(?:-(?!docs|pdf)([a-zA-Z][a-zA-Z0-9_-]*))?-(?:docs|pdf)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Accept prerelease dist versions when routing artifacts

This pattern only allows [\d.]* after <major.minor>, so filenames that include prerelease suffixes (for example python-3.16.0a0-docs-html.zip) do not match and are skipped. Because the matrix includes non-EOL/non-planned branches, prerelease branches can still be built, and their artifacts will never be copied into _site when the dist version contains a, b, or rc markers.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't expect prerelease suffixes, 3.11+ returns major.minor always.

Comment on lines +189 to +190
if not link.exists() and not link.is_symlink():
link.symlink_to(Path("en") / version_dir.name)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace existing bare-version paths during compatibility setup

The compatibility symlink is only created when a bare version path does not already exist. On migration runs, _site/<major_minor> already exists from the previous layout, so this condition skips it while new artifacts are now written to _site/en/<major_minor>. As a result, old URLs like /3.14/ keep serving stale content instead of tracking the newly published English artifacts.

Useful? React with 👍 / 👎.

@m-aciek
Copy link
Copy Markdown
Owner Author

m-aciek commented Apr 30, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1810ec4717

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

artifacts = Path("artifacts")
site = Path("_site")
name_re = re.compile(
r"^python-(\d+\.\d+)[\d.]*(?:-(?!docs|pdf)([a-zA-Z][a-zA-Z0-9_]*))?-(?:docs|pdf)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Accept prerelease versions when parsing artifact filenames

This regex only permits digits and dots after X.Y, so filenames like python-3.15.0a1-docs-html.zip (the normal format for docs built from main/prerelease branches) fail to match and are silently skipped in the copy loop. Because get-versions includes non-planned/non-end-of-life releases, prerelease branches are part of the matrix, so their artifacts will not be published at all.

Useful? React with 👍 / 👎.

Comment on lines +189 to +190
if not link.exists() and not link.is_symlink():
link.symlink_to(Path("en") / version_dir.name)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Replace existing bare version dirs with compatibility symlinks

The compatibility step only creates _site/<major.minor> -> en/<major.minor> links when the bare path does not already exist. On existing deployments, _site/<major.minor> is already a real directory from the previous layout, so no symlink is created and those legacy URLs keep serving stale artifacts while new builds are written only under _site/en/<major.minor>.

Useful? React with 👍 / 👎.

@m-aciek m-aciek merged commit 3cde519 into main Apr 30, 2026
199 of 472 checks passed
@m-aciek m-aciek deleted the copilot/add-translations-setup branch April 30, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants