From 0c7323ae032fe7e1601601f0837ba54539c1a4fa Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Wed, 24 Apr 2024 15:29:28 +0200 Subject: [PATCH] Fix script installation via pyproject.toml. --- CHANGELOG.rst | 2 ++ MANIFEST.in | 1 + lesana/command.py | 4 ++++ pyproject.toml | 4 +--- scripts/lesana | 14 +------------- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a295f78..d936197 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,8 @@ Unreleased ========== +* Fix script installation via pyproject.toml. + 0.10.0 ====== diff --git a/MANIFEST.in b/MANIFEST.in index a4b5348..5669354 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ recursive-include docs * recursive-exclude docs/build * include CHANGELOG.rst recursive-include tests/data * +recursive-include scripts * include run_tests include run_coverage include run_qa diff --git a/lesana/command.py b/lesana/command.py index 52e6dd1..2d61238 100644 --- a/lesana/command.py +++ b/lesana/command.py @@ -454,3 +454,7 @@ class Lesana(hazwaz.MainCommand): Init(), Remove(), ) + + +def main(): + Lesana().run() diff --git a/pyproject.toml b/pyproject.toml index a4e055e..81dab8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,9 +42,7 @@ cli = [ ] [project.scripts] -lesana = "scripts.lesana:main" -openlibrary2lesana = "scripts.openlibrary2lesana:main" -tellico2lesana = "scripts.tellico2lesana:main" +lesana = "lesana.command:main" [project.urls] Homepage = "https://lesana.trueelena.org/" diff --git a/scripts/lesana b/scripts/lesana index 177ca9b..45c6703 100755 --- a/scripts/lesana +++ b/scripts/lesana @@ -8,17 +8,5 @@ import hazwaz import lesana.command - -def main(): - # setup logging for lesana cli - logger = logging.getLogger('lesana') - ch = logging.StreamHandler() - formatter = logging.Formatter('%(levelname)s:%(name)s: %(message)s') - ch.setFormatter(formatter) - logger.addHandler(ch) - logger.setLevel(logging.INFO) - - lesana.command.Lesana().run() - if __name__ == "__main__": - main() + lesana.command.Lesana().run() -- 2.45.2