Skip to content

Commit

Permalink
Add requirements files for python dependencies
Browse files Browse the repository at this point in the history
This commit adds two separate requirements files that you can feed into
pip for installing python dependencies.

This makes it easier for contributors to install dependencies by having
them isolated to a couple specific files, instead of having to reference
build documentation.
  • Loading branch information
rhmdnd committed Apr 24, 2023
1 parent 12cc5e0 commit ef10d5b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
45 changes: 20 additions & 25 deletions docs/manual/developer/02_building_complianceascode.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ apt-get install cmake make libopenscap8 libxml2-utils ninja-build python3-jinja2

IMPORTANT: Version `1.0.8` or later of `openscap-utils` is required to build the content.

### Python Dependencies

Some python dependencies must be installed through pip because they're not
packaged by a distribution.

Dependencies for developing are in `requirements.txt` and you can install them using:

```bash
$ pip3 install -r requirements.txt
```

Test dependencies are kept in a separate requirements file called
`test-requirements.txt` and are installed using the same process:

```bash
$ pip3 install -r test-requirements.txt
```

### Git (Clone the Repository)

Install git if you want to clone the GitHub repository to get the
Expand Down Expand Up @@ -92,11 +110,9 @@ apt-get install bats

### xmldiff (Python unit tests)

Install the `xmldiff` and `lxml` packages to execute Python unit tests that use these packages.
Install the `lxml` package to execute Python unit tests that use these packages.

```bash
pip3 install xmldiff

# Fedora/RHEL
yum install python3-lxml

Expand All @@ -120,11 +136,9 @@ apt-get install yamllint ansible-lint

### Static Ansible Playbooks tests

Install `yamlpath` and `pytest` to run tests cases that analyse the Ansible
Install `pytest` to run tests cases that analyse the Ansible
Playbooks' yaml nodes.
```bash
pip3 install yamlpath

# Fedora/RHEL
yum install python3-pytest

Expand All @@ -145,14 +159,6 @@ yum install ninja-build
apt-get install ninja-build
```

### json2html (HTML Report Statistics)

Install the `json2html` package if you want to generate HTML report statistics:

```bash
pip install json2html
```

### Sphinx packages (Developer Documentation)

Install Sphinx packages if you want to generate HTML Documentation, from source directory run:
Expand Down Expand Up @@ -211,17 +217,6 @@ yum install python3-mypy
apt-get install python3-mypy
```

#### Type stubs

```bash
pip install types-openpyxl types-PyYAML openpyxl-stubs
```

### cmakelint (Linting CMake Files)
```bash
pip install cmakelint
```

## Downloading the source code

Download and extract a tarball from the [list of releases](https://github.com/ComplianceAsCode/content/releases):
Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmakelint
types-openpyxl
types-PyYAML
openpyxl-stubs
json2html
2 changes: 2 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yamlpath
xmldiff

0 comments on commit ef10d5b

Please sign in to comment.