pluginify 1.0.0__py3-none-any.whl → 1.0.0.post11.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pluginify/_version.py +2 -2
- pluginify/create_plugin_registries.py +26 -7
- {pluginify-1.0.0.dist-info → pluginify-1.0.0.post11.dev0.dist-info}/METADATA +2 -1
- {pluginify-1.0.0.dist-info → pluginify-1.0.0.post11.dev0.dist-info}/RECORD +7 -7
- {pluginify-1.0.0.dist-info → pluginify-1.0.0.post11.dev0.dist-info}/WHEEL +1 -1
- {pluginify-1.0.0.dist-info → pluginify-1.0.0.post11.dev0.dist-info}/entry_points.txt +0 -0
- {pluginify-1.0.0.dist-info → pluginify-1.0.0.post11.dev0.dist-info}/licenses/LICENSE +0 -0
pluginify/_version.py
CHANGED
|
@@ -17,7 +17,7 @@ import logging
|
|
|
17
17
|
from importlib import metadata, resources, util, import_module
|
|
18
18
|
from inspect import signature
|
|
19
19
|
import json
|
|
20
|
-
from os import makedirs, remove
|
|
20
|
+
from os import getpid, makedirs, remove, replace
|
|
21
21
|
from os.path import (
|
|
22
22
|
basename,
|
|
23
23
|
dirname,
|
|
@@ -317,14 +317,24 @@ def write_registered_plugins(pkg_dir, plugins, save_type):
|
|
|
317
317
|
"""
|
|
318
318
|
if save_type == "yaml":
|
|
319
319
|
reg_plug_abspath = os_join(pkg_dir, "registered_plugins.yaml")
|
|
320
|
-
with open(reg_plug_abspath, "w") as plugin_registry:
|
|
321
|
-
LOG.info("Writing %s", reg_plug_abspath)
|
|
322
|
-
yaml.safe_dump(plugins, plugin_registry, default_flow_style=False)
|
|
323
320
|
else:
|
|
324
321
|
reg_plug_abspath = os_join(pkg_dir, "registered_plugins.json")
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
322
|
+
LOG.info("Writing %s", reg_plug_abspath)
|
|
323
|
+
# Write to a temporary file and move it into place, so that other processes
|
|
324
|
+
# reading the registry (for example parallel test workers) never see a
|
|
325
|
+
# partially written file.
|
|
326
|
+
tmp_abspath = f"{reg_plug_abspath}.{getpid()}.tmp"
|
|
327
|
+
try:
|
|
328
|
+
with open(tmp_abspath, "w") as plugin_registry:
|
|
329
|
+
if save_type == "yaml":
|
|
330
|
+
yaml.safe_dump(plugins, plugin_registry, default_flow_style=False)
|
|
331
|
+
else:
|
|
332
|
+
json.dump(plugins, plugin_registry, indent=4)
|
|
333
|
+
replace(tmp_abspath, reg_plug_abspath)
|
|
334
|
+
except BaseException:
|
|
335
|
+
if exists(tmp_abspath):
|
|
336
|
+
remove(tmp_abspath)
|
|
337
|
+
raise
|
|
328
338
|
|
|
329
339
|
|
|
330
340
|
def create_plugin_registries(plugin_packages, save_type, namespace):
|
|
@@ -934,6 +944,15 @@ def add_class_plugin(package, relpath, plugins):
|
|
|
934
944
|
# __version.py, etc.
|
|
935
945
|
return error_message
|
|
936
946
|
|
|
947
|
+
if "utils" in Path(relpath).parts:
|
|
948
|
+
# Ignore helper modules that live under plugin trees. These files are not
|
|
949
|
+
# plugins and should not be imported or validated for PLUGIN_CLASS.
|
|
950
|
+
LOG.info(
|
|
951
|
+
f"Skipping module at relpath {relpath} from {package}, "
|
|
952
|
+
"found under a utils directory"
|
|
953
|
+
)
|
|
954
|
+
return error_message
|
|
955
|
+
|
|
937
956
|
module_name = splitext(basename(relpath))[0]
|
|
938
957
|
# We need the full path to the module in order
|
|
939
958
|
# for relative imports to work within modules.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pluginify
|
|
3
|
-
Version: 1.0.0
|
|
3
|
+
Version: 1.0.0.post11.dev0
|
|
4
4
|
Summary: Pluginify package
|
|
5
5
|
License: LICENSE
|
|
6
6
|
License-File: LICENSE
|
|
@@ -12,6 +12,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
15
16
|
Provides-Extra: doc
|
|
16
17
|
Requires-Dist: docstring_parser
|
|
17
18
|
Requires-Dist: jsonschema (>4.18.0)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
pluginify/__init__.py,sha256=NvdicJtfy-dZZ8tWjR74lDBHGV6rlaH8pAJ7UHyTTog,391
|
|
2
|
-
pluginify/_version.py,sha256=
|
|
2
|
+
pluginify/_version.py,sha256=z-TefoSzduIgcBbfoVxyeFyvyIbCCdwT7xLpUydY-EI,239
|
|
3
3
|
pluginify/commandline_typer.py,sha256=i0aVQEABfS8oL6ATUmzMqgtQQLhw0nMQmYzwpPzTF8k,11361
|
|
4
4
|
pluginify/config.py,sha256=ffmzSyAjPNePkSZrqinu20ZJkbmG-L4TREgRfFmPL4M,4997
|
|
5
|
-
pluginify/create_plugin_registries.py,sha256=
|
|
5
|
+
pluginify/create_plugin_registries.py,sha256=n5yBp5KHCqHPlfXrFe-Ad16UXRQnGGDU5c81UuBoGOw,50167
|
|
6
6
|
pluginify/errors.py,sha256=kkdipLfxvj8f-Pp53SD3RPnD9QS3samBLlQBjBskZP8,373
|
|
7
7
|
pluginify/interfaces/__init__.py,sha256=OkhHHE8WUEh12n3VrAWfMUv2-AAz7wfy5OcEyY-KtTc,461
|
|
8
8
|
pluginify/interfaces/base.py,sha256=CMgPG2NpodrECXXJbayTIVt8Vqrrxd_QADAgGM5qgUk,26749
|
|
@@ -16,8 +16,8 @@ pluginify/pydantic_models/v1/configs.py,sha256=KfWsIveOqPOi_J53odFFY6gFOHNYPpwQd
|
|
|
16
16
|
pluginify/utils/__init__.py,sha256=gdy4E4yEI9lrHbWPeBn0Bspj7iz4z6r8BAjbmHf_hpM,2088
|
|
17
17
|
pluginify/utils/context_managers.py,sha256=1-bREbijNNc5PrqMIihKqxlxNaK-YZ3hj5XGpHiYmfw,926
|
|
18
18
|
pluginify/utils/validators.py,sha256=ssfcUsvUlYfhWt5AjncU66KD4qDSv0N1BdR99ytvQjY,7681
|
|
19
|
-
pluginify-1.0.0.dist-info/METADATA,sha256=
|
|
20
|
-
pluginify-1.0.0.dist-info/WHEEL,sha256=
|
|
21
|
-
pluginify-1.0.0.dist-info/entry_points.txt,sha256=kCm7HOEEzSnPyDpy98W-LYYmlLYyTnRqOj40UqxX6-w,111
|
|
22
|
-
pluginify-1.0.0.dist-info/licenses/LICENSE,sha256=sIBqTiU78gw5bC9MZMySNxzCE7DIlOcDqUWdmflkDsY,7266
|
|
23
|
-
pluginify-1.0.0.dist-info/RECORD,,
|
|
19
|
+
pluginify-1.0.0.post11.dev0.dist-info/METADATA,sha256=N-m8NbZksZDJkcsM5rWQy93pUqDbCyze1F4E-s1PSuE,2179
|
|
20
|
+
pluginify-1.0.0.post11.dev0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
21
|
+
pluginify-1.0.0.post11.dev0.dist-info/entry_points.txt,sha256=kCm7HOEEzSnPyDpy98W-LYYmlLYyTnRqOj40UqxX6-w,111
|
|
22
|
+
pluginify-1.0.0.post11.dev0.dist-info/licenses/LICENSE,sha256=sIBqTiU78gw5bC9MZMySNxzCE7DIlOcDqUWdmflkDsY,7266
|
|
23
|
+
pluginify-1.0.0.post11.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|