Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-10-02 03:10:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-10-02 04:59:16 +0300
commitbab9de2a52929fe2b45ecddb1eb09da3378e303b (patch)
treecde61c5cb86dfad1c90aa414a8c7b1711ec25782 /build_files
parent28ebe827e60c84ed4731a9f8aa701ccf2d8be0b0 (diff)
Cleanup: pep8, blank lines
Diffstat (limited to 'build_files')
-rw-r--r--build_files/buildbot/buildbot_utils.py2
-rw-r--r--build_files/buildbot/worker_compile.py6
-rw-r--r--build_files/buildbot/worker_pack.py4
-rw-r--r--build_files/buildbot/worker_test.py3
-rw-r--r--build_files/cmake/clang_array_check.py2
-rw-r--r--build_files/cmake/cmake_print_build_options.py1
-rwxr-xr-xbuild_files/cmake/example_scripts/make_quicky.py1
-rw-r--r--build_files/cmake/project_source_info.py1
-rwxr-xr-xbuild_files/utils/make_test.py2
-rwxr-xr-xbuild_files/utils/make_update.py6
-rwxr-xr-xbuild_files/utils/make_utils.py7
11 files changed, 35 insertions, 0 deletions
diff --git a/build_files/buildbot/buildbot_utils.py b/build_files/buildbot/buildbot_utils.py
index a0c33155da1..919b197b380 100644
--- a/build_files/buildbot/buildbot_utils.py
+++ b/build_files/buildbot/buildbot_utils.py
@@ -24,6 +24,7 @@ import re
import subprocess
import sys
+
def is_tool(name):
"""Check whether `name` is on PATH and marked as executable."""
@@ -32,6 +33,7 @@ def is_tool(name):
return which(name) is not None
+
class Builder:
def __init__(self, name, branch, codesign):
self.name = name
diff --git a/build_files/buildbot/worker_compile.py b/build_files/buildbot/worker_compile.py
index 8e19c9436f8..e569a1cf568 100644
--- a/build_files/buildbot/worker_compile.py
+++ b/build_files/buildbot/worker_compile.py
@@ -23,6 +23,7 @@ import shutil
import buildbot_utils
+
def get_cmake_options(builder):
codesign_script = os.path.join(
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
@@ -49,6 +50,7 @@ def get_cmake_options(builder):
return options
+
def update_git(builder):
# Do extra git fetch because not all platform/git/buildbot combinations
# update the origin remote, causing buildinfo to detect local changes.
@@ -58,6 +60,7 @@ def update_git(builder):
command = ['git', 'fetch', '--all']
buildbot_utils.call(builder.command_prefix + command)
+
def clean_directories(builder):
# Make sure no garbage remained from the previous run
if os.path.isdir(builder.install_dir):
@@ -73,6 +76,7 @@ def clean_directories(builder):
print("Removing {}" . format(buildinfo))
os.remove(full_path)
+
def cmake_configure(builder):
# CMake configuration
os.chdir(builder.build_dir)
@@ -87,6 +91,7 @@ def cmake_configure(builder):
command = ['cmake', builder.blender_dir] + cmake_options
buildbot_utils.call(builder.command_prefix + command)
+
def cmake_build(builder):
# CMake build
os.chdir(builder.build_dir)
@@ -109,6 +114,7 @@ def cmake_build(builder):
print("CMake build:")
buildbot_utils.call(builder.command_prefix + command)
+
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
update_git(builder)
diff --git a/build_files/buildbot/worker_pack.py b/build_files/buildbot/worker_pack.py
index 96c8db8e6c8..82b406cd42d 100644
--- a/build_files/buildbot/worker_pack.py
+++ b/build_files/buildbot/worker_pack.py
@@ -29,6 +29,7 @@ from pathlib import Path
import buildbot_utils
+
def get_package_name(builder, platform=None):
info = buildbot_utils.VersionInfo(builder)
@@ -41,6 +42,7 @@ def get_package_name(builder, platform=None):
return package_name
+
def sign_file_or_directory(path):
from codesign.simple_code_signer import SimpleCodeSigner
code_signer = SimpleCodeSigner()
@@ -64,6 +66,7 @@ def create_buildbot_upload_zip(builder, package_files):
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
sys.exit(1)
+
def create_tar_xz(src, dest, package_name):
# One extra to remove leading os.sep when cleaning root for package_root
ln = len(src) + 1
@@ -91,6 +94,7 @@ def create_tar_xz(src, dest, package_name):
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
package.close()
+
def cleanup_files(dirpath, extension):
for f in os.listdir(dirpath):
filepath = os.path.join(dirpath, f)
diff --git a/build_files/buildbot/worker_test.py b/build_files/buildbot/worker_test.py
index b959568a5c6..db02801007e 100644
--- a/build_files/buildbot/worker_test.py
+++ b/build_files/buildbot/worker_test.py
@@ -22,18 +22,21 @@ import buildbot_utils
import os
import sys
+
def get_ctest_arguments(builder):
args = ['--output-on-failure']
if builder.platform == 'win':
args += ['-C', 'Release']
return args
+
def test(builder):
os.chdir(builder.build_dir)
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
buildbot_utils.call(command)
+
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
test(builder)
diff --git a/build_files/cmake/clang_array_check.py b/build_files/cmake/clang_array_check.py
index de0b55c70e0..2456f099640 100644
--- a/build_files/cmake/clang_array_check.py
+++ b/build_files/cmake/clang_array_check.py
@@ -355,6 +355,8 @@ def recursive_arg_sizes(node, ):
# print("adding", node.spelling)
for c in node.get_children():
recursive_arg_sizes(c)
+
+
# cache function sizes
recursive_arg_sizes(tu.cursor)
_defs.update(defs_precalc)
diff --git a/build_files/cmake/cmake_print_build_options.py b/build_files/cmake/cmake_print_build_options.py
index fb7a5b33bf0..e41a1d2f873 100644
--- a/build_files/cmake/cmake_print_build_options.py
+++ b/build_files/cmake/cmake_print_build_options.py
@@ -8,6 +8,7 @@ import sys
cmakelists_file = sys.argv[-1]
+
def main():
options = []
for l in open(cmakelists_file, 'r').readlines():
diff --git a/build_files/cmake/example_scripts/make_quicky.py b/build_files/cmake/example_scripts/make_quicky.py
index a1334d6fc83..51985e930ae 100755
--- a/build_files/cmake/example_scripts/make_quicky.py
+++ b/build_files/cmake/example_scripts/make_quicky.py
@@ -114,5 +114,6 @@ def main():
import subprocess
subprocess.call(cmd)
+
if __name__ == "__main__":
main()
diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py
index f8067c216fd..83cc979ca30 100644
--- a/build_files/cmake/project_source_info.py
+++ b/build_files/cmake/project_source_info.py
@@ -242,5 +242,6 @@ def main():
for s in build_info():
print(s)
+
if __name__ == "__main__":
main()
diff --git a/build_files/utils/make_test.py b/build_files/utils/make_test.py
index 15bd6dde352..7f15195f8f9 100755
--- a/build_files/utils/make_test.py
+++ b/build_files/utils/make_test.py
@@ -12,6 +12,7 @@ from make_utils import call
# Parse arguments
+
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--ctest-command", default="ctest")
@@ -22,6 +23,7 @@ def parse_arguments():
parser.add_argument("build_directory")
return parser.parse_args()
+
args = parse_arguments()
git_command = args.git_command
svn_command = args.svn_command
diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py
index 324bb6944bf..ae7269b07cd 100755
--- a/build_files/utils/make_update.py
+++ b/build_files/utils/make_update.py
@@ -14,12 +14,15 @@ import sys
import make_utils
from make_utils import call, check_output
+
def print_stage(text):
print("")
print(text)
print("")
# Parse arguments
+
+
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--no-libraries", action="store_true")
@@ -31,10 +34,13 @@ def parse_arguments():
parser.add_argument("--use-centos-libraries", action="store_true")
return parser.parse_args()
+
def get_blender_git_root():
return check_output([args.git_command, "rev-parse", "--show-toplevel"])
# Setup for precompiled libraries and tests from svn.
+
+
def svn_update(args, release_version):
svn_non_interactive = [args.svn_command, '--non-interactive']
diff --git a/build_files/utils/make_utils.py b/build_files/utils/make_utils.py
index e94c8e3550a..ce87bdd46e4 100755
--- a/build_files/utils/make_utils.py
+++ b/build_files/utils/make_utils.py
@@ -7,6 +7,7 @@ import shutil
import subprocess
import sys
+
def call(cmd, exit_on_error=True):
print(" ".join(cmd))
@@ -19,6 +20,7 @@ def call(cmd, exit_on_error=True):
sys.exit(retcode)
return retcode
+
def check_output(cmd, exit_on_error=True):
# Flush to ensure correct order output on Windows.
sys.stdout.flush()
@@ -35,6 +37,7 @@ def check_output(cmd, exit_on_error=True):
return output.strip()
+
def git_branch(git_command):
# Get current branch name.
try:
@@ -45,6 +48,7 @@ def git_branch(git_command):
return branch.strip().decode('utf8')
+
def git_tag(git_command):
# Get current tag name.
try:
@@ -54,6 +58,7 @@ def git_tag(git_command):
return tag.strip().decode('utf8')
+
def git_branch_release_version(branch, tag):
release_version = re.search("^blender-v(.*)-release$", branch)
if release_version:
@@ -64,6 +69,7 @@ def git_branch_release_version(branch, tag):
release_version = release_version.group(1)
return release_version
+
def svn_libraries_base_url(release_version):
if release_version:
svn_branch = "tags/blender-" + release_version + "-release"
@@ -71,6 +77,7 @@ def svn_libraries_base_url(release_version):
svn_branch = "trunk"
return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/"
+
def command_missing(command):
# Support running with Python 2 for macOS
if sys.version_info >= (3, 0):