Skip to content

Add the BuildMetadata class #299

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add the BuildMetadata class #299

wants to merge 1 commit into from

Conversation

AA-Turner
Copy link
Member

In the inner loop, we operate on version-language pairs. These are currently only joined in the type system via tuples, or not at all. By introducing the BuildMetadata class, we make the link explicit.

My intent is to (later) add further attributes to BuildMetadata (e.g. the directory paths), making BuildMetadata a data-only class that performs no actions, with DocBuilder performing the actual build. For example, DocBuilder.html_only could be fully merged into BuildMetadata.

A

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Just some variable naming nits.

Comment on lines +306 to +307
_ver: Version
_lang: Language
Copy link
Member

Choose a reason for hiding this comment

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

Let's use full names:

Suggested change
_ver: Version
_lang: Language
_version: Version
_language: Language

Comment on lines +1182 to +1184
BuildMetadata(_ver=ver, _lang=lang)
for ver in versions.filter(args.branches)
for lang in reversed(languages.filter(args.languages))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
BuildMetadata(_ver=ver, _lang=lang)
for ver in versions.filter(args.branches)
for lang in reversed(languages.filter(args.languages))
BuildMetadata(_version=version, _language=language)
for version in versions.filter(args.branches)
for language in reversed(languages.filter(args.languages))

@@ -1141,28 +1198,25 @@ def build_docs(args: argparse.Namespace) -> int:
args.build_root / _checkout_name(args.select_output),
)
while todo:
version, language = todo.pop()
b = todo.pop()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
b = todo.pop()
build_metadata = todo.pop()

or

Suggested change
b = todo.pop()
build = todo.pop()

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