freelance-project-34-market.../Makefile
LLM 5e1a06a6b5 [+] merge gitea/master, regenerate requirements for py3.13
1. merge gitea/master into 25-llm-archlinux-package-manager;
  2. incorporate master deps: tomlq, pip==25.1, django, fastapi, uvicorn;
  3. add requirements.3.13.txt with version-specific mapping;
  4. remove generic requirements.txt, pyproject.toml from tracking;
  5. fix whl_cache_download to run once after compile, before install;
  6. update m.py to use pyproject.common.toml for bootstrap;
2026-04-06 09:32:19 +00:00

254 lines
6.5 KiB
Makefile

.PHONY: python_clean_online_fxreader_vpn
host_deps:
./m.py host_deps
python_lint:
./m.py mypy -- -f vscode 2>&1 | less
python_tests:
./m.py tests
#python_clean_online_fxreader_vpn:
# rm -fr \
# deps/com.github.aiortc.aiortc/src/online_fxreader/vpn/dist;
PYTHON_PROJECTS ?= \
deps/com.github.aiortc.aiortc/ \
deps/com.github.aiortc.aiortc/src/online_fxreader/vpn/ \
python
INSTALL_ROOT ?= ~/.local/bin
#python_clean: python_clean_online_fxreader_vpn
python_clean_env:
rm -fr \
$(INSTALL_ROOT)/env3;
python_put_env:
[[ -d $(INSTALL_ROOT)/env3 ]] || (\
uv venv --system-site-packages --seed $(INSTALL_ROOT)/env3 && \
$(INSTALL_ROOT)/env3/bin/python3 -m pip install --force-reinstall uv \
);
python_clean_dist:
for o in $(PYTHON_PROJECTS); do \
[[ -d $$o/dist ]] || continue; \
echo $$o/dist; \
rm -fr $$o/dist; \
done
python_clean: python_clean_dist python_clean_env
UV_ARGS ?= --offline
python_put_dist:
for f in \
$(PYTHON_PROJECTS); do \
[[ -d $$f/dist ]] && continue; \
echo $$f; \
python3 -m build -n $$f; \
$(INSTALL_ROOT)/env3/bin/python3 -m uv pip install $(UV_ARGS) $$f/dist/*.whl; \
done
ln -sf $(INSTALL_ROOT)/env3/bin/online-fxreader-pr34-commands $(INSTALL_ROOT)/commands
python_put_pr34:
$(INSTALL_ROOT)/env3/bin/python3 -m uv pip install $(UV_ARGS) \
-f releases/whl \
-U \
online.fxreader.pr34
ln -sf $(INSTALL_ROOT)/env3/bin/online-fxreader-pr34-commands $(INSTALL_ROOT)/commands
ln -sf $(INSTALL_ROOT)/env3/bin/oom_firefox $(INSTALL_ROOT)/oom_firefox
python_put_archlinux_venv:
cd python && ./.venv/bin/python3 -m uv pip install \
--no-cache --no-index --no-deps --reinstall \
-f ../releases/whl \
online.fxreader.pr34.commands_typed.archlinux
PYTHON_PROJECTS_NAMES ?= online.fxreader.pr34
python_whl:
for f in $(PYTHON_PROJECTS_NAMES); do \
./m.py deploy:wheel -o releases/whl -p $$f; \
done
python_put: python_put_dist python_put_env
dotfiles_put:
mkdir -p $(INSTALL_ROOT)
cp dotfiles/.local/bin/gnome-shortcuts-macbook-air $(INSTALL_ROOT)/
mkdir -p ~/.sway
cp dotfiles/.sway/config ~/.sway/config
cp dotfiles/.zshenv ~/.zshenv
cp dotfiles/.zshrc ~/.zshrc
cp dotfiles/.vimrc ~/.vimrc
cp dotfiles/.tmux.conf ~/.tmux.conf
cp dotfiles/.py3.vimrc ~/.py3.vimrc
cp dotfiles/.gitconfig ~/.gitconfig
cp -rp \
dotfiles/.ipython/profile_default/ipython_config.py \
~/.ipython/profile_default/ipython_config.py
D1=Code\ -\ OSS; \
for p in \
"dotfiles/.config/$$D1/User/keybindings.json" \
"dotfiles/.config/$$D1/User/settings.json"; do \
commands install -f -p "dotfiles/.config/$$D1" -s "$$p" -t ~/.config/"$$D1"; \
done
#commands install -f -p dotfiles -s dotfiles/ -t ~/.config/
dotfiles_vim_put:
@echo INSTALL_ROOT=$(INSTALL_ROOT)
mkdir -p $(INSTALL_ROOT)
mkdir -p $(INSTALL_ROOT)/.vim
cp dotfiles/.vimrc $(INSTALL_ROOT)/.vimrc
cp dotfiles/.py3.vimrc $(INSTALL_ROOT)/.py3.vimrc
cp -rp dotfiles/.vim/online_fxreader_pr34_vim $(INSTALL_ROOT)/.vim/
dotfiles_tmux_put:
mkdir -p $(INSTALL_ROOT)
cp dotfiles/.tmux.conf ~/.tmux.conf
PLATFORM ?= macbook_air_2012
PLATFORM_TMP ?= tmp/platform_dotfiles/$(PLATFORM)
dotfiles_put_platform:
@echo to be installed
find platform_dotfiles/$(PLATFORM);
echo remove $(PLATFORM_TMP)'?'; read; sudo rm -fr $(PLATFORM_TMP)
sudo mkdir -p $(PLATFORM_TMP)
sudo cp -rp -T platform_dotfiles/$(PLATFORM)/ $(PLATFORM_TMP)
sudo chown -R root:root $(PLATFORM_TMP)
sudo cp -rp -T $(PLATFORM_TMP) /
sudo udevadm control --reload
sudo systemctl daemon-reload
GPG_RECIPIENTS_ARGS ?= -r 891382BEBFEFFC6729837400DA0B6C15FBB70FC9
dotfiles_fetch_platform:
mkdir -p platform_dotfiles/$(PLATFORM)
tar -cvf - \
/etc/udev/rules.d/ \
/etc/systemd/logind.conf \
~/.local/bin/systemd_gtk \
~/.local/bin/gnome-shortcuts-macbook-air \
/usr/local/bin \
| tar -xvf - -C platform_dotfiles/$(PLATFORM)
dotfiles_fetch_platform_gpg:
mkdir -p platform_dotfiles_gpg/$(PLATFORM)
yay -Q > /tmp/pacman-packages.txt;
tar -h -cvf - \
/tmp/pacman-packages.txt \
~/.sway/config.d \
~/.sway/config \
~/.config/commands-status.json \
/etc/fstab \
| gpg -e $(GPG_RECIPIENTS_ARGS) \
> platform_dotfiles_gpg/$(PLATFORM)/sensitive-configs-$$(date -Iseconds).gpg
rm /tmp/pacman-packages.txt;
dotfiles_fetch_platform_ideapad_slim_3_15arp10:
make dotfiles_fetch_platform \
PLATFORM=ideapad_slim_3_15arp10
dotfiles_fetch_platform_gpg_ideapad_slim_3_15arp10:
make dotfiles_fetch_platform_gpg \
PLATFORM=ideapad_slim_3_15arp10
dotfiles_sway_put:
mkdir -p ~/.sway
cp dotfiles/.sway/config ~/.sway/config
dotfiles_fetch:
commands install -f -p ~ -s ~/.config/katerc -t dotfiles
commands install -f -p ~ -s ~/.mime.types -t dotfiles
commands install -f -p ~ -s ~/.config/rofi/config.rasi -t dotfiles
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/keybindings.json -t dotfiles
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/settings.json -t dotfiles
DOTFILES_VERSION ?= 0.1
dotfiles_deploy:
mkdir -p releases/tar
tar -cvf - \
dotfiles \
| xz --compress -9 --stdout > \
releases/tar/dotfiles-$(DOTFILES_VERSION).tar.xz
systemd:
/usr/bin/env python3 d1/systemd.py
for d in tmp/d1; do \
(\
cd $$d; \
for i in *.service *.timer; do \
sudo ln -s -f $$PWD/$$i /etc/systemd/system/$$i; \
done; \
); \
done
sudo systemctl daemon-reload
compose_env:
for s in checks; do \
cat docker/$$s/.env .envs/$$s.env > .envs/$$s.patched.env; \
done
MYPY_SOURCES ?= \
d1/cpanel.py
mypy:
. .venv/bin/activate && \
mypy --strict --follow-imports silent \
$(MYPY_SOURCES)
COMPOSE ?= sudo docker-compose
nginx_config_http:
$(COMPOSE) exec app \
python3 \
d1/nginx_config.py \
tmp/cache/forward.nginx.json \
/etc/nginx/nginx.conf
nginx_config_https:
$(COMPOSE) exec ssl-app \
python3 \
d1/nginx_config.py ssl \
tmp/d1/ssl.nginx.json \
/etc/nginx/nginx.conf
nginx_config: nginx_config_https nginx_config_http
nginx_reload_common:
$(COMPOSE) exec $(NGINX_SERVICE) nginx -s reload
nginx_reload:
make nginx_reload_common NGINX_SERVICE=ssl-app
make nginx_reload_common NGINX_SERVICE=app
LLM_COMPOSE ?= podman-compose -f docker-compose.local.yml
LLM_DOCKER ?= podman
llm-podman-pull:
$(LLM_COMPOSE) pull llm
llm-podman-create:
$(LLM_COMPOSE) up --no-start --force-recreate llm
llm-podman-up:
# $(LLM_COMPOSE) start
$(LLM_DOCKER) start claude_llm_1
llm-podman-down:
# $(LLM_COMPOSE) stop
$(LLM_DOCKER) stop claude_llm_1
llm-podman-run:
$(LLM_COMPOSE) exec -w /app llm /bin/bash
llm-podman-run-zsh:
$(LLM_COMPOSE) exec -u nartes -w /app llm /usr/bin/zsh
llm-podman-ps:
$(LLM_COMPOSE) ps