Repos / pytaku / 1566196494
commit 1566196494769ff7854d728e83446cd8a3396b12
Author: Bùi Thành Nhân <hi@imnhan.com>
Date: Sat Sep 18 22:34:53 2021 +0700
fucking importlib
Apparently with python3.9 it would vomit out an IsADirectoryError:
IsADirectoryError: [Errno 21] Is a directory:
'/home/pytaku/.local/lib/python3.9/site-packages/pytaku/database/migrations'
diff --git a/pyproject.toml b/pyproject.toml
index 798150a..53dfe02 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pytaku"
-version = "0.5.0"
+version = "0.5.1"
description = "Self-hostable web-based manga reader"
authors = ["Bùi Thành Nhân <hi@imnhan.com>"]
license = "AGPL-3.0-only"
diff --git a/src/pytaku/database/migrator.py b/src/pytaku/database/migrator.py
index f9a1909..bdc8c8e 100644
--- a/src/pytaku/database/migrator.py
+++ b/src/pytaku/database/migrator.py
@@ -56,7 +56,8 @@ def migrate(overwrite_latest_schema=True):
if not Path(DBNAME).is_file():
run_sql("PRAGMA journal_mode = WAL;")
- with resources.path(migrations, "") as migrations_dir:
+ with resources.path(migrations, "__init__.py") as migrations_dir:
+ migrations_dir = migrations_dir.parent
pending_migrations = _get_pending_migrations(migrations_dir)
if not pending_migrations:
print("Nothing to migrate.")