Commit Graph

2276 Commits

Author SHA1 Message Date
ec18c7ea55 Extensions: refactor CommandBatch.exec_non_blocking return value
Use a named tuple for readability.

- Messages (as before).
- Boolean (completed status).
- Boolean (true when the status-data changed).
  Used to detect when a redraw is needed.
2024-05-13 22:27:58 +10:00
204099e1ef Extensions: fix the splash status being momentarily incorrect
CommandBatch.exec_non_blocking was meant to return None when all
commands were complete, this didn't account for commands being
completed in the body of exec_non_blocking(..) which caused
incorrect status to be shown for a short time.
2024-05-13 22:05:39 +10:00
26367cbe27 Extensions: remove commented code 2024-05-13 21:37:15 +10:00
516fd69d76 Extensions: support showing available updates on the splash
Implements #120612, except for displaying a number over an icon
which requires extending Blender.
2024-05-13 12:51:26 +10:00
54dcdc2803 Extensions: change the constant for the complete status
Allow the status to be converted to a flag
2024-05-10 14:31:47 +10:00
e2129ce670 Extensions: add missing status assignment (was never set to running) 2024-05-10 14:31:20 +10:00
def2997f8b Extensions: resolve reading JSON output blocking Blender
Resolve reading JSON chunks blocking Blender's process by yielding an
empty message when there is no new data read from the process.
2024-05-10 14:25:56 +10:00
7b8748f12a Extensions: workaround for macos wheel matching 2024-05-09 10:12:32 +10:00
e6e44506a6 Cleanup: trailing newline 2024-05-09 10:02:43 +10:00
ff78091b00 Extensions: match manylinux*{arch} *.whl files on Linux
Match manylinux on Linux systems since it's a common prefix for wheels,
so it's important they're installed on Linux.
Currently the GLIBC component of the platform is ignored.
2024-05-08 15:02:55 +10:00
6cd5230f7d Extensions: don't compress archive files when building packages
Don't compress `*.whl` and other archive files as it's overly
time-consuming.
2024-05-08 14:42:07 +10:00
6c9cfb75b5 Extensions: don't include the extensions own temporary file
Exclude the extensions own temporary file when building an extension.
Even though this file should be removed, it's possible the build
process was killed for the system was turned off, so best explicitly
exclude the file.
2024-05-08 14:35:45 +10:00
2407157d18 Extensions: initial wheel support
- Support for "wheels" in the `blender_manifest.toml` as a list
  of manifest relative file-paths.

- Wheels are extracted into an extension specific `site-packages`
  directory after installation.

- Wheels are removed when they are no longer used by any extensions.

- Wheel's from unsupported platforms are skipped,
  allowing an extension to include compiled extensions for multiple
  platforms.

- When more than one version of a wheel is found,
  only the newest version is installed.

  This is an imperfect solution because an extension could depend on a
  specific version of a wheel.

  We will probably need extensions to declare version ranges they
  are compatible with so extensions can co-exist without disabling
  each other due to distributing different versions of wheels.

- "make test_cli_blender" tests managing extensions vie Blender's
  command line `blender -c extension` operations, which also tests
  extensions that bundle `.whl` files.

Address #119681.
2024-05-08 13:00:13 +10:00
60adf3cfa3 Extensions: fix running tests when "make" isn't run from the add-on dir
Running "make -C path" would fail for some tests as they expected
the CWD to be the add-on directory.
2024-05-08 11:17:51 +10:00
e6df553637 Extensions: fix always reporting 3 packages as being generated
The wrong list was used when reporting packages found for the
"server_generate" command.
2024-05-08 11:01:17 +10:00
9bb8f8ba00 Extensions: fix incorrect reports that __init__.py file is missing
Ref: !31
2024-05-08 08:48:20 +10:00
4bd4f8752a Extensions: quiet commands in the makefile 2024-05-04 16:55:31 +10:00
0f400a8eb6 Extensions: correct commands in script headers 2024-05-03 17:20:28 +10:00
c97c1c847c UI: Move Extensions repositories popover to header
Improve discoverability of the repositories settings by moving them from
the dropdown menu into the header.

Inspired by !27

Pull Request: https://projects.blender.org/blender/blender-addons-contrib/pulls/30
2024-04-16 17:23:29 +02:00
16908cc466 Extensions: User Interface: Fix logic for Filter
1. The Install and Enable were "Show Only", but the label was saying
   only "Show". We now split Show and Only in two sections.

2. The logic for when enable/installed would be active was flipped.

Designed together with Pablo Vazquez.
2024-04-12 17:34:23 +02:00
d5862549d3 Extensions: User Interface
* Make "Repositories" more accessible.
* Unify all the "Install" operators.

This commit addresses some feedback regarding being hard to setup
repositories since they were on the corner of the panel, and get easily
dismissable while travelling there with the mouse.

It then touches on the topic of discoverability of this feature, and
re-organize the extensions Operators dropdown menu.

Repositories
-----------
Repositories was accessible via the "preferences" icon. This icon (a cog)
is used already on the File Browser as a toggle to expand the side panel.
Here it had no label, thus no correlation between the button and what it did
(Repositories).

Instead this commit adds a Repository entry to the extensions operators
dropdown menu.

Install
-------
The "Update All" entry wasn't clear enough. It has been renamed to
Install Available Updates and grouped together with the other Install
operators.

--
Designed together with Pablo Vazquez.
2024-04-12 17:10:23 +02:00
98c9f50dae Extensions: support enable/disable for themes 2024-04-12 14:41:33 +10:00
7cff5f2780 Extensions: refresh/clear theme on update/uninstall
Resolves blender/blender#120289
2024-04-12 13:13:20 +10:00
ebcda465b5 Extensions: use a new structure for the server's JSON listing
Top level keys are now:
- version
- blocklist
- data (a list of packages)

  Each list item now contains the package "id".

Ref !29
2024-04-11 21:23:37 +10:00
a41e3d35a4 Extensions: resolve missing type hints 2024-04-09 22:11:14 +10:00
bb54317424 Extensions: tweak help text, missed from last commit 2024-04-03 22:30:51 +11:00
2a3085b69d Extensions: remove the bool argument for "repo-add --clear-all" 2024-04-03 22:28:16 +11:00
70869e9ddf Extensions: add a --clear-all option to repo-add
This us useful to speed up setting up a test repo.
2024-04-03 19:15:56 +11:00
af47b5292d Extensions: handle errors creating a package archive 2024-04-03 17:34:27 +11:00
57e3fbd918 Extensions: handle exceptions extracting opening the archive 2024-04-03 17:27:29 +11:00
d4f7917587 Extensions: tweak wording when a file is missing 2024-04-02 22:37:56 +11:00
ca179f9d26 Extensions: capitalize metavar's for the --help message 2024-04-02 22:18:00 +11:00
423d6d49e0 Extensions: "validate" now ensures add-on's contain an __init__.py
Add-on's without an __init__.py aren't supported, ensure they contain
an __init__.py file.
2024-04-02 22:10:21 +11:00
b1e5f22a1e Extensions: properly handle errors reading from the package archive 2024-04-02 22:10:19 +11:00
c6d42791c0 Extensions: report all errors when validating an archive
Previously only the first error was reported.
2024-04-02 22:10:18 +11:00
da09f699f0 Extensions: the sub-command validate can now take archives directly
This makes it easier to validate a downloaded archive without
having to extract it first.
2024-04-02 22:10:16 +11:00
a22dcb47f2 Extensions: use an error exit code from the command line 2024-04-02 22:10:14 +11:00
f989b92a34 Extensions: clarify error message
The manifest may be readable but invalid.
2024-04-02 22:10:13 +11:00
84d0b4942e Extensions: support dropping URL before the repo is initialized
Sync the repo when first dropping a URL onto Blender's window
before sync has run.

This is a simply fix which doesn't address the issue entirely
as we will likely want to detect an outdated repository too.
2024-04-01 16:31:13 +11:00
895679e651 Fix installing files from disk
- Resolve error installing files from disk blender/blender#119972
  (regression in [0]).
- Refactor enable-on-install into a shared function.
- Expose the "Enable on Install" checkbox in the file selector when
  installing from disk.

[0]: d158316df4
2024-03-29 15:11:37 +11:00
3ba911f3b3 Extensions: rename "Enable Theme" to "Set Current Theme" 2024-03-21 21:07:45 +11:00
f8526a4de2 Extensions: support enabling themes on installation
- Fix theme installation attempting to enable the package as an add-on.
- "Enable on install" now works for themes as well as add-ons.
2024-03-21 20:38:24 +11:00
d9f48399b9 Extensions: correct misleading theme path construction
The resulting path happened to work on Linux but the expression
included the absolute prefix twice.
2024-03-21 20:22:05 +11:00
5096131e53 Extensions: add a handler for clearing a repository before removal
This is a safer alternative to recursively removing all files
when removing a repository that points to a custom directory,
see blender/blender#119481
2024-03-21 11:32:52 +11:00
a1b0f1b1f4 Extensions: respect the local cache setting
- Removing a package removes its cache.
- When local cache is disabled, clear cache on update.
2024-03-20 17:36:57 +11:00
6007bf7630 Import_max: Retrive active collection
Importing to active collection
2024-03-19 21:27:19 +01:00
d158316df4 Extensions: implement dropping directly from install operators
Remove a hack that used a popover panel to invoke an operator.
This was needed because drop ran from bpy.app.handlers.
Instead, activate the install operators from the drop action.

Resolves blender/blender#119500
2024-03-19 18:04:40 +11:00
0ea8e48114 Extensions: remove "show_development" which has moved to Blender prefs 2024-03-19 16:05:30 +11:00
09143a5ddb Extensions: minor clarification to manifest error 2024-03-19 15:59:37 +11:00
2e574b06b7 Import_max: Added collection
Added positional arguments
2024-03-18 21:34:26 +01:00