From 4410bd346bf508fb1e1c4f350db810b36b7ded2a Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Jun 2024 11:48:16 +0000 Subject: [PATCH 1/4] Upgrade dependencies --- .pre-commit-config.yaml | 8 ++++---- CHANGELOG.md | 4 ++++ pyproject.toml | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9df00ba..11e8b36 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,20 +2,20 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/psf/black - rev: "24.4.0" + rev: "24.4.2" hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.0 + rev: v0.4.10 hooks: - id: ruff - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.359 + rev: v1.1.368 hooks: - id: pyright name: pyright (system) diff --git a/CHANGELOG.md b/CHANGELOG.md index a292e7c..639fe57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Updgrade to zimscraperlib 3.4.0 (including **new webm encoder presets to migrate to VP9 instead of VP8**) (#204) + ## [3.0.1] - 2024-05-14 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index 35b6e24..2474d22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,11 +9,11 @@ description = "Make ZIM file from TED Talks" readme = "README.md" dependencies = [ "python-dateutil==2.9.0.post0", - "zimscraperlib==3.3.2", - "requests==2.32.0", + "zimscraperlib==3.4.0", + "requests==2.32.3", "beautifulsoup4==4.12.3", "Jinja2==3.1.4", - "kiwixstorage==0.8.3", + "kiwixstorage==0.9.0", "pif==0.8.2", "python-slugify==8.0.4", "yt-dlp", # yt-dlp should be updated as frequently as possible @@ -28,25 +28,25 @@ kind = "scraper" additional-keywords = ["ted"] [tool.hatch.build.hooks.openzim-build] -dependencies = [ "zimscraperlib==3.3.2"] # required for fix_ogv_dist +dependencies = [ "zimscraperlib==3.4.0"] # required for fix_ogv_dist [project.optional-dependencies] scripts = [ "invoke==2.2.0", ] lint = [ - "black==24.4.0", - "ruff==0.4.0", + "black==24.4.2", + "ruff==0.4.10", ] check = [ - "pyright==1.1.359", + "pyright==1.1.368", ] test = [ - "pytest==8.1.1", - "coverage==7.4.4", + "pytest==8.2.2", + "coverage==7.5.3", ] dev = [ - "pre-commit==3.7.0", + "pre-commit==3.7.1", "debugpy==1.8.1", "ted2zim[scripts]", "ted2zim[lint]", From 31ad2cceda806f6d9abdb4b985c5fea628140107 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Jun 2024 11:59:12 +0000 Subject: [PATCH 2/4] Implement bootstrap v1.0.2 --- .github/workflows/Tests.yaml | 1 + README.md | 2 +- tasks.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index 838269f..c287059 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -30,6 +30,7 @@ jobs: - name: Upload coverage report to codecov uses: codecov/codecov-action@v3 with: + fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} build_python: diff --git a/README.md b/README.md index 459aeb9..faca661 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This project is aimed at creating a sustainable solution to make TED accessible `ted2zim` adheres to openZIM's [Contribution Guidelines](https://github.com/openzim/overview/wiki/Contributing). -`ted2zim` has implemented openZIM's [Python bootstrap, conventions and policies](https://github.com/openzim/_python-bootstrap/docs/Policy.md) **v1.0.1**. +`ted2zim` has implemented openZIM's [Python bootstrap, conventions and policies](https://github.com/openzim/_python-bootstrap/docs/Policy.md) **v1.0.2**. ## Getting started :rocket: diff --git a/tasks.py b/tasks.py index a95c71a..87cd552 100644 --- a/tasks.py +++ b/tasks.py @@ -24,6 +24,7 @@ def report_cov(ctx: Context, *, html: bool = False): """report coverage""" ctx.run("coverage combine", warn=True, pty=use_pty) ctx.run("coverage report --show-missing", pty=use_pty) + ctx.run("coverage xml", pty=use_pty) if html: ctx.run("coverage html", pty=use_pty) From 0577dac6c46b6fc45406e3d5919ba6163b14a760 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Jun 2024 12:02:10 +0000 Subject: [PATCH 3/4] Add missing CHANGELOG entry for previous change --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 639fe57..4711082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updgrade to zimscraperlib 3.4.0 (including **new webm encoder presets to migrate to VP9 instead of VP8**) (#204) +### Fixed + +- Retry logic is still failing because req might be null when timeout occurs (#203) + ## [3.0.1] - 2024-05-14 ### Fixed From 6614d4b1d4a013eb65fa9d07e43179974a5f47f4 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Fri, 21 Jun 2024 12:03:51 +0000 Subject: [PATCH 4/4] Typo in disable-metadata-checks arg in ted2zim-multi --- CHANGELOG.md | 1 + src/ted2zim/multi/scraper.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4711082..0a96d3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Retry logic is still failing because req might be null when timeout occurs (#203) +- Typo in disable-metadata-checks arg in ted2zim-multi (#202) ## [3.0.1] - 2024-05-14 diff --git a/src/ted2zim/multi/scraper.py b/src/ted2zim/multi/scraper.py index 3a57400..b3ead25 100644 --- a/src/ted2zim/multi/scraper.py +++ b/src/ted2zim/multi/scraper.py @@ -285,7 +285,7 @@ def run_indiv_zim_mode(self, item, mode): args += ["--debug"] if self.disable_metadata_checks: - args += ["--disable-metadatachecks"] + args += ["--disable-metadata-checks"] logger.debug(nicer_args_join(args)) process = subprocess.run( @@ -317,7 +317,7 @@ def handle_single_zim(self, mode): if self.debug: args += ["--debug"] if self.disable_metadata_checks: - args += ["--disable-metadatachecks"] + args += ["--disable-metadata-checks"] return subprocess.run(args, check=False).returncode def fetch_metadata(self):