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=sz-sdk-python-core 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
make
targets. Example:cd ${GIT_REPOSITORY_DIR} make dependencies-for-development
-
Install dependencies needed for Python code. Example:
cd ${GIT_REPOSITORY_DIR} make dependencies
-
Install dependencies needed for documentation. Example:
cd ${GIT_REPOSITORY_DIR} make dependencies-for-documentation
-
Run linting. Example:
cd ${GIT_REPOSITORY_DIR} make lint
Not applicable.
Not applicable.
-
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"
-
Build the
wheel
file for distribution. Example:cd ${GIT_REPOSITORY_DIR} make package
-
Activate virtual environment.
cd ${GIT_REPOSITORY_DIR} source .venv/bin/activate
-
Verify that
senzing-core
is not installed. Example:python3 -m pip freeze | grep -e senzing_core
Nothing is returned.
-
Install directly from
wheel
file. Example:python3 -m pip install ${GIT_REPOSITORY_DIR}/dist/*.whl
-
Verify that
senzing-core
is installed. Example:python3 -m pip freeze | grep -e senzing-core -e senzing_core
Example return:
senzing-core @ file:///home/senzing/senzing-garage.git/sz-sdk-python-core/dist/senzing-core-0.0.1-py3-none-any.whl#sha256=2a4e5218d66d5be60ee31bfad5943e6611fc921f28a4326d9594ceceae7e0ac1
-
Uninstall the
senzing-core
python package. Example:python3 -m pip uninstall senzing-core
-
Deactivate virtual environment.
deactivate