Cleanup: remove "<pep8 compliant>" from headers

It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
This commit is contained in:
2022-06-02 19:59:52 +10:00
parent 48bb144fea
commit 3ca76ae0e8
223 changed files with 2 additions and 470 deletions

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
Example linux usage
python3 ~/blender-git/blender/build_files/cmake/cmake_netbeans_project.py ~/blender-git/cmake

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
r"""
Example Linux usage:
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py --build-dir ~/blender-git/cmake

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import project_source_info
import subprocess
import sys

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import project_source_info
import subprocess
import sys

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
CHECKER_IGNORE_PREFIX = [
"extern",
"intern/moto",

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
Module for accessing project file data for Blender.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
__all__ = (
"build_info",
"SOURCE_DIR",

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import os
import shutil
import subprocess

View File

@@ -11,8 +11,6 @@ where <path-to-blender> is the path to the Blender executable,
and <output-filename> is where to write the generated man page.
'''
# <pep8 compliant>
import argparse
import os
import subprocess

View File

@@ -40,15 +40,6 @@ As well as pep8 we have additional conventions used for Blender Python scripts:
- pep8 also defines that lines should not exceed 79 characters,
we have decided that this is too restrictive so it is optional per script.
Periodically we run checks for pep8 compliance on Blender scripts,
for scripts to be included in this check add this line as a comment at the top of the script:
``# <pep8 compliant>``
To enable line length checks use this instead:
``# <pep8-80 compliant>``
User Interface Layout
=====================

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# This is a quite stupid script which extracts bmesh api docs from
# 'bmesh_opdefines.c' in order to avoid having to add a lot of introspection
# data access into the api.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
Dump the python API into a text file so we can generate changelogs.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
API dump in RST files
---------------------

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
bpy_types_Operator_bl_property__doc__ = (
"""
The name of a property to use as this operators primary property.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations
bl_info = {

View File

@@ -1,8 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
# Fit to match default projective camera with focal_length 50 and sensor_width 36.
default_fisheye_polynomial = [
-1.1735143712967577e-05,

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations
from bl_operators.presets import AddPresetBase

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation
# <pep8 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# This script updates icons from the SVG file
import os
import subprocess

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# This script updates icons from the BLEND file
import os
import subprocess

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# This script updates icons from the SVG file
import os
import subprocess

View File

@@ -2,8 +2,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2009 Blender Foundation. All rights reserved.
# <pep8 compliant>
import sys
argv = sys.argv[:]

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# This script updates icons from the SVG file
import os
import subprocess

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
__all__ = (
"paths",
"modules",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
This module has utility functions for renaming
rna values in fcurves and drivers.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
"""
Module to manage overriding various parts of Blender.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
# -----------------------------------------------------------------------------
# AppOverrideState

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
"""
Similar to ``addon_utils``, except we can only have one active at a time.

View File

@@ -2,6 +2,4 @@
# Copyright (c) 2009 www.stani.be
# <pep8 compliant>
"""Package for console specific modules."""

View File

@@ -2,8 +2,6 @@
# Copyright (c) 2009 www.stani.be
# <pep8-80 compliant>
import inspect
import re

View File

@@ -10,8 +10,6 @@
# the file COPYING, distributed as part of this software.
# ****************************************************************************
# <pep8 compliant>
"""Completer for import statements
Original code was from IPython/Extensions/ipy_completers.py. The following

View File

@@ -2,8 +2,6 @@
# Copyright (c) 2009 www.stani.be
# <pep8-80 compliant>
"""Autocomplete with the standard library"""
import re

View File

@@ -2,8 +2,6 @@
# Copyright (c) 2009 www.stani.be
# <pep8-80 compliant>
"""This module provides intellisense features such as:
* autocompletion

View File

@@ -1,5 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""Package for translation (i18n) tools."""

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Populate a template file (POT format currently) from Blender RNA/py/C data.
# XXX: This script is meant to be used from inside Blender!
# You should not directly use this script, rather use update_msg.py!

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Merge one or more .po files into the first dest one.
# If a msgkey is present in more than one merged po, the one in the first file wins, unless
# its marked as fuzzy and one later is not.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Global settings used by all scripts in this dir.
# XXX Before any use of the tools in this dir, please make a copy of this file
# named "setting.py"

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import os
import settings

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Some misc utilities...
import collections

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Some useful operations from utils' I18nMessages class exposed as a CLI.
import os

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Update "languages" text file used by Blender at runtime to build translations menu.

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Pre-process right-to-left languages.
# You can use it either standalone, or through import_po_from_branches or
# update_trunk.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import enchant
import os
import pickle

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
__all__ = (
"io",
"keymap_from_toolbar",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# -----------------------------------------------------------------------------
# Export Functions

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Dynamically create a keymap which is used by the popup toolbar
# for accelerator key access.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
__all__ = (
"generate",
)

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Update Blender version this key-map was written in:
#
# When the version is `(0, 0, 0)`, the key-map being loaded didn't contain any versioning information.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Populate a template file (POT format currently) from Blender RNA/py/C data.
# Note: This script is meant to be used from inside Blender!

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
__all__ = (
"property_definition_from_data_path",
"decompose_data_path",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
def url_prefill_from_blender(*, addon_info=None):
import bpy

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# This module can get render info without running from inside blender.
#
# This struct won't change according to Ton.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
"""
Give access to blender data and utility functions.
"""

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
# for slightly faster access
from _bpy import ops as _ops_module

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
"""
This module has a similar scope to os.path, containing utility
functions for dealing with paths in Blender.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
"""
This module contains utility functions specific to blender but
not associated with blenders internal data.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
This module contains utility functions to handle custom previews.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Until we untangle ToolDef from bl_ui internals,
# use this module to document ToolDef.
from bl_ui.space_toolsystem_common import ToolDef

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
"""
Utility modules associated with the bpy module.
"""

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
__all__ = (
"bake_action",
"bake_action_objects",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
"""
Helpers for asset management tasks.
"""

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
from typing import Dict, Set
import bpy
from bpy.types import ID

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
__all__ = (
"load_image",
)

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
__all__ = (
"ExportHelper",
"ImportHelper",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# -----------------------------------------------------------------------------
# Add-on helpers to properly (un)register their own keymaps.

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
__all__ = (
"mesh_linked_uv_islands",
"mesh_linked_triangles",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
from mathutils import Color, Vector
__all__ = (

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
__all__ = (
"find_node_input",
)

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
from __future__ import annotations
__all__ = (

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
__all__ = (
"region_2d_to_vector_3d",
"region_2d_to_origin_3d",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import time

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
"""
This module contains RestrictBlend context manager.
"""

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
from _bpy import types as bpy_types
StructRNA = bpy_types.bpy_struct

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
import sys
import bpy

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import os
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import bpy
header = '''

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
# This file defines a set of methods that are useful for various
# Relative Keying Set (RKS) related operations, such as: callbacks
# for polling, iterator callbacks, and also generate callbacks.

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# classes for extracting info from blenders internal classes
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
__all__ = (
"draw_entry",
"draw_km",

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import bpy
from mathutils import Vector

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# classes for extracting info from blenders internal classes

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
from __future__ import annotations
# support reloading sub-modules

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
from __future__ import annotations
if "bpy" in locals():

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
# Utilities to detect the next matching element (vert/edge/face)
# based on an existing pair of elements.

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import bpy
from bpy.types import Operator
from bpy.props import FloatProperty

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
from __future__ import annotations
import bpy

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8-80 compliant>
from __future__ import annotations
from bpy.types import (

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import bpy
from bpy.types import (
Operator,

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# <pep8 compliant>
import bpy
from bpy.types import (

Some files were not shown because too many files have changed in this diff Show More