This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
python-packages-source/Makefile

115 lines
2.9 KiB
Makefile

#
# Makefile
#
# Copyright (C) 2017-2023 Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
#
# This file is part of python-packages-source.
#
# python-packages-source is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# python-packages-source is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with python-packages-source. If not, see <http://www.gnu.org/licenses/>.
#
export PACKAGE_NAME=python_packages_source
# See
# https://docs.python.org/3/library/venv.html#how-venvs-work
export VENV_CMD=. .venv/bin/activate
default: install-dev submodules-update submodules-add-gitea
doc:
$(VENV_CMD) \
&& $(MAKE) -C docs html \
&& deactivate
install:
pip3 install . --user
uninstall:
pip3 uninstall --verbose --yes $(PACKAGE_NAME)
install-dev:
python3 -m venv .venv
$(VENV_CMD) \
&& pip install --requirement requirements-freeze.txt \
&& deactivate
$(VENV_CMD) \
&& pre-commit install \
&& deactivate
$(VENV_CMD) \
&& pre-commit install --hook-type commit-msg \
&& deactivate
regenerate-freeze: uninstall-dev
python3 -m venv .venv
$(VENV_CMD) \
&& pip install --requirement requirements.txt --requirement requirements-dev.txt \
&& pip freeze --local > requirements-freeze.txt \
&& deactivate
uninstall-dev:
rm -rf .venv
update: install-dev
$(VENV_CMD) \
&& pre-commit autoupdate \
--repo https://github.com/pre-commit/pre-commit-hooks \
--repo https://github.com/PyCQA/bandit \
--repo https://github.com/pycqa/isort \
--repo https://codeberg.org/frnmst/licheck \
--repo https://codeberg.org/frnmst/md-toc \
--repo https://github.com/mgedmin/check-manifest \
--repo https://github.com/jorisroovers/gitlint \
&& deactivate
# --repo https://github.com/pre-commit/mirrors-mypy \
test:
$(VENV_CMD) \
&& python -m unittest $(PACKAGE_NAME).tests.tests --failfast --locals --verbose \
&& deactivate
pre-commit:
$(VENV_CMD) \
&& pre-commit run --all \
&& deactivate
clean:
rm -rf build dist *.egg-info
stats:
$(VENV_CMD) \
&& cd scripts \
&& python3 -m collect_data
plot:
$(VENV_CMD) \
&& cd scripts \
&& python3 -m plot_data $(OUTPUT)
submodules-add:
$(VENV_CMD) \
&& cd scripts \
&& ./add_submodules.sh $(SUBMODULES)
submodules-add-gitea:
$(VENV_CMD) \
&& cd scripts \
&& python3 -m add_submodules_gitea
submodules-update:
$(VENV_CMD) \
&& cd scripts \
&& ./update_submodules.sh
.PHONY: default doc install uninstall install-dev uninstall-dev update test clean pre-commit stats plot submodules-add submodules-add-gitea submodules-update