Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
SPDX-License-Identifier: Apache-2.0
-->
# Code of Conduct for {project name}

Please see the [Community Code of Conduct](https://www.finos.org/code-of-conduct).
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
SPDX-License-Identifier: Apache-2.0
-->
---
name: 🐛 Bug Report
about: If something isn't working as expected 🤔.
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
SPDX-License-Identifier: Apache-2.0
-->
---
name: 🚀 Feature Request
about: I have a suggestion (and may want to implement it 🙂)!
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/Support_question.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
SPDX-License-Identifier: Apache-2.0
-->
---
name: 🤗 Support Question
about: If you have a question about configuration, usage, etc. 💬
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/meeting-minutes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
SPDX-License-Identifier: Apache-2.0
-->
---
name: "\U0001F91D {project name} Meeting Minutes"
about: To track {project name} meeting agenda and attendance
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
name: Build and Release Wheel

on:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/check-license-headers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
name: Check License Headers

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
license-headers:
name: Verify license headers
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install licenseheaders
run: pip install licenseheaders

- name: Check license headers
run: |
src/license/apply_headers.sh
git diff --exit-code || \
(echo "One or more files are missing a license header. Run 'src/license/apply_headers.sh' locally to fix." && \
exit 1)
4 changes: 4 additions & 0 deletions .github/workflows/cve-scanning-python.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
name: CVE Scanning for Python

on:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/license-scanning-python.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
name: License Scanning for Python

on:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
name: Publish to PyPi

on:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
name: Run Unit Tests

on:
Expand Down
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
repos:
- repo: local
hooks:
- id: license-headers-dirs
name: Add/check license headers (src, test, .github)
entry: licenseheaders
args: [-t, src/license/header.txt, --dir, src, --dir, test, --dir, .github]
language: python
additional_dependencies: [licenseheaders>=0.8.8]
types_or: [python, yaml, shell, toml]
pass_filenames: false
- id: license-headers-files
name: Add/check license headers (root files)
entry: licenseheaders
args: [-t, src/license/header.txt, --additional-extensions, python=.toml,
-f, build_wheel.sh, dev_clean_setup.sh, netlify.toml, pyproject.toml,
safety-policy.yml, .pre-commit-config.yaml]
language: python
additional_dependencies: [licenseheaders>=0.8.8]
types_or: [python, yaml, shell, toml]
pass_filenames: false
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ Use [dev_clean_setup.sh](https://github.com/Cloudrisk/rune-python-runtime/blob/m
```sh
./dev_clean_setup.sh
```

This script installs all dev dependencies and registers the pre-commit hooks, including the license-header check. Every `.py` file under `src/` and `test/` must carry the Apache 2.0 SPDX header:

```python
# Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
# SPDX-License-Identifier: Apache-2.0
```

To add missing headers to all files at any time, run:

```sh
src/license/apply_headers.sh
```

### 3. Build
Use [build_wheel.sh](https://github.com/Cloudrisk/rune-python-runtime/blob/main/build_wheel.sh) to build the package
```sh
Expand Down
4 changes: 4 additions & 0 deletions build_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##

function error
{
Expand Down
6 changes: 6 additions & 0 deletions dev_clean_setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##

function error
{
Expand Down Expand Up @@ -34,3 +38,5 @@ ${PY_EXE} -m venv --clear .pydevenv || error


python -m pip install -e .[dev] --config-settings editable_mode=compat || error

pre-commit install || error
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#
# Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
# SPDX-License-Identifier: Apache-2.0
#
[build]
ignore = "/bin/false"
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
# SPDX-License-Identifier: Apache-2.0
#
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8", "wheel>=0.45.1", "pytest-runner>=6.0.1"]
build-backend = "setuptools.build_meta"
Expand All @@ -15,7 +19,9 @@ optional-dependencies.dev = [
"pytest>=9.0.2",
"pytest-cov>=7.0.0",
"pytest-mock>=3.14.1",
"types-python-dateutil>=2.9.0.20250809"
"types-python-dateutil>=2.9.0.20250809",
"licenseheaders>=0.8.8",
"pre-commit>=3.0.0"
]
description = "rune-runtime: the Rune DSL runtime for Python"
readme = "README.md"
Expand Down
4 changes: 4 additions & 0 deletions safety-policy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
##
## Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
## SPDX-License-Identifier: Apache-2.0
##
security:
ignore-cvss-severity-below: 6
ignore-cvss-unknown-severity: False
Expand Down
6 changes: 6 additions & 0 deletions src/license/apply_headers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# Applies the Apache 2.0 SPDX license header to all tracked source files.
set -e
TMPL="$(dirname "$0")/header.txt"
licenseheaders -t "$TMPL" --dir src --dir test --dir .github
licenseheaders -t "$TMPL" --additional-extensions python=.toml -f build_wheel.sh dev_clean_setup.sh netlify.toml pyproject.toml safety-policy.yml .pre-commit-config.yaml
2 changes: 2 additions & 0 deletions src/license/header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright (c) 2023-2026 CLOUDRISK Limited and FT Advisory LLC
SPDX-License-Identifier: Apache-2.0
2 changes: 1 addition & 1 deletion src/rune/runtime/base_data_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _unwrap_cow_inputs(cls, data: Any) -> Any:
@model_serializer(mode='wrap')
def _serialize_refs(self, serializer, info):
'''should replace objects with refs while serializing'''
res = serializer(self, info)
res = serializer(self)
refs = self._get_rune_refs_container()
for property_nm, (key, ref_type) in refs.items():
res[property_nm] = {ref_type.rune_ref_tag: key}
Expand Down
Loading