2019-08-10 13:12:47 +02:00
|
|
|
#!/usr/bin/env make
|
|
|
|
#
|
|
|
|
# Makefile
|
|
|
|
#
|
2021-12-21 18:19:20 +01:00
|
|
|
# Copyright (C) 2019-2021 Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
|
2019-08-10 13:12:47 +02:00
|
|
|
#
|
|
|
|
# This file is part of fattura-elettronica-reader.
|
|
|
|
#
|
|
|
|
# fattura-elettronica-reader 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.
|
|
|
|
#
|
|
|
|
# fattura-elettronica-reader 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 fattura-elettronica-reader. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
2020-10-18 13:06:48 +02:00
|
|
|
export PACKAGE_NAME=fattura_elettronica_reader
|
2019-08-10 13:12:47 +02:00
|
|
|
|
2020-10-18 13:06:48 +02:00
|
|
|
default: doc
|
2019-08-10 13:12:47 +02:00
|
|
|
|
2021-01-08 12:34:32 +01:00
|
|
|
doc: clean
|
2020-07-01 12:37:42 +02:00
|
|
|
pipenv run $(MAKE) -C docs html
|
2019-08-10 13:12:47 +02:00
|
|
|
|
|
|
|
install:
|
2020-10-18 13:06:48 +02:00
|
|
|
pip3 install . --user
|
2019-08-10 13:12:47 +02:00
|
|
|
|
|
|
|
uninstall:
|
2021-09-20 12:09:08 +02:00
|
|
|
pip3 uninstall --verbose --yes $(PACKAGE_NAME)
|
2019-08-10 13:12:47 +02:00
|
|
|
|
2020-07-01 12:37:42 +02:00
|
|
|
install-dev:
|
2020-12-08 17:07:50 +01:00
|
|
|
pipenv install --dev
|
2020-10-18 13:06:48 +02:00
|
|
|
pipenv run pre-commit install
|
2021-10-16 22:39:22 +02:00
|
|
|
pipenv graph
|
2021-10-17 00:21:07 +02:00
|
|
|
pipenv check
|
2020-07-01 12:37:42 +02:00
|
|
|
|
|
|
|
uninstall-dev:
|
2021-10-18 17:47:23 +02:00
|
|
|
rm -f Pipfile.lock
|
2020-07-01 12:37:42 +02:00
|
|
|
pipenv --rm
|
|
|
|
|
2021-10-17 00:21:07 +02:00
|
|
|
update: install-dev
|
|
|
|
pipenv run pre-commit autoupdate
|
|
|
|
|
2020-07-01 12:37:42 +02:00
|
|
|
test:
|
2021-06-07 18:53:05 +02:00
|
|
|
pipenv run python -m unittest $(PACKAGE_NAME).tests.tests --failfast --locals --verbose
|
2020-07-01 12:37:42 +02:00
|
|
|
|
2019-08-10 13:12:47 +02:00
|
|
|
dist:
|
2020-07-01 12:37:42 +02:00
|
|
|
pipenv run python setup.py sdist
|
2021-07-31 19:05:54 +02:00
|
|
|
# Create a reproducible archve at least on the wheel.
|
|
|
|
# See
|
|
|
|
# https://bugs.python.org/issue31526
|
|
|
|
# https://bugs.python.org/issue38727
|
|
|
|
# https://github.com/pypa/setuptools/issues/1468
|
|
|
|
# https://github.com/pypa/setuptools/issues/2133
|
|
|
|
# https://reproducible-builds.org/docs/source-date-epoch/
|
2021-12-21 23:19:39 +01:00
|
|
|
SOURCE_DATE_EPOCH=$$(git -c log.showSignature='false' log -1 --pretty=%ct) pipenv run python setup.py bdist_wheel
|
2022-05-18 11:15:57 +02:00
|
|
|
pipenv run twine check dist/*
|
2019-08-10 13:12:47 +02:00
|
|
|
|
|
|
|
upload:
|
2020-07-01 12:37:42 +02:00
|
|
|
pipenv run twine upload dist/*
|
2019-08-10 13:12:47 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf build dist *.egg-info
|
2022-05-18 11:15:57 +02:00
|
|
|
# Remove all markdown files except the readme.
|
|
|
|
find -regex ".*\.[mM][dD]" ! -name 'README.md' ! -name 'CONTRIBUTING.md' -type f -exec rm -f {} +
|
2020-07-01 12:37:42 +02:00
|
|
|
pipenv run $(MAKE) -C docs clean
|
2019-08-10 13:12:47 +02:00
|
|
|
|
2021-11-13 01:17:27 +01:00
|
|
|
.PHONY: default doc install uninstall install-dev uninstall-dev update test clean
|