requirements and docs update
This commit is contained in:
parent
a9460cc057
commit
ce22b161f2
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -13,3 +13,6 @@
|
|||||||
[submodule "pylibs/rspec"]
|
[submodule "pylibs/rspec"]
|
||||||
path = pylibs/rspec
|
path = pylibs/rspec
|
||||||
url = https://git.mount-mockery.de/pylib/rspec.git
|
url = https://git.mount-mockery.de/pylib/rspec.git
|
||||||
|
[submodule "pylibs/pydocs"]
|
||||||
|
path = pylibs/pydocs
|
||||||
|
url = https://git.mount-mockery.de/pylib/pydocs.git
|
||||||
|
4
Makefile
4
Makefile
@ -1,4 +1,4 @@
|
|||||||
# git helper Makefile: Version 2.4 (2025-08-11)
|
# git helper Makefile: Version 2.5 (2025-08-11)
|
||||||
default: help
|
default: help
|
||||||
|
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
@ -64,7 +64,7 @@ init: print_head
|
|||||||
# Install modules
|
# Install modules
|
||||||
#
|
#
|
||||||
echo -e "\033[1;33mInstalling modules to venv in $$BASEPATH...\e[0m"
|
echo -e "\033[1;33mInstalling modules to venv in $$BASEPATH...\e[0m"
|
||||||
for req_file in $$(find $$BASEPATH -name requirements.txt); do
|
for req_file in $$(find -L $$BASEPATH -name requirements.txt 2> /dev/null); do
|
||||||
# echo " $$req_file"
|
# echo " $$req_file"
|
||||||
while read req_mod; do
|
while read req_mod; do
|
||||||
if [[ $$req_mod = *[![:space:]]* ]]; then
|
if [[ $$req_mod = *[![:space:]]* ]]; then
|
||||||
|
6
docs/.gitignore
vendored
Normal file
6
docs/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
_static
|
||||||
|
_build
|
||||||
|
conf.py
|
||||||
|
index.rst
|
||||||
|
venv
|
||||||
|
|
0
docs/.venv_required
Normal file
0
docs/.venv_required
Normal file
147
docs/Makefile
147
docs/Makefile
@ -1,40 +1,133 @@
|
|||||||
# You can set these variables from the command line.
|
# git helper Makefile: Version 2.5 (2025-08-11)
|
||||||
|
default: help
|
||||||
|
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
SHELL = /usr/bin/bash
|
SHELL = /usr/bin/bash
|
||||||
|
MAKEFLAGS += --no-print-directory
|
||||||
.SILENT:
|
.SILENT:
|
||||||
|
|
||||||
SPHINXOPTS =
|
-include __make.d__/*.mk
|
||||||
SPHINXBUILD = venv/bin/sphinx-build
|
|
||||||
SPHINXPRJ = $(shell basename `dirname \`pwd\``)
|
|
||||||
SOURCEDIR = .
|
|
||||||
BUILDDIR = _build
|
|
||||||
|
|
||||||
|
GIT_FLAG = ./.git
|
||||||
|
VENV_FLAG = ./.venv_required
|
||||||
|
VENV_FOLDER = ./venv
|
||||||
|
|
||||||
html: venv $(SPHINXPRJ)
|
localhelp:
|
||||||
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
||||||
|
|
||||||
$(SPHINXPRJ):
|
help:
|
||||||
make --no-print-directory -C $@/_examples_ all
|
echo "Possible common options are:"
|
||||||
|
echo " - init - Initialise the repository and all folders below with a Makefile"
|
||||||
|
echo " - giti - Get the git status of all submodules including their submodules"
|
||||||
|
echo " - update_submodules - Set all submodules to remote master"
|
||||||
|
echo " - venv_flag - Set the venev flag for the base folder. A venv will be generated"
|
||||||
|
echo " - clean - clean up"
|
||||||
|
echo " - deepclean - clean up this and all Makefiles below"
|
||||||
|
$(MAKE) localhelp
|
||||||
|
echo "You are able to create files make.d/*.mk and add local rules there. "
|
||||||
|
echo " - localinit: print_head - Will be executed as last step in the init process."
|
||||||
|
echo " - localhelp: print_head - Will be executed in th middle of the help text generation"
|
||||||
|
echo " - localclean:print_head - Will be executed before the clean rule"
|
||||||
|
|
||||||
init: venv
|
localinit:
|
||||||
venv:
|
|
||||||
echo -e "\033[1;33mCreating venv...\033[00m"
|
init: print_head
|
||||||
if [[ ! -e venv ]]; then
|
# Init git repo
|
||||||
virtualenv -p /usr/bin/python3 venv
|
if [[ -e $(GIT_FLAG) ]]; then
|
||||||
|
echo -e "\033[1;33mInitialising git submodules...\e[0m"
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
echo
|
||||||
fi
|
fi
|
||||||
venv/bin/pip install --upgrade pip
|
# Init submodules
|
||||||
venv/bin/pip install -r requirements.txt
|
SUBDIRS=$$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort)
|
||||||
|
for subdir in $$SUBDIRS; do
|
||||||
|
$(MAKE) --no-print-directory -C $$(dirname $$subdir) init
|
||||||
|
done
|
||||||
|
if [[ $$SUBDIRS = *[![:space:]]* ]]; then
|
||||||
|
$(MAKE) print_head
|
||||||
|
fi
|
||||||
|
# Create venv if needed
|
||||||
|
if [[ -e $(VENV_FLAG) ]]; then
|
||||||
|
BASEPATH=$$(pwd -P)
|
||||||
|
#
|
||||||
|
# Create venv
|
||||||
|
#
|
||||||
|
if [ ! -e venv ];then
|
||||||
|
echo -e "\033[1;33mCreating venv in $$BASEPATH...\e[0m"
|
||||||
|
python3 -m venv $$BASEPATH/venv > /dev/null 2>&1
|
||||||
|
else
|
||||||
|
echo -e "\033[1;33mVirtualenv already exists in $$BASEPATH...\e[0m"
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
|
||||||
clean:
|
#
|
||||||
echo -e "\033[1;33mCleanung up docs...\033[00m"
|
# Install modules
|
||||||
echo -e "\e[1m * Sphix build directory...\e[0m"
|
#
|
||||||
rm -rf $(BUILDDIR)/*
|
echo -e "\033[1;33mInstalling modules to venv in $$BASEPATH...\e[0m"
|
||||||
make --no-print-directory -kC $(SPHINXPRJ)/_examples_ clean
|
for req_file in $$(find -L $$BASEPATH -name requirements.txt 2> /dev/null); do
|
||||||
|
# echo " $$req_file"
|
||||||
|
while read req_mod; do
|
||||||
|
if [[ $$req_mod = *[![:space:]]* ]]; then
|
||||||
|
# req_mod is not empty
|
||||||
|
OUT=$$($$BASEPATH/venv/bin/pip install -U $$req_mod 2>&1 )
|
||||||
|
if [[ $$OUT =~ "Successfully installed" ]]; then
|
||||||
|
echo -e " * \033[1;32m$$req_mod installed.\e[0m"
|
||||||
|
elif [[ $$OUT =~ "already satisfied" ]]; then
|
||||||
|
echo -e " * \033[1;36m$$req_mod already installed.\e[0m"
|
||||||
|
else
|
||||||
|
echo -e " * \033[1;31m$$req_mod installation FAILED!\e[0m"
|
||||||
|
#echo $$OUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done < $$req_file
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
# Start local init
|
||||||
|
echo -e "\033[1;33mDoing localinit...\e[0m"
|
||||||
|
$(MAKE) localinit
|
||||||
|
|
||||||
release: html
|
update_submodules:
|
||||||
rm -rf $(SPHINXPRJ)/_docs_
|
git submodule foreach "git fetch && git checkout master && git pull && git submodule init && git submodule update"
|
||||||
mv $(BUILDDIR)/html $(SPHINXPRJ)/_docs_
|
|
||||||
|
|
||||||
view: html
|
giti_this: print_head
|
||||||
xdg-open $(BUILDDIR)/html/index.html
|
giti
|
||||||
|
echo " Submodules:"
|
||||||
|
git submodule --quiet foreach "echo -n ' ' && giti"
|
||||||
|
|
||||||
|
giti:
|
||||||
|
git submodule --quiet foreach "[ -e Makefile ] && make --no-print-directory giti_this || :"
|
||||||
|
|
||||||
|
localclean:
|
||||||
|
|
||||||
|
clean: localclean
|
||||||
|
if [[ ! -e $(VENV_FLAG) ]]; then
|
||||||
|
if [[ -d $(VENV_FOLDER) ]]; then
|
||||||
|
rm -rf $(VENV_FOLDER)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
cleanall: clean
|
||||||
|
for subdir in $$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort); do
|
||||||
|
$(MAKE) --no-print-directory -C $$(dirname $$subdir) cleanall
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
venv_flag:
|
||||||
|
if [[ ! -e $(VENV_FLAG) ]]; then
|
||||||
|
touch $(VENV_FLAG)
|
||||||
|
if [[ -e $(GIT_FLAG) ]]; then
|
||||||
|
git add $(VENV_FLAG)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
print_head:
|
||||||
|
DIRNAME=$$(basename $$(pwd))
|
||||||
|
DIRLENGTH=$${#DIRNAME}
|
||||||
|
echo -ne "\n\n\033[1;34m╔═"
|
||||||
|
for i in $$(seq 1 $$DIRLENGTH); do echo -n "═"; done
|
||||||
|
echo -e "═╗"
|
||||||
|
echo -e "║ $$DIRNAME ║"
|
||||||
|
echo -ne "╚═"
|
||||||
|
for i in $$(seq 1 $$DIRLENGTH); do echo -n "═"; done
|
||||||
|
echo -e "═╝\033[00m"
|
||||||
|
1
docs/__make.d__/sphinx.mk
Symbolic link
1
docs/__make.d__/sphinx.mk
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../pydocs/sphinx.mk
|
1
docs/pydocs
Symbolic link
1
docs/pydocs
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../pylibs/pydocs
|
1
pylibs/pydocs
Submodule
1
pylibs/pydocs
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit a8341df13ed60a0fd9db25a4ed511cbc54b44d91
|
@ -1 +1 @@
|
|||||||
Subproject commit f8d11701c887775a764adf3e75fd7be5758d0621
|
Subproject commit 779a6d0a1c4e8b5bbdd4a54c4c509212cf2334a3
|
Loading…
x
Reference in New Issue
Block a user