Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libegl1
- name: Install packages
run: |
pip install .
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ ninja = "*"
protobuf = ">=3.19.2, <=3.20.3"
gflanguages = "*"
freetype-py = "*"
blackrenderer = {extras = ["skia"], version = "^0.6.0"}
unicodedata2 = "^15.0.0"
blackrenderer = {extras = ["skia"], version = ">=0.6.0"}
unicodedata2 = ">=15.0.0"
tqdm = "^4.64.1"
youseedee = "^0.5.0"
python-bidi = "<0.5.0"
youseedee = ">=0.5.0"
python-bidi = "*"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
Expand Down
4 changes: 1 addition & 3 deletions src/diffenator2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import os
from ninja.ninja_syntax import Writer
from diffenator2.renderer import FONT_SIZE
from diffenator2.utils import dict_coords_to_string
from diffenator2.utils import dict_coords_to_string, partition, resource_filename
from diffenator2.font import DFont, get_font_styles
from diffenator2.utils import partition
from diffenator2.matcher import FontMatcher
from pkg_resources import resource_filename
import shutil
import ninja

Expand Down
2 changes: 1 addition & 1 deletion src/diffenator2/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from diffenator2.font import DFont
from diffenator2.html import build_index_page
from diffenator2.renderer import FONT_SIZE
from pkg_resources import resource_filename
from diffenator2.utils import resource_filename
from glob import glob


Expand Down
3 changes: 1 addition & 2 deletions src/diffenator2/_diffbrowsers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python3
from __future__ import annotations
from pkg_resources import resource_filename
from diffenator2.html import proof_rendering, diff_rendering
from diffenator2.font import DFont, get_font_styles
from diffenator2.matcher import FontMatcher
from diffenator2.utils import re_filter_characters
from diffenator2.utils import re_filter_characters, resource_filename
from glob import glob
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion src/diffenator2/_diffenator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
)
from diffenator2.font import DFont
from diffenator2.matcher import FontMatcher
from pkg_resources import resource_filename
import os
from diffenator2.shape import test_words, test_fonts
from diffenator2 import jfont, THRESHOLD
Expand Down
3 changes: 1 addition & 2 deletions src/diffenator2/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from diffenator2 import THRESHOLD
from diffenator2.renderer import FONT_SIZE, PixelDiffer
from diffenator2.template_elements import Word, WordDiff, Glyph, GlyphDiff
from diffenator2.utils import gen_gif
from pkg_resources import resource_filename
from diffenator2.utils import gen_gif, resource_filename
import tqdm
from diffenator2.segmenting import textSegments
from collections import defaultdict
Expand Down
6 changes: 5 additions & 1 deletion src/diffenator2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
from __future__ import annotations
import os
from pkg_resources import resource_filename
from importlib.resources import files
from PIL import Image
from gflanguages import LoadLanguages
from functools import lru_cache
Expand All @@ -33,6 +33,10 @@
TEST_STRINGS_DATA = os.path.join(os.path.dirname(__file__), "data", "test_strings.json")


def resource_filename(package: str, resource: str) -> str:
return str(files(package).joinpath(resource))


def dict_coords_to_string(coords: dict[str, float]) -> str:
return ",".join(f"{k}={v}" for k, v in coords.items())

Expand Down
Loading