e.g. stands for "exempli gratia" in Latin which means "for example".
The best way to make sure it makes sense when writing is to just expand
it to "for example". In these cases where the text was "for e.g.", that
leaves us with "for for example" which makes no sense. This commit fixes
all 110 cases, mostly just just replacing the words with "for example",
but also restructuring the text a bit more in a few cases, mostly by
moving "e.g." to the beginning of a list in parentheses.
Pull Request: https://projects.blender.org/blender/blender/pulls/139596
The logic to generalize over downloading a URL or reading data from
the file-system included static values in the iterator along with the
data being read - so the caller could access the total expected size of
the data being read. While this worked, the result didn't read well.
Now these iterators yield the data being read, a new type has been
added for the caller to read the size hint from.
Also correct invalid doc-string.
Add error handling for rare but possible failures on installation.
- Account for the destination extension directory being a file.
- Handle the exception if renaming the temporary directory fails.
When an extension could could be removed but it's directory could be
renamed, the install operation would fail anyway.
Resolve by completing the installation when the directory can be moved.
Report as part of #129884.
Regression in [0] caused wheels with an older Python version
that used CPython's stable ABI to be considered incompatible.
Resolve using the stable ABI for version checks.
[0]: cfc10b0232565642afbfdc5a867f027640ce8274
Support multiple extensions with different Python versions in a similar
way to how "platforms" are handled now.
This will be needed when Blender upgrades to a newer version of Python
so extensions which have a binary dependency on Python 3.11 don't
attempt to install in a Blender built with a newer Python version.
Details:
- Extensions from incompatible Python versions are not listed.
- Python versions are extracted from wheel names.
- An extension may include wheels for multiple Python versions,
only the compatible wheels will be installed.
- Links may include a "python_versions" field which is checked
when dropping into Blender.
- JSON generated by the "server-generate" command include the:
"python_versions" field for extensions that include wheels.
- The "python_versions" field is optional, when omitted no version
checks are performed.
Also correct watch_test make target.
Ref #128750.
Building an extension when the manifest didn't define a "type"
would assert instead of reporting the missing field.
Return earlier when there are errors to prevent the assertion.
On Windows an entire directory may be locked when any files inside it
are opened by another process. This can cause operations that
recursively remove a directory (uninstalling & updating) to fail
with a partially removed extension.
The case of uninstalling was already handled, where failure to remove
a directory would stage the extension for later removal.
In the case of updating however, the user could be left with a broken
(partially removed) extension where some files were removed, as the
directory was locked, the update would fail to extract new files.
Address this issue by renaming the directory before recursive removal.
The following logic has been implemented:
- If any files in the directory are locked, renaming will fail.
So even though the operation fails the extension is left intact.
- If renaming succeeds, it's possible to apply the update.
While it's possible (albeit unlikely) recursive removal fails,
which could be caused by file-system permissions issues corruption or
a process could open a file between rename & removal.
In this case the renamed directory is staged for later removal.
Other changes:
- Resolve a related problem where the user could install an
extension previously staged for removal, now installing an extension
ensured it's not removed later.
This would occur if uninstalling failed, the user resolves
directory-lock, uninstalls again, then re-installs the extension.
- When an extension fails to be removed, don't attempt to remove
user configuration for that extension.
Prefer to keep the extension & it's settings in their "current state"
if it can't be removed.
Workaround: `[ASN1] nested asn1 error` error when making HTTPS
connections on systems with certificates that OpenSSL cannot parse
are installed.
This is a general issue with Python, resolve by applying a proposed
fix [0] to the extensions Python process at run-time.
(this doesn't impact Blender's Python run-time).
The down side is HTTPS connections will only work for extensions
on systems with this problem so this needs to be resolved by Python
long term.
While any changes to Python's SSL checks is worth avoiding,
this simply skips SSL certificates in the windows store that OpenSSL
can't parse instead of failing all SSL connections.
See related issues:
- https://github.com/python/cpython/issues/79846
- https://github.com/openssl/openssl/issues/25023
[0]: https://github.com/python/cpython/pull/91740
Ref !124943.
Support blocking extensions so there is a way for the maintainers of
the remote repository to notify the user if one of their installed
extensions blocked along with a reason for blocking.
Blocked extensions cannot be installed from the preferences or by
dropping a URL.
When an installed & blocked extension is found:
- An icon int the status bar shows an alert,
clicking on the icon shows the blocked extensions.
- The extensions preferences show a warning.
- The extensions & add-ons UI shows an alert icon
and "details" section shows the reason.
Details:
- Blocked & installed extensions are shown first in the installed
extensions panel.
- The internal "install" logic prevents downloading & installing
blocked extensions.
- Blocked extensions can still be downloaded & installed from disk.
- The "list" command includes an error message if any installed
extensions are blocked.
- The "server-generate" command can optionally take a configuration
file that includes the blocklist for the generated JSON.
See design #124954.
When "bl_info" was on the first line, the legacy add-on would not
install. Correct the check which would also incorrectly detect legacy
add-ons when "bl_info" wasn't found at all.
While this wasn't likely to cause any problems in practice,
using the sub-command "build --split-platform" with a platform
containing any characters that need escaping would have produced a TOML
with invalid syntax.
Add a utility function that's guaranteed to create a valid TOML string.
- Suppress pylint warnings via comments or be minor changes.
- Any errors disabling add-ons before upgrading or uninstalling are now
reported to the operators.
- Disable cyclic import warning is it's impractical to resolve.
- Enable useless-suppression warning.
The `[build.generated]` section now includes a filtered list of wheels
to simplify checking existing wheels on the server.
Also disallow quotes & control characters in wheel paths because they
already shouldn't be used and doing so would cause escaping issues in
the generated TOML.
Implements #124242.
Exceptions need be caught and forwarded so they show it in Blender's
interface. While most common errors where accounted for, various IO
errors & malformed JSON/TOML could cause internal operations to fail
with unhandled exceptions.
Some errors were reported as warnings because they didn't prevent the
operation from completing (such as failing to remove some paths when
uninstalling).
Change message types for the extensions internal command line program:
- Add "fatal error" to use when an operation fails and exits with a
non-zero error code.
- Use "error" when an operation fails which doesn't prevent other
actions from succeeding.
- Use "warn" reporting issues what don't prevent the operation
from completing but may cause problems.
Enforce tags from extensions.blender.org with support for using an
alternate set of tags (for other repositories), or no tag validation
at all if the repositories choose not to enforce this.
- By default building & validating an extensions fails when unknown
tags are used.
- The option `--valid-tags`` has been added which can either:
- Reference a JSON file which lists valid tags per extension type.
- Pass in an empty string to disable tag validation.
Default to constraining packages to use Blender's official tags as every
extension defining their own tags is likely to result in many similar
tags & a bad user experience. Details in code-comments.
Implements #123986.
The "repository" in links from the generated HTML was only valid when
the URL did not contain a path component.
Resolve by supporting relative "repository".
This simplifies referencing the JSON from a generated HTML since
a relative link doesn't need to know the repositories absolute URL
to the destination.