mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-05 07:17:52 +10:00
migrate plugin loading process to new pluggy-powered system based on djp
This commit is contained in:
@@ -90,5 +90,5 @@ class NpmPlugin(BasePlugin):
|
||||
|
||||
|
||||
PLUGIN = NpmPlugin()
|
||||
PLUGIN.register(settings)
|
||||
# PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
@@ -8,10 +8,11 @@ from pathlib import Path
|
||||
from typing import List, Dict, Optional, ClassVar
|
||||
from pydantic import InstanceOf, Field, model_validator
|
||||
|
||||
import abx
|
||||
|
||||
import django
|
||||
from django.db.backends.sqlite3.base import Database as django_sqlite3 # type: ignore[import-type]
|
||||
from django.core.checks import Error, Tags
|
||||
from django.conf import settings
|
||||
|
||||
from pydantic_pkgr import BinProvider, PipProvider, BinName, BinProviderName, ProviderLookupDict, SemVer
|
||||
from plugantic.base_plugin import BasePlugin
|
||||
@@ -240,5 +241,11 @@ class PipPlugin(BasePlugin):
|
||||
]
|
||||
|
||||
PLUGIN = PipPlugin()
|
||||
PLUGIN.register(settings)
|
||||
# PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
|
||||
@abx.hookimpl
|
||||
def register_django_checks(settings):
|
||||
USER_IS_NOT_ROOT_CHECK.register_with_django_check_system(settings)
|
||||
PIP_ENVIRONMENT_CHECK.register_with_django_check_system(settings)
|
||||
|
||||
@@ -72,7 +72,7 @@ class PlaywrightBinProvider(BaseBinProvider):
|
||||
if OPERATING_SYSTEM == "darwin" else
|
||||
Path("~/.cache/ms-playwright").expanduser() # linux playwright cache dir
|
||||
)
|
||||
puppeteer_install_args: List[str] = ["install"] # --with-deps
|
||||
puppeteer_install_args: List[str] = ["install"] # --with-deps
|
||||
|
||||
packages_handler: ProviderLookupDict = Field(default={
|
||||
"chrome": lambda: ["chromium"],
|
||||
@@ -177,5 +177,5 @@ class PlaywrightPlugin(BasePlugin):
|
||||
|
||||
|
||||
PLUGIN = PlaywrightPlugin()
|
||||
PLUGIN.register(settings)
|
||||
# PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
@@ -165,5 +165,5 @@ class PuppeteerPlugin(BasePlugin):
|
||||
|
||||
|
||||
PLUGIN = PuppeteerPlugin()
|
||||
PLUGIN.register(settings)
|
||||
# PLUGIN.register(settings)
|
||||
DJANGO_APP = PLUGIN.AppConfig
|
||||
|
||||
Reference in New Issue
Block a user