Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Oct 28, 2024
1 parent fd4411c commit b7da4b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 11 additions & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ This folder contains various command-line tools that are used to facilitate diff

This command is used to updates the Meson build files in the project. It automatically adds new source files (py, pyx) to the Meson files and removes deleted source files. This command is useful when adding or removing source files from the project.

Within an active virtual environment where Meson is installed, run the following command:
Within an active virtual environment where `meson` is installed, run the following command:

```bash
tools/update_meson.py
```

## Update Lock Files

This command automatically updates the lock files for the project dependencies (the ones in the `./requirements/` directory). This command is useful when adding or removing dependencies from the project, or when updating the dependencies.

Within an active virtual environment where `pip-tools` and `toml` are installed, run the following command:

```bash
tools/update-lock.py
```
8 changes: 5 additions & 3 deletions tools/update-lock.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
# pyright: strict

import argparse
import subprocess
from pathlib import Path
Expand Down Expand Up @@ -45,11 +47,11 @@ def compile_requirements(pyproject_file: Path, groups: dict[str, list[str]]) ->
description="Update lock files under requirements using pip-tools compile."
)
parser.add_argument(
"sourcedir", help="The source directory of the pyproject.toml file."
"sourcedir", help="Source directory", nargs="?", default=".", type=Path
)
args = parser.parse_args()
options = parser.parse_args()

pyproject_file = Path(args.sourcedir) / "pyproject.toml"
pyproject_file = Path(options.sourcedir) / "pyproject.toml"
with pyproject_file.open("r") as f:
pyproject = toml.load(f)

Expand Down

0 comments on commit b7da4b4

Please sign in to comment.