From aae271cda62eb50c1a37416eb4df1c950b822306 Mon Sep 17 00:00:00 2001 From: Luca Baffa <47544021+lb803@users.noreply.github.com> Date: Fri, 17 Feb 2023 11:25:03 +0000 Subject: [PATCH 1/2] update beautifulsoup version and install the now required lxml library to parse xhtml reliably --- requirements.txt | 3 ++- src/epublius/epublius.py | 2 +- src/epublius/metadata.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2a2cb80..71eba8d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -beautifulsoup4==4.5.3 +beautifulsoup4==4.11.2 thothlibrary==0.17.0 +lxml==4.9.2 diff --git a/src/epublius/epublius.py b/src/epublius/epublius.py index a5ec003..59bbf08 100644 --- a/src/epublius/epublius.py +++ b/src/epublius/epublius.py @@ -184,7 +184,7 @@ def _get_opf_soup(self): raise with open(opf_path, 'r') as opf_file: - soup = BeautifulSoup(opf_file, 'html.parser') + soup = BeautifulSoup(opf_file, features='xml') return soup diff --git a/src/epublius/metadata.py b/src/epublius/metadata.py index bef4e46..f001536 100644 --- a/src/epublius/metadata.py +++ b/src/epublius/metadata.py @@ -100,7 +100,7 @@ def get_file_soup(self): self.contents[self.index]) with open(file_path, 'r') as file: - soup = BeautifulSoup(file, 'html.parser') + soup = BeautifulSoup(file, features='xml') return soup From fb2b62ae648709b6c161680f00cffafbe9cf5a92 Mon Sep 17 00:00:00 2001 From: Luca Baffa <47544021+lb803@users.noreply.github.com> Date: Fri, 17 Feb 2023 11:27:53 +0000 Subject: [PATCH 2/2] update python (docker image) version to 3.11 and revise the target platforms to cross build epublius to (linux/arm/v7 doesn't seem to be supported anymore). --- .github/workflows/publish-docker-image.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index fe2eca3..2969a7b 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -34,7 +34,7 @@ jobs: uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index a39ce4e..b2c9df7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-slim-buster +FROM python:3.11-slim-buster WORKDIR /ebook_automation