Skip to content

Commit 0708b27

Browse files
committed
Clarify the required use of Python 3.9
1 parent 214cba9 commit 0708b27

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

docs/development_handbook.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
| 0.29.0 | 2023-10-11 | Remco Vermeulen | Update release process. |
3939
| 0.29.1 | 2023-10-11 | Remco Vermeulen | Address Markdown linter problems. |
4040
| 0.30.0 | 2023-11-14 | Remco Vermeulen | Clarify release steps in case of a hotfix release. |
41+
| 0.31.0 | 2024-02-23 | Remco Vermeulen | Clarify the required use of Python version 3.9 |
4142

4243
## Scope of work
4344

@@ -163,6 +164,7 @@ These files will be ready for query implementation.
163164

164165
#### Step 0: Prepare the Python environment
165166

167+
The tooling standardizes on Python 3.9 and requires the use of version 3.9 to run all tooling.
166168
The `scripts` directory contains the pip package specification file `requirements.txt` that contains the dependencies our generation scripts rely upon.
167169

168170
The dependencies can be installed as follows:
@@ -171,12 +173,12 @@ The dependencies can be installed as follows:
171173
pip3.9 install -r scripts/requirements.txt
172174
```
173175

174-
It is advisable to use a Python virtual environment which needs to be created and activated before installing the dependencies. This can be done as follows:
176+
It is advisable to use a Python 3.9 virtual environment which needs to be created and activated before installing the dependencies. This can be done as follows:
175177

176178
```bash
177179
python3.9 -mvenv scripts/.venv
178180
. scripts/.venv/bin/activate
179-
pip install -r scripts/requirements.txt
181+
pip3.9 install -r scripts/requirements.txt
180182
```
181183

182184
#### Step 1: Generate rule package description file
@@ -265,7 +267,7 @@ The `generate_package_description.py` script provides a "best-effort" approach t
265267
- `performance` - if the query identifies an issue which has a negative impact on the performance of the code.
266268
- `concurrency` - if the query identifies a concurrency issue.
267269
- Validate the rule package description file using the `validate-rule-package.py` script that validates the rule package descriptions against the schema `rule-package.schema.json` located in the `schemas` directory.
268-
- `python3 scripts/validate-rule-package.py <rule_package_name>`
270+
- `python3.9 scripts/validate-rule-package.py <rule_package_name>`
269271

270272
#### Step 3
271273

@@ -350,7 +352,7 @@ All public predicates, classes, modules and files should be documented with QLDo
350352

351353
### Installing QL dependencies
352354

353-
All of our query and library packs depend on the standard CodeQL library for C++, `codeql/cpp-all`. This dependency is specified in the `qlpack.yml` file for each of our packs. Before compiling, running, or testing any of our queries or libraries, you must download the proper dependencies by running `python3 scripts/install-packs.py`. This will download the appropriate version of the standard library from the public package registry, installing it in a cache in your `~/.codeql` directory. When compiling queries or running tests, the QL compiler will pick up the appropriate dependencies from this cache without any need to specify an additional library search path on the command line.
355+
All of our query and library packs depend on the standard CodeQL library for C++, `codeql/cpp-all`. This dependency is specified in the `qlpack.yml` file for each of our packs. Before compiling, running, or testing any of our queries or libraries, you must download the proper dependencies by running `python3.9 scripts/install-packs.py`. This will download the appropriate version of the standard library from the public package registry, installing it in a cache in your `~/.codeql` directory. When compiling queries or running tests, the QL compiler will pick up the appropriate dependencies from this cache without any need to specify an additional library search path on the command line.
354356

355357
Because the downloaded packs are cached, it is only necessary to run `install-packs.py` once each time we upgrade to a new standard library version. It does not hurt to run it more often; if all necessary packs are already in the download cache, then it will complete quickly without trying to download anything.
356358

docs/user_manual.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
| 0.14.0 | 2022-11-03 | Remco Vermeulen | Add guideline recategorization plan. |
2323
| 0.15.0 | 2023-05-24 | Mauro Baluda | Clarify AUTOSAR C++ supported versions. |
2424
| 0.16.0 | 2023-07-03 | Luke Cartey | Remove reference to LGTM, update the name of the query pack |
25-
| 0.17.0 | 2023-08-16 | Luke Cartey | Update list of supported compiler configurations. |
25+
| 0.17.0 | 2023-08-16 | Luke Cartey | Update list of supported compiler configurations. |
26+
| 0.18.0 | 2024-02-23 | Remco Vermeulen | Clarify the required use of Python version 3.9 |
2627

2728
## Release information
2829

@@ -220,8 +221,8 @@ In addition to producing a results file, an analysis report can be produced that
220221

221222
To run this script, the CodeQL CLI part of a supported CodeQL Bundle and Python interpreter version 3.9 must be available on the system path.
222223

223-
```
224-
python3 scripts/reports/analysis_report.py path/to/<output_database_name> <name-of-results-file>.sarif <output_directory>
224+
```bash
225+
python3.9 scripts/reports/analysis_report.py path/to/<output_database_name> <name-of-results-file>.sarif <output_directory>
225226
```
226227

227228
This will produce a directory (`<output_directory>`) containing the following report files in markdown format:
@@ -325,6 +326,7 @@ The example describes three ways of scoping a deviation:
325326

326327
The activation of the deviation mechanism requires an extra step in the database creation process.
327328
This extra step is the invocation of the Python script `path/to/codeql-coding-standards/scripts/configuration/process_coding_standards_config.py` that is part of the coding standards code scanning pack.
329+
To run this script, a Python interpreter version 3.9 must be available on the system path.
328330
The script should be invoked as follows:
329331

330332
```bash
@@ -333,7 +335,7 @@ codeql database create --language cpp --command 'python3 path/to/codeql-coding-s
333335

334336
The `process_coding_standards_config.py` has a dependency on the package `pyyaml` that can be installed using the provided PIP package manifest by running the following command:
335337

336-
`pip install -r path/to/codeql-coding-standards/scripts/configuration/requirements.txt`
338+
`pip3 install -r path/to/codeql-coding-standards/scripts/configuration/requirements.txt`
337339

338340
##### Deviation permit
339341

@@ -424,7 +426,7 @@ add the tag `external/<standard>/original-obligation/<category` to each query im
424426
The script should be invoked as follows:
425427

426428
```bash
427-
python3 path/to/codeql-coding-standards/scripts/guideline_recategorization/recategorize.py coding_standards_config_file <sarif_in> <sarif_out>
429+
python3.9 path/to/codeql-coding-standards/scripts/guideline_recategorization/recategorize.py coding_standards_config_file <sarif_in> <sarif_out>
428430
```
429431

430432
The `recategorize.py` scripts has a dependencies on the following Python packages that can be installed with the command `pip install -r path/to/codeql-coding-standards/scripts/guideline_recategorization/requirements.txt`:

0 commit comments

Comments
 (0)