miniroon

Simplistic macaroon-based authorization for Unix systems
git clone https://ccx.te2000.cz/git/miniroon
Log | Files | Refs | README

commit 80c588299bd369e945956b119bf06054128870e3
parent aca3635f9a90b1d9b427456d86639abe0a33226d
Author: Jan Pobrislo <ccx@te2000.cz>
Date:   Sun, 11 May 2025 23:33:18 +0000

Directory for Python implementation, move scripts into separate directory

Diffstat:
AMakefile | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rcc -> build_scripts/cc | 0
Rcodedeps.awk -> build_scripts/codedeps.awk | 0
Rgenhash -> build_scripts/genhash | 0
Rlink -> build_scripts/link | 0
Apyminiroon-cp312-cp312-musllinux_1_2_x86_64-requirements.txt | 34++++++++++++++++++++++++++++++++++
Apyminiroon-requirements.in | 4++++
Apyminiroon/.__init__.pyfmt | 0
Apyminiroon/__init__.py | 0
Msrc/Makefile | 45++++++---------------------------------------
Csrc/Makefile -> src/build.mk | 0
11 files changed, 105 insertions(+), 39 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,61 @@ +PYTHON_EXE?=python3 +cache?=. +build_scripts:=./build_scripts + +# re-evaluate each time because there's no sensible way to check +# whether the python interpreter changed +$(eval $(shell $(PYTHON_EXE) $(build_scripts)/make_vars.py build_info)) + +PY_MODULE=pyminiroon +PY_SRC:=$(wildcard $(PY_MODULE)/*.py) +PY_REQ:=pyminiroon-$(PYTHON_IMPL)-requirements.txt +PY_WHL:=$(cache)/wheels/$(PYTHON_IMPL) +VENV:=$(cache)/virtualenvs/$(PYTHON_IMPL) +PYTHON_VENV_INSTALL=pip-tools wheel + +pycodestyle: $(patsubst $(PY_MODULE)/%.py,$(PY_MODULE)/.%.pyfmt,$(PY_SRC)) $(VENV)/.done + '$(VENV)/bin/pylama' -l 88 $(PY_SRC) || true + +$(PY_MODULE)/.%.pyfmt: $(PY_MODULE)/%.py $(VENV)/.done + '$(VENV)/bin/isort' - <'$<' >'$<.tmp1' + cp -a '$<' '$<.tmp2' + '$(VENV)/bin/black' -S - <'$<.tmp1' >'$<.tmp2' + rm '$<.tmp1' + if cmp -s '$<.tmp2' '$<'; then rm -v '$<.tmp2'; else mv -v '$<.tmp2' '$<'; fi + touch $@ + +.PHONY: py-requirements py-wheels py-venv py-virtualenv +py-requirements: $(PY_REQ) + +py-wheels: $(PY_WHL)/.done + +py-venv: $(VENV)/.done + +py-virtualenv: py-venv + +# -- requirement file rules + +$(PY_REQ): $(PY_MODULE)-requirements.in $(VENV)/bin/pip-compile + '$(VENV)/bin/pip-compile' -v --annotate -o '$@.new' '$(PY_MODULE)-requirements.in' + mv '$@.new' '$@' + +# -- wheel building rules + +$(PY_WHL)/.done: $(PY_REQ) + mkdir -p '$(PY_WHL)' + '$(VENV)/bin/python' -m pip wheel -w '$(PY_WHL)' -r '$(PY_REQ)' + touch '$@' + +# -- virtualenv rules + +$(VENV)/bin/pip-compile $(VENV)/bin/pip-sync: + if test -e '$(VENV)'; then rm -r '$(VENV)'; else true; fi + mkdir -p virtualenvs + $(PYTHON_VENV) '$(VENV)' + '$(VENV)/bin/pip' install -I $(PYTHON_VENV_INSTALL) + +$(VENV)/.done: $(PY_REQ) $(VENV)/bin/pip-sync $(PY_WHL)/.done + $(VENV)/bin/pip-sync --no-index -f '$(PY_WHL)' '$(PY_REQ)' + ln -sf 'virtualenvs/$(PYTHON_IMPL)' '$(cache)/venv' + touch '$@' + diff --git a/cc b/build_scripts/cc diff --git a/codedeps.awk b/build_scripts/codedeps.awk diff --git a/genhash b/build_scripts/genhash diff --git a/link b/build_scripts/link diff --git a/pyminiroon-cp312-cp312-musllinux_1_2_x86_64-requirements.txt b/pyminiroon-cp312-cp312-musllinux_1_2_x86_64-requirements.txt @@ -0,0 +1,34 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --output-file=pyminiroon-cp312-cp312-musllinux_1_2_x86_64-requirements.txt.new pyminiroon-requirements.in +# +black==25.1.0 + # via -r pyminiroon-requirements.in +click==8.2.0 + # via black +isort==6.0.1 + # via -r pyminiroon-requirements.in +janus-swi==1.5.2 + # via -r pyminiroon-requirements.in +mccabe==0.7.0 + # via pylama +mypy-extensions==1.1.0 + # via black +packaging==25.0 + # via black +pathspec==0.12.1 + # via black +platformdirs==4.3.8 + # via black +pycodestyle==2.13.0 + # via pylama +pydocstyle==6.3.0 + # via pylama +pyflakes==3.3.2 + # via pylama +pylama==8.4.1 + # via -r pyminiroon-requirements.in +snowballstemmer==3.0.1 + # via pydocstyle diff --git a/pyminiroon-requirements.in b/pyminiroon-requirements.in @@ -0,0 +1,4 @@ +black +isort +pylama +janus-swi diff --git a/pyminiroon/.__init__.pyfmt b/pyminiroon/.__init__.pyfmt diff --git a/pyminiroon/__init__.py b/pyminiroon/__init__.py diff --git a/src/Makefile b/src/Makefile @@ -1,42 +1,9 @@ +build_scripts:=../build_scripts +src_dir:=. +build_dir:=./build +test_dir:=../test + all: tools .PHONY: all -miniroon_tool_names:=read verify test - -tools:=$(patsubst %,build/miniroon-%,$(miniroon_tool_names)) -tools: $(tools) -.PHONY: tools - -define miniroon_autolink = -include build/cmd_$(1).c.deps.mk -build/miniroon-$(1): $$(LINKDEP_cmd_$(1)__c) ../link build/cmd_$(1).c.deps.mk - ../link -o '$$@' $$(LINKDEP_cmd_$(1)__c) -endef -$(foreach var,$(miniroon_tool_names),$(eval $(call miniroon_autolink,$(var)))) - -clean: - rm -r $(tools) build -.PHONY: clean - -test: build/miniroon-test - cd ../test && ../src/build/miniroon-test -v -.PHONY: test - -## pattern rules: - -%_perfhash.c %_perfhash.h: %_perfhash.txt ../genhash - ../genhash '$*_perfhash' '$<' - -build/%.c.i: %.c ../cc build/.exists - ../cc -E -C -o '$@' '$*.c' - -build/%.o: build/%.c.i ../cc - ../cc -fpreprocessed -c -o '$@' 'build/$*.c.i' - -build/%.c.deps.mk: build/%.c.i ../codedeps.awk - awk -v srcname='$*.c' -v target='build/$*.c.i' -f ../codedeps.awk 'build/$*.c.i' >'$@.new' - mv '$@.new' '$@' - -%/.exists: - mkdir -p '$*' - touch '$@' +include build.mk diff --git a/src/Makefile b/src/build.mk