Skip to content

Commit

Permalink
chore: dropped Python 3.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbrignon committed Jun 2, 2024
1 parent 085555c commit b3953aa
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 63 deletions.
3 changes: 0 additions & 3 deletions mkdocs_exporter/formats/pdf/plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import types
import asyncio
import nest_asyncio

from typing import Optional, Coroutine, Sequence

Expand Down Expand Up @@ -92,7 +91,6 @@ def on_pre_build(self, **kwargs) -> None:

self.loop = asyncio.new_event_loop()

nest_asyncio.apply(self.loop)
asyncio.set_event_loop(self.loop)

self.renderer = Renderer(options=self.config)
Expand Down Expand Up @@ -170,7 +168,6 @@ async def limit(coroutine: Coroutine) -> Coroutine:
self.loop = None
self.renderer = None

nest_asyncio.apply(self.loop)
asyncio.set_event_loop(self.loop)

if self.config.get('aggregator', {})['enabled']:
Expand Down
6 changes: 3 additions & 3 deletions mkdocs_exporter/formats/pdf/renderer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import os
import importlib_resources
import importlib.resources

from urllib.parse import unquote

Expand Down Expand Up @@ -67,8 +67,8 @@ def preprocess(self, page: Page) -> str:
with open(script, 'r', encoding='utf-8') as file:
preprocessor.script(file.read(), path=stylesheet)

preprocessor.script(importlib_resources.files(js).joinpath('pdf.js').read_text(encoding='utf-8'))
preprocessor.script(importlib_resources.files(js).joinpath('pagedjs.min.js').read_text(encoding='utf-8'))
preprocessor.script(importlib.resources.files(js).joinpath('pdf.js').read_text(encoding='utf-8'))
preprocessor.script(importlib.resources.files(js).joinpath('pagedjs.min.js').read_text(encoding='utf-8'))
preprocessor.teleport()
preprocessor.update_links(base, root)

Expand Down
4 changes: 2 additions & 2 deletions mkdocs_exporter/themes/readthedocs/theme.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

from __future__ import annotations

import importlib_resources
import importlib

from mkdocs.structure.files import File

Expand All @@ -21,7 +21,7 @@ def preprocess(self, preprocessor: Preprocessor) -> None:
"""Preprocesses the DOM before rendering a document."""

preprocessor.remove(['.rst-content > div[role="navigation"]', 'nav.wy-nav-side'])
preprocessor.stylesheet(importlib_resources.files(css).joinpath('readthedocs.css').read_text(encoding='utf-8'))
preprocessor.stylesheet(importlib.resources.files(css).joinpath('readthedocs.css').read_text(encoding='utf-8'))


def button(self, preprocessor: Preprocessor, title: str, icon: str, attributes: dict = {}):
Expand Down
64 changes: 16 additions & 48 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ classifiers = [
]

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.9"
mkdocs = ">=1.4"
playwright = ">=1.33"
beautifulsoup4 = ">=4.12.2"
lxml = ">=4.9"
libsass = ">=0.22.0"
importlib-resources = ">=5.0"
importlib-metadata = ">=6.0"
nest-asyncio = ">=1.5.6"
mkdocs-material = {extras = ["imaging"], version = "^9.4.14"}
pypdf = ">=4.2.0"

[tool.poetry.plugins."mkdocs.plugins"]
Expand All @@ -39,8 +35,8 @@ pypdf = ">=4.2.0"
"Bug Tracker" = "https://github.com/adrienbrignon/mkdocs-exporter/issues"

[tool.poetry.group.dev.dependencies]
flake8 = ">=5.0"
mkdocs-material = "^9.1.11"
flake8 = ">=7.0"
mkdocs-material = {version="^9.4.11", extras=["imaging"]}
mkdocs-git-revision-date-localized-plugin = "^1.2.0"
mkdocs-git-authors-plugin = "^0.7.0"
mkdocs-awesome-pages-plugin = "^2.9.1"
Expand Down

0 comments on commit b3953aa

Please sign in to comment.