Skip to content

Commit 2d511cd

Browse files
authored
Use pyproject toml (#71)
* move from setup.py to pyproject.toml * update readme
1 parent 965d0f6 commit 2d511cd

File tree

9 files changed

+51
-61
lines changed

9 files changed

+51
-61
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ See also:
2323

2424
# Installation
2525

26-
You need Python 3.8, 3.9, 3.10 or 3.11.
26+
You need Python 3.6 or newer. Please note, that the newest Python release might not be supported due to a PyTorch dependency, which often breaks with new Python releases and needs some time to catch up.
27+
Refer to [PyTorch website](https://pytorch.org/get-started/locally/) for a list of supported Python versions.
28+
29+
Some users have reported problems with Python installed from Microsoft Store. If you see an error:
30+
`ImportError: DLL load failed while importing fugashi: The specified module could not be found.`,
31+
try installing Python from the [official site](https://www.python.org/downloads).
2732

2833
If you want to run with GPU, install PyTorch as described [here](https://pytorch.org/get-started/locally/#start-locally),
2934
otherwise this step can be skipped.
3035

31-
Run in command line:
32-
33-
```commandline
34-
pip3 install manga-ocr
35-
```
36-
3736
## Troubleshooting
3837

3938
- `ImportError: DLL load failed while importing fugashi: The specified module could not be found.` - might be because of Python installed from Microsoft Store, try installing Python from the [official site](https://www.python.org/downloads)

manga_ocr/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
__version__ = "0.1.11"
2-
1+
from ._version import __version__
32
from manga_ocr.ocr import MangaOcr

manga_ocr/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.1.11"

manga_ocr/ocr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(
3232

3333
example_path = Path(__file__).parent / "assets/example.jpg"
3434
if not example_path.is_file():
35-
example_path = Path(__file__).parent.parent / "assets/example.jpg"
35+
raise FileNotFoundError(f"Missing example image {example_path}")
3636
self(example_path)
3737

3838
logger.info("OCR ready")

pyproject.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[project]
2+
name = "manga-ocr"
3+
authors = [
4+
{name = "Maciej Budyś", email = "kha-white@mail.com"},
5+
]
6+
description = "OCR for Japanese manga"
7+
readme = "README.md"
8+
requires-python = ">=3.6"
9+
license = {file = "LICENSE"}
10+
classifiers = [
11+
"Programming Language :: Python :: 3",
12+
]
13+
14+
dynamic = ["version"]
15+
dependencies = [
16+
"fire",
17+
"fugashi",
18+
"jaconv",
19+
"loguru",
20+
"numpy<2",
21+
"Pillow>=10.0.0",
22+
"pyperclip",
23+
"torch>=1.0",
24+
"transformers>=4.25.0",
25+
"unidic_lite",
26+
]
27+
28+
[project.urls]
29+
Homepage = "https://github.com/kha-white/manga-ocr"
30+
31+
[build-system]
32+
requires = ["setuptools >= 61.0.0", "setuptools_scm"]
33+
build-backend = "setuptools.build_meta"
34+
35+
[tool.setuptools]
36+
packages = ["manga_ocr"]
37+
38+
[tool.setuptools.dynamic]
39+
version = {attr = "manga_ocr._version.__version__"}
40+
41+
[project.scripts]
42+
manga_ocr = "manga_ocr.__main__:main"

requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)