From 023005c262e0b0de6aaba1b600597f585299876e Mon Sep 17 00:00:00 2001 From: Albert Weichselbraun Date: Tue, 7 Jan 2025 15:39:49 +0100 Subject: [PATCH 1/4] chg: adapted year. --- src/inscriptis/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inscriptis/metadata.py b/src/inscriptis/metadata.py index c86c482..e0682b9 100644 --- a/src/inscriptis/metadata.py +++ b/src/inscriptis/metadata.py @@ -8,7 +8,7 @@ __author_email__ = "albert.weichselbraun@fhgr.ch, fabian.odoni@fhgr.ch" __copyright__ = ( f"{metadata.metadata(PACKAGE)['Name']} " - + f"{metadata.metadata(PACKAGE)['Version']} © 2016-2023 {__author__}" + + f"{metadata.metadata(PACKAGE)['Version']} © 2016-2025 {__author__}" ) __license__ = metadata.metadata(PACKAGE)["License"] __version__ = metadata.metadata(PACKAGE)["Version"] From 3c39d1f9138fb5230730255727eb2a9e20034c93 Mon Sep 17 00:00:00 2001 From: Albert Weichselbraun Date: Tue, 7 Jan 2025 15:40:06 +0100 Subject: [PATCH 2/4] add: python 3.13 support; deprecated python 3.8 --- pyproject.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 27c1f69..bb9be52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "inscriptis" -version = "2.5.0" +version = "2.5.1" authors = ["Albert Weichselbraun ", "Fabian Odoni "] description = "inscriptis - HTML to text converter." keywords = ["HTML", "converter", "text"] @@ -12,11 +12,11 @@ classifiers = [ 'Topic :: Text Processing :: Markup :: HTML', 'Topic :: Utilities', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ] homepage = "https://github.com/weblyzard/inscriptis" repository = "https://github.com/weblyzard/inscriptis" @@ -39,13 +39,13 @@ web-service = ["fastapi", "uvicorn"] [tool.poetry.dependencies] -python = "^3.8 || ^3.9 || ^3.10 || ^3.11 || ^3.12" -requests = ">=2.31.0" +python = "^3.9 || ^3.10 || ^3.11 || ^3.12 || ^3.13" +requests = "2.32.2" lxml = ">=4.9.3" # optional dependencies -fastapi = { version = "^0.109.0", optional = true } -uvicorn = { version = "^0.25.0", optional = true } +fastapi = { version = "^0.109.1", optional = true } +uvicorn = { version = "^0.27.1", optional = true } [build-system] @@ -56,7 +56,7 @@ build-backend = "poetry.core.masonry.api" # code formatting with black [tool.black] line-length = 88 -target-version = ["py38", "py39", "py310", "py311", "py312"] +target-version = ["py39", "py310", "py311", "py312", "py313"] extend-exclude = '\.html$|\.json$|\.txt$|/a$|/b$' include = ''' ^/src/|^/tests/|^/benchmarking/|^/examples/ From 9dacbcda667d797079d115b002a0b6035745ec23 Mon Sep 17 00:00:00 2001 From: Albert Weichselbraun Date: Tue, 7 Jan 2025 15:56:48 +0100 Subject: [PATCH 3/4] chg: optimized apply_attributes --- src/inscriptis/model/attribute.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/inscriptis/model/attribute.py b/src/inscriptis/model/attribute.py index a66e9bd..f8d5324 100644 --- a/src/inscriptis/model/attribute.py +++ b/src/inscriptis/model/attribute.py @@ -57,13 +57,9 @@ def apply_attributes( attributes: the list of attributes html_element: the HTML element for which the attributes are parsed """ - supported_attributes = ( - (name, val) - for name, val in attributes.items() - if name in self.attribute_mapping - ) - for attr_name, attr_value in supported_attributes: - self.attribute_mapping[attr_name](attr_value, html_element) + for attr_name, attr_value in attributes.items(): + if attr_name in self.attribute_mapping: + self.attribute_mapping[attr_name](attr_value, html_element) return html_element def merge_attribute_map(self, annotations: List[ApplyAnnotation] = None) -> None: From 863201a7918a538b5a5ad40e71e059c5442e2a85 Mon Sep 17 00:00:00 2001 From: Albert Weichselbraun Date: Tue, 7 Jan 2025 16:08:25 +0100 Subject: [PATCH 4/4] fix: add support for Python 3.13; drop support for Python 3.8 --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c2cb2d5..7e7a223 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -7,11 +7,11 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] steps: - uses: actions/checkout@v3