Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
default_language_version:
python: python3

exclude: |
(?x)^(
tools/.*py|
build/cache.py|
build/common_compiler_flags.py
)
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
Expand Down
50 changes: 38 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
# OpenVicProject/scripts
Common Scons scripts repo for the [OpenVicProject repos](https://github.com/OpenVicProject)

## Required
* [scons](https://scons.org/)

## Usage
1. Call `env.SetupOptions()` and use the return value to add your options:
```py
opts = env.SetupOptions()
opts.Add(BoolVariable("example", "Is an example", false))
```
2. When options are finished call `env.FinalizeOptions()` then setup your scons script using env.

Shared CMake helpers for the [OpenVicProject repos](https://github.com/OpenVicProject)
(OpenVic, openvic-simulation, openvic-dataloader, lexy-vdf).


Each consuming repo fetches this repo as a **pinned FetchContent tarball**

```cmake
if(NOT COMMAND openvic_setup_base_flags)
include(FetchContent)
FetchContent_Declare(
openvic_scripts
URL "https://github.com/OpenVicProject/scripts/archive/<SHA>.tar.gz"
URL_HASH SHA256=<SHA256>
)
FetchContent_MakeAvailable(openvic_scripts)
include("${openvic_scripts_SOURCE_DIR}/cmake/OpenVicScripts.cmake")
endif()
```

## Bumping the pin in a consuming repo

After a change lands on `master` here:

1. Note the new commit SHA.
2. Compute the tarball hash:
```sh
curl -sL https://github.com/OpenVicProject/scripts/archive/<SHA>.tar.gz | sha256sum
```
3. In the consumer's root `CMakeLists.txt` bootstrap block, update the `URL`
SHA and the `URL_HASH SHA256=` value.

To test uncommitted changes to this repo from a consumer, configure the
consumer with:

```sh
cmake --preset <preset> -DFETCHCONTENT_SOURCE_DIR_OPENVIC_SCRIPTS=<path-to-this-checkout>
```
Loading
Loading