python3Packages.manga-ocr: 0.1.11 -> 0.1.12
This commit is contained in:
parent
d397f461d6
commit
4a1558c5fe
@ -1,48 +1,30 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildPythonPackage,
|
||||
fire,
|
||||
fugashi,
|
||||
jaconv,
|
||||
loguru,
|
||||
numpy,
|
||||
pillow,
|
||||
pyperclip,
|
||||
torch,
|
||||
transformers,
|
||||
unidic-lite,
|
||||
pythonOlder,
|
||||
python3Packages,
|
||||
}:
|
||||
|
||||
with python3Packages;
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "manga-ocr";
|
||||
version = "0.1.11";
|
||||
version = "0.1.12";
|
||||
disabled = pythonOlder "3.7";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kha-white";
|
||||
repo = pname;
|
||||
repo = "manga-ocr";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-cLmgHBt6HvhY6Hb9yQ425Gk181axnMr+Mp2LxSmPoDg=";
|
||||
hash = "sha256-uSWnrHS59fNcF7ve3imMwwNJ+/dmplBAavbDoBkEgGc=";
|
||||
};
|
||||
|
||||
preBuild = ''
|
||||
# remove subproject dedicated to model training
|
||||
rm -rf manga_ocr_dev
|
||||
# copy assets/example.jpg inside the package
|
||||
# required by https://github.com/kha-white/manga-ocr/blob/ba1b0d94a8ef6676b618ba4e5ffe8ce2ab655270/manga_ocr/ocr.py#L27-L30
|
||||
# see also package_data.patch
|
||||
mkdir manga_ocr/assets
|
||||
cp assets/example.jpg manga_ocr/assets/example.jpg
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# instruct setuptool to copy assets/example.jpg to package when building wheel
|
||||
./package_data.patch
|
||||
build-system = [
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# taken from requirements.txt
|
||||
dependencies = [
|
||||
fire
|
||||
fugashi
|
||||
jaconv
|
||||
|
@ -1,12 +0,0 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -18,6 +18,9 @@ setup(
|
||||
],
|
||||
packages=['manga_ocr'],
|
||||
include_package_data=True,
|
||||
+ package_data={
|
||||
+ 'manga_ocr': ['assets/example.jpg'],
|
||||
+ },
|
||||
install_requires=[
|
||||
"fire",
|
Loading…
Reference in New Issue
Block a user