Build tool for my book projects.
Go to file
2025-11-08 15:40:03 +01:00
.vscode modified pylint settings 2025-10-28 11:36:38 +01:00
src/bookbuild removed an unnecessary import 2025-11-08 15:40:03 +01:00
.gitignore added missing subcommands (pdf, epub, build-all); upped version to 2.0 2025-10-28 22:41:18 +01:00
COPYING added some project files 2025-10-28 11:05:09 +01:00
poetry.lock added "version" subcommand; but the version number is still hardcoded in two separate locations as poetry 1.1.12 does not support dynamic attributes in pyproject.toml 2025-11-04 13:02:46 +01:00
pyproject.toml added "version" subcommand; but the version number is still hardcoded in two separate locations as poetry 1.1.12 does not support dynamic attributes in pyproject.toml 2025-11-04 13:02:46 +01:00
README.md added "version" subcommand; but the version number is still hardcoded in two separate locations as poetry 1.1.12 does not support dynamic attributes in pyproject.toml 2025-11-04 13:02:46 +01:00

Build script for my book projects

Dependencies

  • python>=3.x
  • python-poetry>=1.1.0

Installation

Im lokalen bookbuild-Repository (Development) fkt. nicht: der Befehl installiert nur die dependencies, nicht bookbuild selbst:

$ poetry build
$ poetry install

In einem book-Repository und nur auf dieses begrenzt:

$ python -m venv .venv
$ source .venv/bin/activate
$ cd ~/path/to/bookbuild
$ poetry build
$ poetry install # alternativ: pip install dist/bookbuild-x.y.z-py3-none-any.whl

Systemweit (fkt. noch nicht):

$ pip install -e git+https://git.unterdemradar.de/tobias/bookbuild#egg=bookbuild

Programm ausführen

Mit poetry run bookbuild kann man das Programm ausführen, ohne die venv vorher aktivieren zu müssen (das erledigt poetry im Hintergrund).

Manchmal passiert es, dass der Befehl immer nur die installierte Version ausführt und nicht den aktuellen Code aus dem Repository. In diesem Fall muss man poetry update ausführen, dann sollte es wieder gehen

Im Zweifel kann man den aktuellen Code auch direkt ausführen, indem man das src/-Verzeichnis mit einbezieht. Dazu wechselt man entweder ins Verzeichnis:

$ # mit poetry
$ cd src/
$ poetry run bookbuild   # oder poetry run python -m bookbuild
$ # ohne poetry
$ . .venv/bin/activate
$ cd src/
$ python -m bookbuild

Oder man gibt das Verzeichnis als Modulpfad mit an:

$ # mit poetry
$ poetry run python -m src.bookbuild   # was nicht geht: poetry run src.bookbuild 
$ # ohne poetry
$ . .venv/bin/activate
$ python -m src.bookbuild