The following instructions are useful during development.
Note: This has been tested on Linux and Darwin/macOS. It has not been tested on Windows.
🤔 The following tasks need to be complete before proceeding. These are "one-time tasks" which may already have been completed.
Since the Senzing library is a prerequisite, it must be installed first.
-
Verify Senzing C shared objects, configuration, and SDK header files are installed.
/opt/senzing/er/lib/opt/senzing/er/sdk/c/etc/opt/senzing
-
If not installed, see How to Install Senzing for Python Development.
-
Identify git repository.
export GIT_ACCOUNT=senzing-garage export GIT_REPOSITORY=template-python export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
-
Using the environment variables values just set, follow steps in clone-repository to install the Git repository.
-
A one-time command to install dependencies needed for
maketargets. Example:cd ${GIT_REPOSITORY_DIR} make dependencies-for-development
-
Install dependencies needed for Python code. Example:
cd ${GIT_REPOSITORY_DIR} make dependencies
-
Run linting. Example:
cd ${GIT_REPOSITORY_DIR} make lint
Not applicable.
-
Run program. Example:
cd ${GIT_REPOSITORY_DIR} make run
-
Clean up. Example:
cd ${GIT_REPOSITORY_DIR} make clean
-
Run tests. Example:
cd ${GIT_REPOSITORY_DIR} make clean setup test
Create a code coverage map.
-
Run Go tests. Example:
cd ${GIT_REPOSITORY_DIR} make clean setup coverage
A web-browser will show the results of the coverage. The goal is to have over 80% coverage.
-
View documentation. Example:
cd ${GIT_REPOSITORY_DIR} make clean documentation
-
If a web page doesn't appear, run the following command and paste the results into a web browser's address bar.
echo "file://${GIT_REPOSITORY_DIR}/docs/build/html/index.html"
-
Use make target to run a docker images that builds RPM and DEB files. Example:
cd ${GIT_REPOSITORY_DIR} make docker-build
-
Run docker container. Example:
docker run --rm senzing/template-python -
Optional: Test using
docker-compose. Example:cd ${GIT_REPOSITORY_DIR} make docker-test
-
Build the
wheelfile for distribution. Example:cd ${GIT_REPOSITORY_DIR} make package
-
Activate virtual environment.
cd ${GIT_REPOSITORY_DIR} source .venv/bin/activate
-
Verify that
template-pythonis not installed. Example:python3 -m pip freeze | grep -e template-python -e template_pythonNothing is returned.
-
Install directly from
wheelfile. Example:python3 -m pip install ${GIT_REPOSITORY_DIR}/dist/*.whl -
Verify that
template-pythonis installed. Example:python3 -m pip freeze | grep -e template-python -e template_pythonExample return:
template-python @ file:///home/senzing/senzing-garage.git/sz-sdk-python-abstract/dist/template_python-0.0.1-py3-none-any.whl#sha256=2a4e5218d66d5be60ee31bfad5943e6611fc921f28a4326d9594ceceae7e0ac1
-
If applicable, run the application. Example:
template_python -
Uninstall the
template-pythonpython package. Example:python3 -m pip uninstall template-python -
Deactivate virtual environment.
deactivate