The makefilet
make modules should be configured with the following steps:
makefilet
is available (see the integration instructions for different approaches)./VERSION
(resp.: $(CURRENT_VERSION_FILE)
):
shell
echo "1.0" > VERSION
create ./.bumpversion.cfg
with a content similar to the following:
[bumpversion:file:VERSION]
[bumpversion:file:foo/__init__.py]
search = ^VERSION = "{current_version}"
optional: create a "help" target and describe project-specific targets
help:
@echo "Useful targets for FOO:"
@echo " bar prepare the fun"
@echo " baz enjoy the result"
@echo
for python packages: you may want to override the directory containing your setup.py (defaults to "."):
DIR_PYTHON_SETUP = foo/bar
BEWARE: this variable needs to be set before the include statement for makefilet
.
some repositories require git submodules for their deb packaging:
DEBIAN_PACKAGE_SUBMODULE_DIRECTORIES = submodule1/foo submodule2/bar
You may also define a prep-source::
make target (mind the double colon)
to run some actions prior to the creation of the source archive
for repositories creating additional deb packages directly from pypi (via pypi2deb):
PYPI2DEB_PACKAGES = marshmallow spidev
BEWARE: this variable needs to be set before the include statement for makefilet
.
Pybuild-related environment variables for a specific package foo
can be defined as follows:
$(PYPI2DEB_BUILD_STAMP_PREFIX)-foo: export PYBUILD_DISABLE=test
specify the project's name:
PROJECT_NAME = foo
makefilet
adds the following implicit dependencies:
clean
dist
install
lint
report
test
These targets depend on related targets within the specific sub modules (if applicable).
Feel free to define these targets in your own Makefile, if you need additional custom operations.
The following targets are implemented:
dist-deb-packages-directory
: create the deb packages and store the resulting package files (with the version string and architecture stripped from the filename) in the directory DIR_DEBIAN_SIMPLIFIED_PACKAGE_FILES
. This includes deb package files created via dist-deb
and dist-pypi2deb
.dist-deb
: create the deb packages and store them in DIR_DEBIAN_BUILD
init-deb
: create an example deb packaging in the 'debian/' directory (via dh_make
)lint-deb
: run lintian for a deb packageupload-deb
: upload the deb packages to the internal repositorydist-pypi2deb
: create deb packages via pypi2deb directly from the Python package indexupload-pypi2deb
: upload the packages created via pypi2deb to the internal repositorydist-python
: build a python module via setup.pylint-python
: check python code via flake8upload-python
: upload the python module to the internal pypi repositorytest-python
: run flake8virtualenv-update
: create a virtual environment and install packages based on requirements.txt
(VIRTUALENV_REQUIREMENTS_FILE
)release-(major|minor|patch)
: increment version number and commit this changerelease-undo
: revert the last commit, if it was a release (see above)release-push
: push the changes (commits and tags) after a releaserelease-tar
: create a release archiverelease-tar-sign
: sign a release archiveThe following variables are initialized with sane defaults:
RM
PYTHON_BIN
PYPI2DEB_PYTHON_PREFIX
(default: "python3", may also be "python")BUILD_ID
(based on the git commit hash)DIR_BUILD
DIR_DIST
DESTDIR
The following functions can be called via $(call FOO,bar,baz)
:
get_current_version