diff --git a/archivebox/plugins/defaults/models.py b/archivebox/plugins/defaults/models.py index 310a3a48..f1113d57 100644 --- a/archivebox/plugins/defaults/models.py +++ b/archivebox/plugins/defaults/models.py @@ -87,25 +87,25 @@ class ArchiveBoxBaseDependency(models.Model): } @cached_property - def bin_path(self): + def bin_path(self) -> str: return bin_path(self.BINARY or self.DEFAULT_BINARY) @cached_property - def bin_version(self): + def bin_version(self) -> str | None: print(f'ArchiveBoxBaseDependency.bin_version({self.bin_path}, cmd={self.VERSION_CMD.format(BINARY=self.BINARY)})') return bin_version(self.bin_path, cmd=self.VERSION_CMD.format(BINARY=self.BINARY)) # return bin_version(self.bin_path, cmd=self.VERSION_CMD) @cached_property - def is_valid(self): + def is_valid(self) -> bool: return bool(self.bin_path and self.bin_version) @cached_property - def is_enabled(self): + def is_enabled(self) -> bool: return bool(self.ENABLED and self.is_valid) @cached_property - def pretty_version(self): + def pretty_version(self) -> str: if self.is_enabled: if self.is_valid: color, symbol, note, version = 'green', '√', 'valid', '' @@ -142,7 +142,7 @@ class ArchiveBoxBaseDependency(models.Model): # @helper def install_self(self, config): - assert all(self.install_parents().values()) + assert all(self.install_parents(config=config).values()) BashEnvironmentDependency.get_solo().install_pkgs(self.BIN_DEPENDENCIES) AptEnvironmentDependency.get_solo().install_pkgs(self.APT_DEPENDENCIES) @@ -174,7 +174,7 @@ class ArchiveBoxDefaultDependency(ArchiveBoxBaseDependency, SingletonModel): ENABLED = models.BooleanField(default=True, editable=True) - class Meta: + class Meta: # pyright: ignore [reportIncompatibleVariableOverride] abstract = False app_label = 'defaults' verbose_name = 'Default Configuration: Dependencies' @@ -212,9 +212,9 @@ class ArchiveBoxBaseExtractor(models.Model): def __str__(self): return f"{self.LABEL} Extractor Configuration" - class Meta: + class Meta: # pyright: ignore [reportIncompatibleVariableOverride] abstract = True - verbose_name = f"Default Extractor Configuration" + verbose_name = "Default Extractor Configuration" app_label = 'defaults' @cached_property diff --git a/archivebox/plugins/system/models.py b/archivebox/plugins/system/models.py index 3c288808..6ff609e0 100644 --- a/archivebox/plugins/system/models.py +++ b/archivebox/plugins/system/models.py @@ -179,6 +179,8 @@ class AptEnvironmentDependency(ArchiveBoxBaseDependency, SingletonModel): def install_pkgs(self, apt_pkgs=()): assert self.is_valid, 'Apt environment is not available on this host' + # with huey.lock_task('apt-install'): + run(cmd=[self.DEFAULT_BINARY, '-qq', 'update']) for apt_package in apt_pkgs: run(cmd=[self.DEFAULT_BINARY, 'install', '-y', apt_package]) diff --git a/bin/docker_entrypoint.sh b/bin/docker_entrypoint.sh index ea1241fb..20385137 100755 --- a/bin/docker_entrypoint.sh +++ b/bin/docker_entrypoint.sh @@ -64,7 +64,7 @@ if [[ -d "$DATA_DIR/archive" ]]; then rm -f "$DATA_DIR/archive/.permissions_test_safe_to_delete" # echo "[√] Permissions are correct" else - # the only time this fails is if the host filesystem doesn't allow us to write as root (e.g. some NFS mapall/maproot problems, connection issues, drive dissapeared, etc.) + # the only time this fails is if the host filesystem doesn't allow us to write as root (e.g. some NFS mapall/maproot problems, connection issues, drive dissapeared, etc.) echo -e "\n[X] Error: archivebox user (PUID=$PUID) is not able to write to your ./data/archive dir (currently owned by $(stat -c '%u' "$DATA_DIR/archive"):$(stat -c '%g' "$DATA_DIR/archive")." > /dev/stderr echo -e " Change ./data to be owned by PUID=$PUID PGID=$PGID on the host and retry:" > /dev/stderr echo -e " \$ chown -R $PUID:$PGID ./data\n" > /dev/stderr diff --git a/docker-compose.yml b/docker-compose.yml index b781c8a5..4db00828 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,7 @@ # https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#docker-compose --- - -version: '3.9' +version: "3.9" services: archivebox: diff --git a/package.json b/package.json index 1377ef99..129ff897 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { - "name": "archivebox", - "version": "0.7.3", - "description": "ArchiveBox: The self-hosted internet archive", - "author": "Nick Sweeting ", - "repository": "github:ArchiveBox/ArchiveBox", - "license": "MIT", - "dependencies": { - "@postlight/parser": "^2.2.3", - "readability-extractor": "github:ArchiveBox/readability-extractor", - "single-file-cli": "^1.1.46" - } + "name": "archivebox", + "version": "0.7.3", + "description": "ArchiveBox: The self-hosted internet archive", + "author": "Nick Sweeting ", + "repository": "github:ArchiveBox/ArchiveBox", + "license": "MIT", + "dependencies": + { + "@postlight/parser": "^2.2.3", + "readability-extractor": "github:ArchiveBox/readability-extractor", + "single-file-cli": "^1.1.46" + } } diff --git a/pyproject.toml b/pyproject.toml index d98f546f..53dad25c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,6 +101,7 @@ dev = [ "mypy", "django-stubs[compatible-mypy]>=4.2.7", "types-requests>=2.31.0.20240125", + "pudb>=2024.1", ] [tool.pyright]