From 861aed314fa9fde301fe28fca50ab726c9b565b3 Mon Sep 17 00:00:00 2001 From: ars Date: Thu, 25 Jun 2026 03:15:11 +0300 Subject: [PATCH] drop makefile --- Makefile | 49 ------------------------------------------------- README.md | 7 ++----- docs/cli.md | 13 +++++++------ dodo.py | 10 ++++++++++ 4 files changed, 19 insertions(+), 60 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 704cf30..0000000 --- a/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -.PHONY: all client server cli test clean docs docs-clean i18n-extract i18n-init i18n-update i18n-compile - -# CLI localization (nexus-cli strings only; daemon/server logs stay in English). -LOCALE_DIR := src/nexus_sync/locale -POT := $(LOCALE_DIR)/nexus.pot -LANG ?= ru -# PyInstaller --add-data separator is ':' on Unix, ';' on Windows. -LOCALE_DATA := $(LOCALE_DIR):nexus_sync/locale - -all: client server cli - -client: - pyinstaller --onefile src/nexus_sync/client/__main__.py --name nexus-sync-client - -server: - pyinstaller --onefile src/nexus_sync/server/__main__.py --name nexus-sync-server - -cli: i18n-compile - pyinstaller --onefile src/nexus_sync/cli/__main__.py --name nexus-cli \ - --add-data "$(LOCALE_DATA)" - -# Rebuild the message template from strings wrapped in _()/gettext()/ngettext(). -i18n-extract: - pybabel extract -F babel.cfg -k _ -o $(POT) src - -# Create a catalog for a new language, e.g. `make i18n-init LANG=de`. -i18n-init: i18n-extract - pybabel init -i $(POT) -d $(LOCALE_DIR) -D nexus -l $(LANG) - -# Merge new/changed strings into existing catalogs. -i18n-update: i18n-extract - pybabel update -i $(POT) -d $(LOCALE_DIR) -D nexus - -# Compile .po catalogs to the .mo files bundled with nexus-cli. -i18n-compile: - pybabel compile -d $(LOCALE_DIR) -D nexus - -test: - pytest - -# Build the Sphinx HTML documentation into docs/_build/html. -docs: - sphinx-build -b html docs docs/_build/html - -docs-clean: - rm -rf docs/_build - -clean: - rm -rf build dist *.spec docs/_build diff --git a/README.md b/README.md index 540bd12..8e1f72e 100644 --- a/README.md +++ b/README.md @@ -130,11 +130,8 @@ pip install -e .[docs] doit docs # output in docs/_build/html ``` -PyInstaller standalone binaries are also available through Makefile targets: - -``` -make [client|server|cli] -``` +Individual standalone binaries: `doit pyinstaller_client`, +`doit pyinstaller_server`, `doit pyinstaller_cli`. ## systemd templates diff --git a/docs/cli.md b/docs/cli.md index 87b7c94..ba54ac4 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -78,19 +78,20 @@ Translation sources live in `src/nexus_sync/locale//LC_MESSAGES/nexus.po`. Workflow (requires `pip install -e ".[dev]"`): ```bash -make i18n-extract # rebuild the .pot template from _()-wrapped strings -make i18n-update # merge new/changed strings into existing catalogs -make i18n-init LANG=de # start a new language +doit i18n_extract # rebuild the .pot template from _()-wrapped strings +doit i18n_update # merge new/changed strings into existing catalogs +doit i18n_init --lang de # start a new language # edit the .po file, then: -make i18n-compile # build the .mo files shipped with the binary +doit i18n_compile # build the .mo files shipped with the binary ``` -`make cli` compiles catalogs automatically and bundles them into the binary. +`doit pyinstaller_cli` compiles catalogs automatically and bundles them into the +binary. ## Build standalone binary ```bash -make cli +doit pyinstaller_cli ``` This creates `dist/nexus-cli` through PyInstaller (with localization catalogs diff --git a/dodo.py b/dodo.py index 81086ad..ccb6211 100644 --- a/dodo.py +++ b/dodo.py @@ -63,6 +63,16 @@ def task_i18n_extract(): } +def task_i18n_init(): + """Create a catalog for a new language, e.g. `doit i18n_init --lang de`.""" + return { + "actions": [f"{PYBABEL} init -i {POT_FILE} -d {LOCALE_DIR} -D nexus -l %(lang)s"], + "params": [{"name": "lang", "short": "l", "long": "lang", "default": "ru"}], + "file_dep": [str(POT_FILE)], + "verbosity": 2, + } + + def task_i18n_update(): """Merge new/changed strings from the template into existing catalogs.""" return {