26 Commits

Author SHA1 Message Date
Campbell Barton
87c4f47312 Fix #139585: Blender could erase OS root
Temporary directory handling had a logical error, assuming the
"session" temporary directory was owned and created by Blender
and could be recursively removed on exit.

However, it's possible creating the session sub-directory fails,
in that case the temporary directory was used for the "session".
This meant setting `C:\` as the temporary directory in the preferences
would attempt to recursively remove `C:\` on exit.

Resolve with the following changes:

- Only perform a recursive removal on the temporary directory
  if a session sub-directory was created.

- If the creating the user-preferences temporary "session" sub-directory
  fails fall back to the systems temporary directory and try to
  create the "session" directory there.

  Previously this was only done if the preference path didn't exist.
  The preferences path was still used if it existed but couldn't be
  written to.

Include a test to ensure this is working as expected.

Ref !144042
2025-08-06 23:13:58 +00:00
Campbell Barton
0265b13399 Tools: add a utility to validate array sizes
The script check_source/static_check_size_comments.py run directly
or called via the convenience target "make check_size_comments".

Add a utility module: `line_number_utils` which implements
a version of `re.finditer` that includes line numbers & ranges.
2025-05-23 14:04:26 +10:00
Campbell Barton
accc3de59e Cleanup: resolve mypy warnings
Also include bug_fixes_per_major_release.py in the "make check_mypy"
target.
2025-05-07 15:39:06 +10:00
Campbell Barton
8e5c0aedec Cleanup: use type hints for trailing_space_clean.py utility 2025-04-05 20:06:34 +11:00
Campbell Barton
62ab0837b3 Cleanup: exclude code_layout_diagram.py from mypy check
Also update bl_run_operators.py based as #136156 is fixed.
2025-04-03 13:51:52 +11:00
Campbell Barton
5fe261c89d Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
Campbell Barton
0b0fddb614 Cleanup: use type hints for the QtCreator project generator
Also resolve some warnings for project_info.py.
2025-01-02 17:06:56 +11:00
Campbell Barton
030f367c33 Tools: remove project_netbeans
Remove the script that converted an eclipse project to netbeans,
it seems unlikely this was widely used since it wrote to an old/outdated
project file format.

Since this was written, most IDE's (including NetBeans) have improved
their CMake support.
2025-01-02 16:01:17 +11:00
Bastien Montagne
e83d87f588 Move several py scripts from build_files to tools.
Preliminary step towards adding 'system python' validation for some
build-essential py scripts (!130746).

Pull Request: https://projects.blender.org/blender/blender/pulls/132025
2024-12-17 19:02:45 +01:00
Campbell Barton
8701ccc6d8 mypy: update checker to support specific files overlapping directories
This allows single files to use different settings to other files
in the same directory. Add check_unused_defines.py.
2024-11-29 15:57:30 +11:00
Campbell Barton
7b3e2fd7dd mypy: add 3 scripts to the "make check_mypy" config 2024-11-02 23:18:59 +11:00
Campbell Barton
cfc645901f Cleanup: use type hints for discover_nodes.py 2024-10-23 13:18:36 +11:00
Campbell Barton
a0453ab87a Cleanup: update use of typing in for Python scripts 2024-10-23 12:48:09 +11:00
Campbell Barton
1fc2530179 mypy: remove non-existing file from config 2024-07-10 17:03:20 +10:00
Campbell Barton
350b8047c6 Extensions: move the wheel_manager out of the extensions add-on
Move wheel management to a generic private module, prepare addon_utils
to handle changes to repositories on load (needed to resolve #123645).
2024-07-01 10:07:16 +10:00
Campbell Barton
29c7be1516 Tools: fixes and updates to duplicate header checker
Since moving to "tools/" the suggested command would modify
headers *outside* Blender's source directory (now prevented).

Since "#pragma once" was used - the duplicate header check
needed to be moved from the end to the start of the header.

Other changes:

- Add type hints.
- Exclude headers intended to be included multiple times.
- Use `argparse` for argument parsing.
- Use str.format.
2024-04-29 09:39:43 +10:00
Campbell Barton
79cf4e58e4 Cleanup: type check scripts in tools/triage 2024-02-28 11:02:51 +11:00
Campbell Barton
836167f1c9 mypy: update checker config, report missing paths 2024-02-03 13:09:57 +11:00
Campbell Barton
8f4f4d62bc Cleanup: include release/datafiles/ to "make check_mypy"
Also add type hints to some scripts.
2024-01-25 10:06:29 +11:00
Campbell Barton
5126677c6f Tests: add batch blend file loading utility
Useful for finding regression in file reading as well as issues reported
by ASAN, including memory leaks.
2023-09-27 16:50:09 +10:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
8c5c5142d5 Cleanup: use type checking for credits_git_gen.py & git_log.py 2023-08-15 15:18:01 +10:00
Campbell Barton
8f109712ee License headers: use SPDX-FileCopyrightText for build_files/ & tools/ 2023-06-14 23:36:23 +10:00
Campbell Barton
6722f90734 Cleanup: quiet mypy warnings in gitea_inactive_developers
Also add to the list of scripts to check with "make check_mypy".
2023-04-16 17:03:56 +10:00
Campbell Barton
cca5f18303 Fix path for check_mypy_config 2023-02-28 15:11:27 +11:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00