Skip to content

Commit

Permalink
Use pyproject toml (#71)
Browse files Browse the repository at this point in the history
* move from setup.py to pyproject.toml

* update readme
  • Loading branch information
kha-white authored Jun 21, 2024
1 parent 965d0f6 commit 2d511cd
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 61 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ See also:

# Installation

You need Python 3.8, 3.9, 3.10 or 3.11.
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.
Refer to [PyTorch website](https://pytorch.org/get-started/locally/) for a list of supported Python versions.

Some users have reported problems with Python installed from Microsoft Store. If you see an error:
`ImportError: DLL load failed while importing fugashi: The specified module could not be found.`,
try installing Python from the [official site](https://www.python.org/downloads).

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

Run in command line:

```commandline
pip3 install manga-ocr
```

## Troubleshooting

- `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)
Expand Down
3 changes: 1 addition & 2 deletions manga_ocr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
__version__ = "0.1.11"

from ._version import __version__
from manga_ocr.ocr import MangaOcr
1 change: 1 addition & 0 deletions manga_ocr/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.11"
File renamed without changes
2 changes: 1 addition & 1 deletion manga_ocr/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(

example_path = Path(__file__).parent / "assets/example.jpg"
if not example_path.is_file():
example_path = Path(__file__).parent.parent / "assets/example.jpg"
raise FileNotFoundError(f"Missing example image {example_path}")
self(example_path)

logger.info("OCR ready")
Expand Down
42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[project]
name = "manga-ocr"
authors = [
{name = "Maciej Budyś", email = "[email protected]"},
]
description = "OCR for Japanese manga"
readme = "README.md"
requires-python = ">=3.6"
license = {file = "LICENSE"}
classifiers = [
"Programming Language :: Python :: 3",
]

dynamic = ["version"]
dependencies = [
"fire",
"fugashi",
"jaconv",
"loguru",
"numpy<2",
"Pillow>=10.0.0",
"pyperclip",
"torch>=1.0",
"transformers>=4.25.0",
"unidic_lite",
]

[project.urls]
Homepage = "https://github.com/kha-white/manga-ocr"

[build-system]
requires = ["setuptools >= 61.0.0", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["manga_ocr"]

[tool.setuptools.dynamic]
version = {attr = "manga_ocr._version.__version__"}

[project.scripts]
manga_ocr = "manga_ocr.__main__:main"
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

40 changes: 0 additions & 40 deletions setup.py

This file was deleted.

0 comments on commit 2d511cd

Please sign in to comment.