-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
_ver: Version | ||
_lang: Language |
There was a problem hiding this comment.
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:
_ver: Version | |
_lang: Language | |
_version: Version | |
_language: Language |
BuildMetadata(_ver=ver, _lang=lang) | ||
for ver in versions.filter(args.branches) | ||
for lang in reversed(languages.filter(args.languages)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b = todo.pop() | |
build_metadata = todo.pop() |
or
b = todo.pop() | |
build = todo.pop() |
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), makingBuildMetadata
a data-only class that performs no actions, withDocBuilder
performing the actual build. For example,DocBuilder.html_only
could be fully merged intoBuildMetadata
.A