Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
0fc1af1
Initial commit
minesh-s-patel Dec 4, 2024
2bf71e1
Initial commit for the new repo of the Rune DSL python runtime.
plamen-neykov Dec 8, 2024
7d69273
fixed the metadata treatment and relaxed the requirements for a repla…
plamen-neykov Dec 8, 2024
c1e65fc
catch-up with the old repo (reformatting)
plamen-neykov Dec 8, 2024
bace272
Develop (#1)
plamen-neykov Dec 8, 2024
ff73cc5
Revert "Develop (#1)" (#2)
plamen-neykov Dec 8, 2024
085131b
Merge pull request #3 from Cloudrisk/develop
plamen-neykov Dec 8, 2024
b0bdc10
added script to run tests
dschwartz-ftadvisory Dec 10, 2024
3619518
annotated basic rune types - work in progress.
plamen-neykov Dec 10, 2024
da18b18
added annotated date and datetime
plamen-neykov Dec 10, 2024
252aa4e
added time to the annotated types
plamen-neykov Dec 10, 2024
400dc02
First pass implementation of the full set of metadata attributes for …
plamen-neykov Dec 17, 2024
f476b94
Second iteration of the simpel types with metadata - added some utili…
plamen-neykov Dec 17, 2024
f3fad8f
Amendments to support the parametrization of basic types when decorat…
plamen-neykov Dec 18, 2024
878e485
prep work for the metadata suppor tfor complex types
plamen-neykov Dec 22, 2024
1993425
- implemented the metadata handling for complex classes
plamen-neykov Dec 22, 2024
887382a
Streamlined the allowed metadata checks.
plamen-neykov Dec 28, 2024
410a4f1
first draft implementation of the key/ref framework (external/local k…
plamen-neykov Jan 4, 2025
57d80d9
better checks if a property can be set to be a reference
plamen-neykov Jan 4, 2025
5a3ac80
provide life-cycle management for reference properties
plamen-neykov Jan 5, 2025
f73dcf8
added basic types refs/keys tests
plamen-neykov Jan 5, 2025
f495e78
refs/keys now fully supported by the serialization
plamen-neykov Jan 5, 2025
3bc5b7d
added support for in-memory usage of external keys/refs
plamen-neykov Jan 6, 2025
2e106d6
first deserialization implementation (complex types for now)
plamen-neykov Jan 8, 2025
94b1f95
First cut basic types ref/keys deserialization.
plamen-neykov Jan 8, 2025
ef10a11
fixed the validation of basic types when deserialising a reference.
plamen-neykov Jan 8, 2025
07a4293
- merged Priyanka's changes
plamen-neykov Jan 10, 2025
dff461b
Created test cases based on rune source and the corresponding json fi…
plamen-neykov Jan 10, 2025
ace43e6
fixed the example how basic types should be generated.
plamen-neykov Jan 11, 2025
34d0795
added rune_resolve_deep_attr
plamen-neykov Jan 22, 2025
c93d86f
Merge pull request #4 from Cloudrisk/develop
plamen-neykov Jan 22, 2025
c218e19
amended the required python version to be 3.11
plamen-neykov Jan 22, 2025
b170483
Merge pull request #5 from Cloudrisk/develop
plamen-neykov Jan 22, 2025
8b2f42d
refactored the datetime imports as they were confusing pydantic when …
plamen-neykov Jan 23, 2025
cedecd7
Merge pull request #6 from Cloudrisk/develop
plamen-neykov Jan 23, 2025
8e78bec
fix for annotations containing a string instead of class instances.
plamen-neykov Jan 24, 2025
4345de8
Merge pull request #7 from Cloudrisk/develop
plamen-neykov Jan 24, 2025
9abfd9a
ensure enums are serialized by value
plamen-neykov Jan 24, 2025
bce41b7
Merge pull request #8 from Cloudrisk/develop
plamen-neykov Jan 24, 2025
bfe1b80
reverted the enum change as is not necessary
plamen-neykov Jan 25, 2025
738a092
Implemented rune_serialize and rune_deserialize methods. These are th…
plamen-neykov Jan 25, 2025
ad75350
Merge pull request #9 from Cloudrisk/develop
plamen-neykov Jan 25, 2025
b4b8026
some additional tests regarding enum serialization
plamen-neykov Jan 26, 2025
1f7ba5c
Added full support for enums with metadata
plamen-neykov Jan 26, 2025
4bddb85
Merge pull request #10 from Cloudrisk/develop
plamen-neykov Jan 26, 2025
e4bd32e
Support for serialization/de-serialization of polymorphic properties …
plamen-neykov Jan 27, 2025
1d30e95
Merge pull request #11 from Cloudrisk/develop
plamen-neykov Jan 27, 2025
b2b6aaf
Interim state of the new key/ref scoped resolution mechanism.
plamen-neykov Jan 30, 2025
4187022
refs and keys prep work for the introduction of local look-up tables
plamen-neykov Jan 31, 2025
7fb714e
work in progress - per key type/per model and scoped object maps
plamen-neykov Feb 2, 2025
43cc810
First fully functional version.
plamen-neykov Feb 2, 2025
5de0bdf
Merge pull request #12 from Cloudrisk/develop
plamen-neykov Feb 2, 2025
bdafbbe
added some parameters and documentation for the serialization/deseria…
plamen-neykov Feb 3, 2025
8ab0074
added parameter types for consistency
plamen-neykov Feb 3, 2025
57be40f
Reformatted the function documentation for readability.
plamen-neykov Feb 3, 2025
aa3c11e
readme update and type correction
dschwartz-ftadvisory Feb 3, 2025
8721e5f
removed two unused parameters
plamen-neykov Feb 3, 2025
9f9303a
Merge branch 'develop' of https://github.com/Cloudrisk/rune-python-ru…
plamen-neykov Feb 3, 2025
1b936d0
some parameter checking and better default treatment when creating a …
plamen-neykov Feb 3, 2025
7706acf
Merge pull request #13 from Cloudrisk/develop
plamen-neykov Feb 4, 2025
7d1a439
Merge remote-tracking branch 'oldone/main'
plamen-neykov Mar 4, 2025
06c8b45
Create python-package-conda.yml
plamen-neykov Mar 4, 2025
ea6309e
Update pyproject.toml
plamen-neykov Mar 4, 2025
672b3ab
revert back to python 3.11
plamen-neykov Mar 5, 2025
7300777
use python 3.11
plamen-neykov Mar 5, 2025
0f48a2d
@type/@model generation now compatible with the new generation
plamen-neykov Mar 13, 2025
c302f1e
Merge pull request #1 from Cloudrisk/develop
plamen-neykov Mar 13, 2025
490e3d2
added some rudimentary cardinality checks
plamen-neykov Mar 13, 2025
05a841b
Merge pull request #2 from Cloudrisk/develop
plamen-neykov Mar 13, 2025
ce66557
allow ..WithMeta data types to be initialized with objects of the bas…
plamen-neykov Mar 17, 2025
b0d5f12
Merge pull request #3 from Cloudrisk/develop
plamen-neykov Mar 17, 2025
98c8ec5
amended the test using the serialization generated classes to use the…
plamen-neykov Mar 18, 2025
f378682
Raise better exception when the value of an attribute is not of the e…
plamen-neykov Mar 18, 2025
90fb3fd
Merge branch 'main' into develop
plamen-neykov Mar 18, 2025
0ef584a
Merge pull request #4 from Cloudrisk/develop
plamen-neykov Mar 18, 2025
3ba5a5f
added a flag to control the execution of the rune constraints during …
plamen-neykov Mar 19, 2025
34df4a4
Merge branch 'develop' of https://github.com/Cloudrisk/rune-python-ru…
plamen-neykov Mar 19, 2025
898da12
Merge pull request #5 from Cloudrisk/develop
plamen-neykov Mar 19, 2025
b0dacaa
update to README
dschwartz-ftadvisory Mar 27, 2025
83c59ae
fixed the reference resolution issue when deeper nesting was present
plamen-neykov Apr 3, 2025
067d045
Merge pull request #6 from Cloudrisk/develop
plamen-neykov Apr 3, 2025
c956729
minor fix to check in addition to _KEY_REF_CONSTRAINTS the type speci…
plamen-neykov Apr 4, 2025
3453547
Merge pull request #7 from Cloudrisk/develop
plamen-neykov Apr 4, 2025
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
38 changes: 38 additions & 0 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Release Wheel

on:
push:
tags:
- '**' # Trigger on tags like v1.0.0, v2.1.3, etc.

jobs:
build-and-release:
name: Build Wheel and Create Release
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for setuptools_scm to determine version from git tags

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

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools setuptools_scm wheel pytest-runner

- name: Build wheel
run: |
python -m build --wheel

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ website/.docusaurus

website/npm-debug.log*
website/yarn-debug.log*
website/yarn-error.log*
website/yarn-error.log*

# python related artefacts and directories
__pycache__
.pydevenv
build
src/rune.runtime.egg-info
rune.runtime-*.whl
src/rune/runtime/version.py
/.coverage
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{project name} - FINOS
Copyright {yyyy} - {current year} {name of copyright owner} {email of copyright holder}
Rune Python Runtime - FINOS
Copyright 2023 - 2025 {name of copyright owner} {email of copyright holder}

This product includes software developed at the Fintech Open Source Foundation (https://www.finos.org/).

Expand Down
76 changes: 65 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,78 @@
<img align="right" width="40%" src="https://www.finos.org/hubfs/FINOS/finos-logo/FINOS_Icon_Wordmark_Name_RGB_horizontal.png">
[![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)

# FINOS Software Project Blueprint
# Rune Python Runtime

Project blueprint is a GitHub repository template for all [Fintech Open Source Foundation (FINOS)](https://www.finos.org/) hosted GitHub repositories, contributed and maintained by FINOS.
The Rune Python Runtime supports and is an integral part of Python code generated from a [Rune DSL](https://github.com/finos/rune-dsl) defined model. Rune DSL is a Domain-Specific Language used to model Financial Markets activities including the [Common Domain Model (CDM)](https://github.com/finos/common-domain-model).

## How to use this blueprint
The Rune Python Runtime is used in collaboration with the [Rune Python Code Generator](https://github.com/REGnosys/rosetta-code-generators) to translate a Rune DSL model into a fully usable Python package.

Please follow instructions on [community.finos.org/docs/collaboration-infrastructure#finos-project-blueprint](https://community.finos.org/docs/collaboration-infrastructure#finos-project-blueprint)

## Blueprint preview
## Installation

A preview of the blueprint can be found on [project-blueprint.finos.org](https://project-blueprint.finos.org)
The runtime is not generally installed on a stand alone basis but rather comes as part of a generated package such as CDM.

## Governance
This blueprint implements https://community.finos.org/docs/governance/#open-source-software-projects
Regardless, to install the package standalone:

1. Fetch the latest release data from the GitHub API
```sh
release_data=$(curl -s https://api.github.com/repos/REGnosys/rune-python-runtime/releases/latest)
```
2. Extract the download URL of the first asset
```sh
download_url=$(echo "$release_data" | grep '"browser_download_url":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')
```
3. Download the artifact using wget or curl
```sh
wget "$download_url"
```

4. Install the Runtime
```sh
python -m pip install rune.runtime*-py3-*.whl
```

## Development setup

Use [dev_clean_setup.sh](https://github.com/Cloudrisk/rune-python-runtime/blob/main/dev_clean_setup.sh) to setup a development environment.

```sh
./dev_clean_setup.sh
```
Use [build_wheel.sh](https://github.com/Cloudrisk/rune-python-runtime/blob/main/build_wheel.sh) to build the package
```sh
./build_wheel.sh
```
To run the unit tests:
```sh
test/run_runtime_tests.sh
```

## Roadmap

The Roadmap will be aligned to the Rune DSL and [CDM](https://github.com/finos/common-domain-model/blob/master/ROADMAP.md) roadmaps.

In addition, the intention is to make future releases available at [PyPi](https://pypi.org)

## Contributing
For any questions, bugs or feature requests please open an [issue](https://github.com/finos/{project slug}/issues)
For anything else please send an email to {project mailing list}.

To submit a contribution:
1. Fork it (<https://github.com/finos/{project slug}/fork>)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Read our [contribution guidelines](.github/CONTRIBUTING.md) and [Community Code of Conduct](https://www.finos.org/code-of-conduct)
4. Commit your changes (`git commit -am 'Add some fooBar'`)
5. Push to the branch (`git push origin feature/fooBar`)
6. Create a new Pull Request

_NOTE:_ Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool (or [EasyCLA](https://community.finos.org/docs/governance/Software-Projects/easycla)). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.

*Need an ICLA? Unsure if you are covered under an existing CCLA? Email [help@finos.org](mailto:help@finos.org)*

## License

Copyright 2019 Fintech Open Source Foundation
Copyright {yyyy} {name of copyright owner}

Distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)
SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)
23 changes: 23 additions & 0 deletions build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

function error
{
echo
echo "***************************************************************************"
echo "* *"
echo "* WHEEL Build FAILED! *"
echo "* *"
echo "***************************************************************************"
echo
exit -1
}

MY_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd ${MY_PATH} || error

if [ -d ".pydevenv" ]; then
export PATH=`echo $PATH | tr ":" "\n" | grep -v ".pydevenv" | tr "\n" ":"`
fi
type -P python > /dev/null && PY_EXE=python || PY_EXE=python3

${PY_EXE} -m pip wheel --no-deps --only-binary :all: . || error
37 changes: 37 additions & 0 deletions dev_clean_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

function error
{
echo
echo "***************************************************************************"
echo "* *"
echo "* DEV ENV Initialization FAILED! *"
echo "* *"
echo "***************************************************************************"
echo
exit -1
}

MY_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd ${MY_PATH} || error


if [ -d ".pydevenv" ]; then
export PATH=`echo $PATH | tr ":" "\n" | grep -v ".pydevenv" | tr "\n" ":"`
fi


type -P python > /dev/null && PY_EXE=python || PY_EXE=python3
if [ -z "${WINDIR}" ]; then
PY_SCRIPTS='bin'
else
PY_SCRIPTS='Scripts'
fi


${PY_EXE} -m venv --clear .pydevenv || error
. .pydevenv/${PY_SCRIPTS}/activate || error


pip install -r dev_requirements.txt || error
python -m pip install -e . --config-settings editable_mode=compat || error
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8", "wheel", "pytest-runner"]
build-backend = "setuptools.build_meta"

[project]
name = "rune.runtime"
dynamic = ["version"]
requires-python = ">=3.11"
dependencies = [
"pydantic>=2.10.3"
]
optional-dependencies.dev = [
"pytest",
"pytest-cov",
"pytest-mock"
]
description = "rune-runtime: the Rune DSL runtime for Python"
readme = "README.md"
keywords = [
"rune",
"rune runtime",
]
license = { text = "APACHE 2.0" }
authors = [
{ name = "Daniel Schwartz" },
{ name = "Plamen Neykov" },
{ name = "Others (See AUTHORS)" }
]
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache 2.0 License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Rune DSL",
"Topic :: Software Development :: Rune DSL Runtime"
]

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools_scm]
version_file = "src/rune/runtime/version.py"
5 changes: 5 additions & 0 deletions src/rune/runtime/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'''rune dsl runtime package'''
# PEP 396 module version attribute in PEP 440 version format
from .version import __version__

# EOF
Loading