@@ -560,11 +560,12 @@ def run_build(self, docker, record):
560
560
)
561
561
562
562
try :
563
- self .setup_python_environment ()
563
+ with self .project .repo_nonblockinglock (version = self .version ):
564
+ self .setup_python_environment ()
564
565
565
- # TODO the build object should have an idea of these states,
566
- # extend the model to include an idea of these outcomes
567
- outcomes = self .build_docs ()
566
+ # TODO the build object should have an idea of these states,
567
+ # extend the model to include an idea of these outcomes
568
+ outcomes = self .build_docs ()
568
569
except vcs_support_utils .LockTimeout as e :
569
570
self .task .retry (exc = e , throw = False )
570
571
raise VersionLockedError
@@ -912,19 +913,18 @@ def setup_python_environment(self):
912
913
"""
913
914
self .build_env .update_build (state = BUILD_STATE_INSTALLING )
914
915
915
- with self .project .repo_nonblockinglock (version = self .version ):
916
- # Check if the python version/build image in the current venv is the
917
- # same to be used in this build and if it differs, wipe the venv to
918
- # avoid conflicts.
919
- if self .python_env .is_obsolete :
920
- self .python_env .delete_existing_venv_dir ()
921
- else :
922
- self .python_env .delete_existing_build_dir ()
916
+ # Check if the python version/build image in the current venv is the
917
+ # same to be used in this build and if it differs, wipe the venv to
918
+ # avoid conflicts.
919
+ if self .python_env .is_obsolete :
920
+ self .python_env .delete_existing_venv_dir ()
921
+ else :
922
+ self .python_env .delete_existing_build_dir ()
923
923
924
- self .python_env .setup_base ()
925
- self .python_env .save_environment_json ()
926
- self .python_env .install_core_requirements ()
927
- self .python_env .install_requirements ()
924
+ self .python_env .setup_base ()
925
+ self .python_env .save_environment_json ()
926
+ self .python_env .install_core_requirements ()
927
+ self .python_env .install_requirements ()
928
928
929
929
def build_docs (self ):
930
930
"""
@@ -941,12 +941,11 @@ def build_docs(self):
941
941
before_build .send (sender = self .version )
942
942
943
943
outcomes = defaultdict (lambda : False )
944
- with self .project .repo_nonblockinglock (version = self .version ):
945
- outcomes ['html' ] = self .build_docs_html ()
946
- outcomes ['search' ] = self .build_docs_search ()
947
- outcomes ['localmedia' ] = self .build_docs_localmedia ()
948
- outcomes ['pdf' ] = self .build_docs_pdf ()
949
- outcomes ['epub' ] = self .build_docs_epub ()
944
+ outcomes ['html' ] = self .build_docs_html ()
945
+ outcomes ['search' ] = self .build_docs_search ()
946
+ outcomes ['localmedia' ] = self .build_docs_localmedia ()
947
+ outcomes ['pdf' ] = self .build_docs_pdf ()
948
+ outcomes ['epub' ] = self .build_docs_epub ()
950
949
951
950
after_build .send (sender = self .version )
952
951
return outcomes
0 commit comments