- Using Python virtual environment (pyenv) is highly recommended, as it provides means of isolating development packages from system-wide packages. It allows to install specific versions of python packages, which pcs depends on, independently on the rest of the system.
- In this tutorial, we choose to create a pyenv in
~/pyenvs/pcsdirectory. - Create a base directory:
mkdir ~/pyenvs - Create a pyenv:
python3 -m venv --system-site-packages ~/pyenvs/pcs - To activate the pyenv, run
source ~/pyenvs/pcs/bin/activateor. ~/pyenvs/pcs/bin/activate - To deactivate the pyenv, run
deactivate
- Go to pcs directory.
- If you created a pyenv according to the previous section, make sure it is activated.
- Run
./autogen.sh.- This generates
configurescript based onconfigure.acfile. - It requires an annotated tag to be present in git repository. The easiest way to acomplish that is to add the upstream pcs repository as a remote repository.
- This generates
- Run
./configure.- This checks all the dependencies and creates various files (including
Makefilefiles) based on theirs*.intemplates. - To list available options and their description, run
./configure -h. - Recommended setup for development is to run
./configure --enable-local-build --enable-dev-tests --enable-destructive-tests --enable-concise-tests --enable-parallel-tests
- This checks all the dependencies and creates various files (including
- Run
make.- This downloads and installs dependencies, such as python modules and rubygems.
- To run pcs, type
pcs/pcs. - To run pcsd, type
sripts/pcsd.sh.
- To run all the tests, type
make check.- You may run specific tests like this:
make black_checkmake mypymake pylintmake tests_tier0make tests_tier1make pcsd-tests
- To run specific tests from python test suite, type
pcs_test/suite <test>
- You may run specific tests like this:
- When
make checkpasses, you may want to runmake distcheck.- This generates a distribution tarball and checks it.
- The check is done by extracting files from the tarball, running
./configureandmake check. - Note, that
./configureis run with no options, so it requires dependencies to be installed system wide. This can be overriden by runningmake distcheck DISTCHECK_CONFIGURE_FLAGS='<flag>...'. - The point of this test is to make sure all necessary files are present in the tarball.
- To run black code formater, type
make black.
- To create a tarball for distribution, run
make dist. - The user of the tarball is supposed to run
./configurewith options they see fit. Then, they can runmakewith any target they need.
- All system-dependent paths must be located in
pcs/settings.py.inandpcsd/settings.rb.infiles. - Do not forget to run
./configureafter changing any*.infile. - All files meant to be distributed must be listed in
EXTRA_DISTvariable inMakefile.amfile in specific directory (pcs,pcs/pcs,pcs/pcs_tests,pcs/pcsd), with the exception of files created by autoconf / automake.