@@ -188,7 +188,7 @@ def build(self):
188
188
self .build_epub ()
189
189
190
190
self .run_build_job ("post_build" )
191
- self .generate_readthedocs_data_javascript ()
191
+ self .store_readthedocs_build_yaml ()
192
192
193
193
after_build .send (
194
194
sender = self .data .version ,
@@ -394,7 +394,7 @@ def run_build_commands(self):
394
394
# Update the `Version.documentation_type` to match the doctype defined
395
395
# by the config file. When using `build.commands` it will be `GENERIC`
396
396
self .data .version .documentation_type = self .data .config .doctype
397
- self .generate_readthedocs_data_javascript ()
397
+ self .store_readthedocs_build_yaml ()
398
398
399
399
def install_build_tools (self ):
400
400
"""
@@ -629,7 +629,7 @@ def is_type_sphinx(self):
629
629
"""Is documentation type Sphinx."""
630
630
return "sphinx" in self .data .config .doctype
631
631
632
- def generate_readthedocs_data_javascript (self ):
632
+ def store_readthedocs_build_yaml (self ):
633
633
# load YAML from user
634
634
yaml_path = os .path .join (
635
635
self .data .project .artifact_path (
@@ -639,18 +639,20 @@ def generate_readthedocs_data_javascript(self):
639
639
)
640
640
641
641
try :
642
- log . warning (yaml_path )
643
- data = yaml .safe_load (open ( yaml_path , "r" ) )
642
+ with open (yaml_path , "r" ) as f :
643
+ data = yaml .safe_load (f )
644
644
except Exception :
645
- # NOTE: skip this work for now until we decide whether or not this YAML file is required.
646
- # NOTE: decide whether or not we want this file to be mandatory and raise an exception here.
647
- log .info ("No `readthedocs-build.yaml` was provided." )
645
+ # NOTE: skip this work for now until we decide whether or not this
646
+ # YAML file is required.
647
+ #
648
+ # NOTE: decide whether or not we want this
649
+ # file to be mandatory and raise an exception here.
648
650
return
649
651
650
652
log .info ("readthedocs-build.yaml loaded." , path = yaml_path )
651
653
652
654
# TODO: validate the YAML generated by the user
653
- # self._validate_readthedocs_data_yaml (data)
655
+ # self._validate_readthedocs_build_yaml (data)
654
656
655
657
# Copy the YAML data into `Version.build_data`.
656
658
# It will be saved when the API is hit.
0 commit comments