-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade dependencies and migrate to zimscraperlib 3.3.2
- Loading branch information
Showing
12 changed files
with
173 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[files.assets.config] | ||
target_dir="src/youtube2zim/templates/assets" | ||
execute_after=[ | ||
"fix_ogvjs_dist .", | ||
] | ||
|
||
[files.assets.actions."video.js"] | ||
action="extract_all" | ||
source="https://github.com/videojs/video.js/releases/download/v7.8.1/video-js-7.8.1.zip" | ||
target_dir="videojs" | ||
remove = ["alt","examples",] | ||
|
||
[files.assets.actions."chosen.jquery.js"] | ||
action="extract_all" | ||
source="https://github.com/harvesthq/chosen/releases/download/v1.8.7/chosen_v1.8.7.zip" | ||
target_dir="chosen" | ||
remove = ["docsupport","chosen.proto.*","*.html","*.md"] | ||
|
||
[files.assets.actions."jquery.min.js"] | ||
action="get_file" | ||
source="https://code.jquery.com/jquery-3.5.1.min.js" | ||
target_file="jquery.min.js" | ||
|
||
[files.assets.actions."ogv.js"] | ||
action="extract_items" | ||
source="https://github.com/brion/ogv.js/releases/download/1.8.9/ogvjs-1.8.9.zip" | ||
zip_paths=["ogvjs-1.8.9"] | ||
target_paths=["ogvjs"] | ||
remove = ["ogvjs/COPYING","ogvjs/*.txt","ogvjs/*.md",] | ||
|
||
[files.assets.actions."videojs-ogvjs.js"] | ||
action="extract_items" | ||
source="https://github.com/hartman/videojs-ogvjs/archive/v1.3.1.zip" | ||
zip_paths=["videojs-ogvjs-1.3.1/dist/videojs-ogvjs.js"] | ||
target_paths=["videojs-ogvjs.js"] | ||
|
||
[files.assets.actions."webp-hero.polyfills.js"] | ||
action="get_file" | ||
source="https://unpkg.com/[email protected]/dist-cjs/polyfills.js" | ||
target_file="polyfills.js" | ||
|
||
[files.assets.actions."webp-hero.bundle.js"] | ||
action="get_file" | ||
source="https://unpkg.com/[email protected]/dist-cjs/webp-hero.bundle.js" | ||
target_file="webp-hero.bundle.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,50 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
requires = ["hatchling", "hatch-openzim==0.2.1"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "youtube2zim" | ||
authors = [{ name = "Kiwix", email = "[email protected]" }] | ||
keywords = ["kiwix", "zim", "offline", "youtube"] | ||
requires-python = ">=3.10,<3.11" | ||
requires-python = ">=3.12,<3.13" | ||
description = "Make ZIM file from a Youtube channel, user or playlist(s)" | ||
readme = "README.md" | ||
license = { text = "GPL-3.0-or-later" } | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
] | ||
dependencies = [ | ||
"python-slugify==3.0.3", | ||
"yt-dlp", # youtube-dl should be updated as frequently as possible | ||
"python-dateutil==2.8.0", | ||
"jinja2>=2.11,<3.0", | ||
"python-dateutil==2.9.0.post0", | ||
"jinja2==3.1.4", | ||
"MarkupSafe==2.0.1", # jinja2 dependency (https://github.com/pallets/markupsafe/issues/284) | ||
"zimscraperlib>=2.0.0,<2.1.0", | ||
"zimscraperlib==3.3.2", | ||
"requests==2.31.0", | ||
"kiwixstorage==0.8.3", | ||
"pif==0.8.2", | ||
] | ||
dynamic = ["version"] | ||
dynamic = ["authors", "classifiers", "keywords", "license", "version", "urls"] | ||
|
||
[tool.hatch.metadata] | ||
allow-direct-references = true | ||
|
||
[tool.hatch.metadata.hooks.openzim-metadata] | ||
kind = "scraper" | ||
additional-keywords = ["youtube"] | ||
|
||
[tool.hatch.build.hooks.openzim-build] | ||
dependencies = [ "zimscraperlib==3.3.2"] # required for fix_ogv_dist | ||
|
||
[project.optional-dependencies] | ||
scripts = ["invoke==2.2.0"] | ||
lint = ["black==23.9.1", "ruff==0.0.292"] | ||
check = ["pyright==1.1.331"] | ||
test = ["pytest==7.4.2", "coverage==7.3.2"] | ||
lint = ["black==24.4.2", "ruff==0.4.4"] | ||
check = ["pyright==1.1.363"] | ||
test = ["pytest==8.1.1", "coverage==7.4.4"] | ||
dev = [ | ||
"pre-commit==3.4.0", | ||
"debugpy==1.8.0", | ||
"pre-commit==3.7.1", | ||
"debugpy==1.8.1", | ||
"youtube2zim[scripts]", | ||
"youtube2zim[lint]", | ||
"youtube2zim[test]", | ||
"youtube2zim[check]", | ||
# hatchling is a dev dependency only needed for hook development on developer machine | ||
"hatchling==1.18.0", | ||
"humanfriendly==10.0" | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/openzim/youtube" | ||
Donate = "https://www.kiwix.org/en/support-us/" | ||
|
||
[project.scripts] | ||
youtube2zim = "youtube2zim.__main__:main" | ||
youtube2zim-playlists = "youtube2zim.playlists.__main__:main" | ||
|
@@ -59,12 +55,11 @@ path = "src/youtube2zim/__about__.py" | |
[tool.hatch.build] | ||
exclude = ["/.github"] | ||
|
||
[tool.hatch.build.hooks.custom] | ||
path = "hatch_build.py" | ||
dependencies = ["zimscraperlib>=2.0.0,<2.1.0"] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/youtube2zim"] | ||
artifacts = [ | ||
"src/youtube2zim/templates/assets/**", | ||
] | ||
|
||
[tool.hatch.envs.default] | ||
features = ["dev"] | ||
|
@@ -81,7 +76,7 @@ html = "inv coverage --html --args '{args}'" | |
|
||
[tool.hatch.envs.lint] | ||
template = "lint" | ||
python = "py311" | ||
python = "py312" | ||
skip-install = false | ||
features = ["scripts", "lint"] | ||
|
||
|
@@ -102,13 +97,15 @@ all = "inv checkall --args '{args}'" | |
|
||
[tool.black] | ||
line-length = 88 | ||
target-version = ['py311'] | ||
target-version = ['py312'] | ||
exclude = "(src/youtube2zim/templates/.*|.hatch/.*)" | ||
|
||
[tool.ruff] | ||
target-version = "py311" | ||
target-version = "py312" | ||
line-length = 88 | ||
src = ["src"] | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"A", # flake8-builtins | ||
# "ANN", # flake8-annotations | ||
|
@@ -193,13 +190,13 @@ unfixable = [ | |
"F401", | ||
] | ||
|
||
[tool.ruff.isort] | ||
[tool.ruff.lint.isort] | ||
known-first-party = ["youtube2zim"] | ||
|
||
[tool.ruff.flake8-tidy-imports] | ||
[tool.ruff.lint.flake8-tidy-imports] | ||
ban-relative-imports = "all" | ||
|
||
[tool.ruff.per-file-ignores] | ||
[tool.ruff.lint.per-file-ignores] | ||
# Tests can use magic values, assertions, and relative imports | ||
"tests/**/*" = ["PLR2004", "S101", "TID252"] | ||
|
||
|
@@ -225,5 +222,6 @@ exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] | |
include = ["src", "tests", "tasks.py"] | ||
exclude = [".env/**", ".venv/**", "src/youtube2zim/templates", ".hatch"] | ||
extraPaths = ["src"] | ||
pythonVersion = "3.10" | ||
pythonVersion = "3.12" | ||
typeCheckingMode = "basic" | ||
disableBytesTypePromotions = true |
Oops, something went wrong.