From db97fb6b47ad082abe142892dd8b0ffb564d9fef Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 23:18:53 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.5.5 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.5...v0.9.1) - [github.com/pre-commit/mirrors-mypy: v1.11.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.0...v1.14.1) - [github.com/sourcery-ai/sourcery: v1.21.0 → v1.29.0](https://github.com/sourcery-ai/sourcery/compare/v1.21.0...v1.29.0) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c0b227d..c863a4c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-ast - id: check-builtin-literals @@ -28,19 +28,19 @@ repos: - id: sort-simple-yaml - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.5 + rev: v0.9.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.0 + rev: v1.14.1 hooks: - id: mypy args: ["--config-file", "pyproject.toml", "--ignore-missing-imports"] #args: [--strict, --ignore-missing-imports] - repo: https://github.com/sourcery-ai/sourcery - rev: v1.21.0 + rev: v1.29.0 hooks: - id: sourcery # The best way to use Sourcery in a pre-commit hook: From 4464d0c131f72e656a1567b037871faae9062983 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 23:19:04 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../_static/pythonbible-basic-usage.ipynb | 13 ++-- .../_static/pythonbible-book-groups.ipynb | 31 ++++----- .../pythonbible-multi-book-references.ipynb | 1 - .../pythonbible-single-chapter-books.ipynb | 1 - tests/conftest.py | 64 +++++++++---------- 5 files changed, 55 insertions(+), 55 deletions(-) diff --git a/docs/source/_static/pythonbible-basic-usage.ipynb b/docs/source/_static/pythonbible-basic-usage.ipynb index 40d38931..5bbff1e9 100644 --- a/docs/source/_static/pythonbible-basic-usage.ipynb +++ b/docs/source/_static/pythonbible-basic-usage.ipynb @@ -25,7 +25,6 @@ } ], "source": [ - "import sys\n", "!{sys.executable} -m pip install pythonbible" ] }, @@ -171,10 +170,12 @@ } ], "source": [ - "bible.convert_references_to_verse_ids([\n", - " bible.NormalizedReference(bible.Book.MATTHEW, 18, 12, 18, 14),\n", - " bible.NormalizedReference(bible.Book.LUKE, 15, 3, 15, 7),\n", - "])" + "bible.convert_references_to_verse_ids(\n", + " [\n", + " bible.NormalizedReference(bible.Book.MATTHEW, 18, 12, 18, 14),\n", + " bible.NormalizedReference(bible.Book.LUKE, 15, 3, 15, 7),\n", + " ]\n", + ")" ] }, { @@ -247,7 +248,7 @@ "source": [ "bible.format_scripture_references(\n", " bible.get_references(\n", - " \"My favorite verses are Philippians 4:8, Isaiah 55:13, and Philippians 4:4-7.\"\n", + " \"My favorite verses are Philippians 4:8, Isaiah 55:13, and Philippians 4:4-7.\"\n", " )\n", ")" ] diff --git a/docs/source/_static/pythonbible-book-groups.ipynb b/docs/source/_static/pythonbible-book-groups.ipynb index c486303b..02d604ab 100644 --- a/docs/source/_static/pythonbible-book-groups.ipynb +++ b/docs/source/_static/pythonbible-book-groups.ipynb @@ -17,7 +17,6 @@ "metadata": {}, "outputs": [], "source": [ - "import sys\n", "!{sys.executable} -m pip install pythonbible" ] }, @@ -115,8 +114,7 @@ "outputs": [], "source": [ "bible.get_references(\n", - " \"What are all of the books of the Old Testament?\",\n", - " book_groups=bible.BOOK_GROUPS\n", + " \"What are all of the books of the Old Testament?\", book_groups=bible.BOOK_GROUPS\n", ")" ] }, @@ -138,8 +136,7 @@ "outputs": [], "source": [ "references = bible.get_references(\n", - " \"What are all of the books of the Old Testament?\",\n", - " book_groups=bible.BOOK_GROUPS\n", + " \"What are all of the books of the Old Testament?\", book_groups=bible.BOOK_GROUPS\n", ")\n", "bible.format_scripture_references(references)" ] @@ -159,10 +156,7 @@ "metadata": {}, "outputs": [], "source": [ - "bible.format_scripture_references(\n", - " references,\n", - " always_include_chapter_numbers=True\n", - ")" + "bible.format_scripture_references(references, always_include_chapter_numbers=True)" ] }, { @@ -191,7 +185,7 @@ "source": [ "bible.get_references(\n", " \"I want to find the Old Testament books, not the Gospels.\",\n", - " book_groups=bible.BOOK_GROUPS\n", + " book_groups=bible.BOOK_GROUPS,\n", ")" ] }, @@ -216,7 +210,7 @@ "}\n", "bible.get_references(\n", " \"I want to find the Old Testament books, not the Gospels.\",\n", - " book_groups=book_groups_subset\n", + " book_groups=book_groups_subset,\n", ")" ] }, @@ -238,14 +232,21 @@ "outputs": [], "source": [ "custom_book_groups = {\n", - " \"my favorite books\": [bible.Book.PSALMS, bible.Book.PROVERBS, bible.Book.JOHN, bible.Book.PHILIPPIANS, bible.Book.JAMES],\n", + " \"my favorite books\": [\n", + " bible.Book.PSALMS,\n", + " bible.Book.PROVERBS,\n", + " bible.Book.JOHN,\n", + " bible.Book.PHILIPPIANS,\n", + " bible.Book.JAMES,\n", + " ],\n", "}\n", "references = bible.get_references(\n", - " \"What are my favorite books of the Bible?\",\n", - " book_groups=custom_book_groups\n", + " \"What are my favorite books of the Bible?\", book_groups=custom_book_groups\n", ")\n", "\n", - "print(f\"My favorite books of the Bible are {bible.format_scripture_references(references)}!\")" + "print(\n", + " f\"My favorite books of the Bible are {bible.format_scripture_references(references)}!\"\n", + ")" ] } ], diff --git a/docs/source/_static/pythonbible-multi-book-references.ipynb b/docs/source/_static/pythonbible-multi-book-references.ipynb index 5f8f51a5..89f8408e 100644 --- a/docs/source/_static/pythonbible-multi-book-references.ipynb +++ b/docs/source/_static/pythonbible-multi-book-references.ipynb @@ -17,7 +17,6 @@ "metadata": {}, "outputs": [], "source": [ - "import sys\n", "!{sys.executable} -m pip install pythonbible" ] }, diff --git a/docs/source/_static/pythonbible-single-chapter-books.ipynb b/docs/source/_static/pythonbible-single-chapter-books.ipynb index 8859a339..11f24d6f 100644 --- a/docs/source/_static/pythonbible-single-chapter-books.ipynb +++ b/docs/source/_static/pythonbible-single-chapter-books.ipynb @@ -17,7 +17,6 @@ "metadata": {}, "outputs": [], "source": [ - "import sys\n", "!{sys.executable} -m pip install pythonbible" ] }, diff --git a/tests/conftest.py b/tests/conftest.py index a92f0f4c..b044cbb2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,47 +5,47 @@ import pythonbible as bible -@pytest.fixture() +@pytest.fixture def verse_id() -> int: return 1001001 -@pytest.fixture() +@pytest.fixture def invalid_verse_id() -> int: return 1100100 -@pytest.fixture() +@pytest.fixture def book() -> bible.Book: return bible.Book.GENESIS -@pytest.fixture() +@pytest.fixture def chapter() -> int: return 1 -@pytest.fixture() +@pytest.fixture def verse() -> int: return 1 -@pytest.fixture() +@pytest.fixture def invalid_chapter() -> int: return 100 -@pytest.fixture() +@pytest.fixture def invalid_verse() -> int: return 100 -@pytest.fixture() +@pytest.fixture def text_with_reference() -> str: return "The parable of the lost sheep is told in Matthew 18:12-14 and Luke 15:3-7." -@pytest.fixture() +@pytest.fixture def text_with_reference_complex() -> str: return ( "You should read Psalm 130:4,8, Jeremiah 29:32-30:10,31:12, " @@ -53,7 +53,7 @@ def text_with_reference_complex() -> str: ) -@pytest.fixture() +@pytest.fixture def normalized_references_complex() -> list[bible.NormalizedReference]: return [ bible.NormalizedReference(bible.Book.PSALMS, 130, 4, 130, 4), @@ -65,37 +65,37 @@ def normalized_references_complex() -> list[bible.NormalizedReference]: ] -@pytest.fixture() +@pytest.fixture def non_normalized_reference() -> str: return "Matthew 18:12-14" -@pytest.fixture() +@pytest.fixture def reference_without_verse_numbers() -> str: return "Exodus 20" -@pytest.fixture() +@pytest.fixture def reference_range_without_verse_numbers() -> str: return "Genesis 1-4" -@pytest.fixture() +@pytest.fixture def reference() -> bible.NormalizedReference: return bible.NormalizedReference(bible.Book.GENESIS, 1, 1, 3, 4) -@pytest.fixture() +@pytest.fixture def invalid_reference() -> bible.NormalizedReference: return bible.NormalizedReference(bible.Book.GENESIS, 1, 1, 100, 100) -@pytest.fixture() +@pytest.fixture def reference_string() -> str: return "Genesis 1:1-3:4" -@pytest.fixture() +@pytest.fixture def references() -> list[bible.NormalizedReference]: return [ bible.NormalizedReference(bible.Book.MATTHEW, 18, 12, 18, 14), @@ -103,7 +103,7 @@ def references() -> list[bible.NormalizedReference]: ] -@pytest.fixture() +@pytest.fixture def verse_ids() -> list[int]: return [ 40018012, @@ -117,7 +117,7 @@ def verse_ids() -> list[int]: ] -@pytest.fixture() +@pytest.fixture def verse_ids_multiple_chapters() -> list[int]: return [ 40018012, @@ -127,7 +127,7 @@ def verse_ids_multiple_chapters() -> list[int]: ] -@pytest.fixture() +@pytest.fixture def verse_ids_complex() -> list[int]: return [ 19130004, @@ -176,12 +176,12 @@ def verse_ids_complex() -> list[int]: ] -@pytest.fixture() +@pytest.fixture def formatted_reference() -> str: return "Psalms 130:4,8;Jeremiah 29:32-30:10,31:12;Matthew 1:18-2:18;Luke 3:5-7" -@pytest.fixture() +@pytest.fixture def roman_numeral_references() -> str: return ( "Psalm cxxx.4,8, Jeremiah xxix. 32 - xxx. 10, xxxi. 12, " @@ -189,7 +189,7 @@ def roman_numeral_references() -> str: ) -@pytest.fixture() +@pytest.fixture def html_scripture_text() -> str: return ( "