mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
fix loading of plugin dependencies and bump pydantic_pkgr version
This commit is contained in:
parent
a8f00caff8
commit
6e13cd4820
4 changed files with 28 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
from typing import List, Optional
|
||||
from typing import List, Optional, Dict
|
||||
from pathlib import Path
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
@ -10,11 +10,15 @@ from pydantic import (
|
|||
)
|
||||
|
||||
from pydantic_pkgr import BinProvider, BinName, Binary, EnvProvider, NpmProvider
|
||||
from pydantic_pkgr.binprovider import bin_abspath
|
||||
from pydantic_pkgr.binary import BinProviderName, ProviderLookupDict
|
||||
|
||||
from plugantic.extractors import Extractor, ExtractorName
|
||||
from plugantic.plugins import Plugin
|
||||
from plugantic.configs import ConfigSet, ConfigSectionName
|
||||
|
||||
from pkgs.settings import env
|
||||
|
||||
|
||||
###################### Config ##########################
|
||||
|
||||
|
@ -58,9 +62,23 @@ PLUGIN_CONFIG = [
|
|||
|
||||
###################### Binaries ############################
|
||||
|
||||
min_version: str = "1.1.54"
|
||||
max_version: str = "2.0.0"
|
||||
|
||||
class SinglefileBinary(Binary):
|
||||
name: BinName = 'single-file'
|
||||
providers_supported: List[BinProvider] = [EnvProvider(), NpmProvider()]
|
||||
providers_supported: List[BinProvider] = [NpmProvider()]
|
||||
|
||||
|
||||
provider_overrides: Dict[BinProviderName, ProviderLookupDict] ={
|
||||
'env': {
|
||||
'abspath': lambda: bin_abspath('single-file-node.js', PATH=env.PATH) or bin_abspath('single-file', PATH=env.PATH),
|
||||
},
|
||||
'npm': {
|
||||
# 'abspath': lambda: bin_abspath('single-file', PATH=NpmProvider().PATH) or bin_abspath('single-file', PATH=env.PATH),
|
||||
'subdeps': lambda: f'single-file-cli@>={min_version} <{max_version}',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
###################### Extractors ##########################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue