Skip to content

Commit

Permalink
Massive upgrade to packages. Expect breakage. In local setup everythi…
Browse files Browse the repository at this point in the history
…ng works as expected.
  • Loading branch information
mush42 committed Jun 2, 2024
1 parent 0173998 commit e35e3fc
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 48 deletions.
2 changes: 1 addition & 1 deletion bookworm/document/formats/fitz.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)

log = logger.getChild(__name__)
fitz.Tools().mupdf_display_errors(False)
# fitz.Tools().mupdf_display_errors(False)


class FitzPage(BasePage):
Expand Down
13 changes: 8 additions & 5 deletions bookworm/structured_text/structured_html_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,16 @@ def __init__(self, *args, **kwargs):
kwargs.setdefault("config", INSCRIPTIS_CONFIG)
super().__init__(*args, **kwargs)

def _parse_html_tree(self, tree):
def _parse_html_tree(self, state, tree):
canvas = state.canvas
try:
start_index = self.canvas.current_block.idx
start_index = canvas.current_block.idx
except TypeError:
start_index = 0
super()._parse_html_tree(tree)
end_index = self.canvas.current_block.idx
super()._parse_html_tree(state, tree)
end_index = canvas.current_block.idx
try:
anot = self.canvas.annotations[-1]
anot = canvas.annotations[-1]
except IndexError:
pass
else:
Expand All @@ -146,6 +147,8 @@ def _parse_html_tree(self, tree):
if tree.tag == "table":
self._table_elements.append(tree)

return state.canvas

@classmethod
def preprocess_html_string(cls, html_string):
html_content = html_string.strip()
Expand Down
1 change: 0 additions & 1 deletion invoke.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
packages_to_install:
pure_python:
- "mobi-0.3.3-py3-none-any.whl"
- "pyxpdf_data-1.1.0-py3-none-any.whl"
win32:
pure_python:
Expand Down
Binary file removed packages/mobi-0.3.3-py3-none-any.whl
Binary file not shown.
58 changes: 29 additions & 29 deletions requirements-app.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,64 @@ bp-db-magic==0.2
https://github.com/blindpandas/configobj/tarball/v5.1.0.dev0

accessible-output2==0.17
apsw==3.43.1.0
attrs==23.1.0
babel==2.12.1
apsw==3.46.0.0
attrs==23.2.0
babel==2.15.0
banal==1.0.6
beautifulsoup4==4.11.1
bidict==0.22.1
blinker==1.5
bottle==0.12.24
beautifulsoup4==4.12.3
bidict==0.23.1
blinker==1.8.2
bottle==0.12.25
chardet==4.0.0
comtypes==1.2.0
comtypes==1.4.2
cssselect==1.1.0
dateparser==1.1.7
dateparser==1.2.0
demandimport==0.3.4
diskcache==5.4.0
docrpy==0.2.0;sys_platform=="win32"
EbookLib==0.18
ftfy==6.1.1
ftfy==6.2.0
fuzzywuzzy==0.18.0
inscriptis==2.3.2
inscriptis==2.5.0
languagecodes==1.0.7
Levenshtein==0.20.0
libloader==0.21
lru-dict==1.1.8
lxml==4.9.3
mammoth==1.6.0
lxml==5.2.2
mammoth==1.7.1
mistune==0.8.4
mobi==0.3.3
more-itertools==10.1.0
msgpack==1.0.5
more-itertools==10.2.0
msgpack==1.0.8
msoffcrypto-tool==5.0.0
neosynth==3.2.0;sys_platform=="win32"
numpy==1.22.0
numpy==1.26.4
odfpy==1.4.1
opencv-python-headless==4.5.5.62
peewee==3.15.4
peewee==3.17.5
Pillow==10.3.0
platform-utils==1.5.1
pydantic==2.4.0
pymediawiki==0.7.2
PyMuPDF==1.23.3
pymediawiki==0.7.4
PyMuPDF==1.24.3
python-dateutil==2.8.2
python-docx==0.8.11
python-docx==1.1.2
python-pptx==0.6.21
pywhatlang==1.0.0
pywin32==306;sys_platform=="win32"
#pyxpdf==0.2.3
pyxpdf-data==1.1.0
trafilatura==1.6.2
tzlocal==4.2
rapidfuzz==2.6.0
requests==2.32.0
selectolax==0.3.12
rapidfuzz==3.9.3
regex==2024.5.15
requests==2.32.3
selectolax==0.3.21
SQLAlchemy==1.3.24
ujson==5.7.0
trafilatura==1.10.0
tzlocal==4.2
ujson==5.10.0
unicode-slugify==0.1.5
unrar==0.4
url-normalize==1.4.3
waitress==2.1.2
waitress==3.0.0
winpaths==0.2
wxPython==4.2.1
yarl==1.9.2
yarl==1.9.4
16 changes: 8 additions & 8 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-r requirements-app.txt

black==24.3.0
black==24.4.2
distro==1.5.0;sys_platform=="linux"
isort==5.12.0
isort==5.13.2
invoke==2.2.0
jinja2==3.1.4
packaging==23.1
pyinstaller==5.13.2
pyinstaller-hooks-contrib==2023.8
pytest==7.4.2
pytest-xdist==3.3.1
wheel==0.41.2
packaging==24.0
pyinstaller==6.7.0
pyinstaller-hooks-contrib==2024.6
pytest==8.2.1
pytest-xdist==3.6.1
wheel==0.43.0
8 changes: 4 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def copy_deps(c):
print("Done copying vcredis 2015 ucrt DLLs.")
print("Copying Unrar DLLs")
source_path = PROJECT_ROOT / "scripts" / "dlls" / "unrar_dll"
unrar_dst = Path(os.environ["IAPP_FROZEN_DIRECTORY"]) / "unrar_dll"
unrar_dst = Path(os.environ["IAPP_FROZEN_DIRECTORY"]) / "_internal" / "unrar_dll"
unrar_dst.mkdir(parents=True, exist_ok=True)
for file in source_path.iterdir():
shutil.copy(file, unrar_dst)
Expand All @@ -425,7 +425,7 @@ def copy_deps(c):
/ "BkwRicheditOpts.dll"
)
richeditopts_dll_dst = (
Path(os.environ["IAPP_FROZEN_DIRECTORY"]) / "BkwRicheditOpts.dll"
Path(os.environ["IAPP_FROZEN_DIRECTORY"]) / "_internal" / "BkwRicheditOpts.dll"
)
if not richeditopts_dll_src.exists():
if shutil.which("cargo") is None:
Expand All @@ -447,7 +447,7 @@ def copy_espeak_and_piper_libs():
PROJECT_ROOT / "scripts" / "dlls" / "espeak-ng" / arch / "espeak-ng.dll"
)
espeak_data_src = PROJECT_ROOT / "scripts" / "dlls" / "espeak-ng" / "espeak-ng-data"
espeak_dst = Path(os.environ["IAPP_FROZEN_DIRECTORY"])
espeak_dst = Path(os.environ["IAPP_FROZEN_DIRECTORY"]) / "_internal"

print("Copying eSpeak-ng dll and data...")
shutil.copy(espeak_dll_src, espeak_dst)
Expand All @@ -459,7 +459,7 @@ def copy_espeak_and_piper_libs():
onnxruntime_notices_src = (
PROJECT_ROOT / "scripts" / "dlls" / "onnxruntime" / "notices"
)
onnxruntime_dst = Path(os.environ["IAPP_FROZEN_DIRECTORY"]) / "onnxruntime"
onnxruntime_dst = Path(os.environ["IAPP_FROZEN_DIRECTORY"]) / "_internal" / "onnxruntime"
onnxruntime_dst.mkdir(parents=True, exist_ok=True)

print("Copying ONNXRuntime dll and notices...")
Expand Down

0 comments on commit e35e3fc

Please sign in to comment.