1. Installation¶
CodeReview is written in Python and uses the GUI framework PyQt5 and the Git library pygit2. Thus, CodeReview is operating system agnostic and should work on Linux, Windows and OSX.
To install CodeReview from source code, you need a working Python environment and a C compiler.
1.1. On Linux¶
To summarise, you can easily install CodeReview on Linux with just pip install CodeReview
but read the followings.
First you need to verify that Python is installed on your distribution.
If you install CodeReview from source, you will also need the GCC C compiler.
You can create a Python virtual environment to install CodeReview in its own container:
# create the venv
python3.10 -m venv $HOME/codereview
# enter in the venv
source $HOME/codereview/bin/activate
This is not mandatory, but it is a good practice if you don’t know exactly what you are doing. Especially, if you don’t want to spoil your distribution.
Notice, you can later create a shell script to wrap the venv activation and the pyqgit command.
Then install CodeReview either from PyPI (official Python package repository) or from source:
# source .tar.gz or wheel/binary from PyPI (can require a GCC C compiler)
pip install CodeReview
# from Git repository (require a GCC C compiler)
pip install git+https://github.com/FabriceSalvaire/CodeReview
If the pip command is not available, you must install the corresponding package of your distribution.
Finally, run CodeReview to verify that the installation was successful:
pyqgit --help
diff-viewer --help
pyqgit git_repository_path
diff-viewer a.txt b.txt
cd git_repository_path
pyqgit
Example of shell wrapper:
#! /usr/bin/bash
PY_ENV=${HOME}/codereview
source ${PY_ENV}/bin/activate
CodeReviewLogLevel='WARNING' ${PY_ENV}/bin/pyqgit $1 &
You can also clone the repository and install it using theses commands:
git clone git@github.com:FabriceSalvaire/CodeReview.git
python setup.py build
python setup.py install
1.2. On Windows¶
Actually there is no installer available, but it is welcome.
You must follow the same procedure that for Linux. However it is a bit more difficult to achieve.
A suggestion is to install the Anaconda Python Distribution and got a working compiler.
1.3. On OSX¶
An up to date installation procedure is welcome.
1.4. Dependencies¶
CodeReview requires the dependencies listed in requirements.txt