From 09b52d8b82563fc035c8f878a38d642de2339b50 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 15 May 2023 07:36:51 +0000 Subject: automatic import of python-rjsonnet --- .gitignore | 1 + python-rjsonnet.spec | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 253 insertions(+) create mode 100644 python-rjsonnet.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..8db62b3 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/rjsonnet-0.5.2.tar.gz diff --git a/python-rjsonnet.spec b/python-rjsonnet.spec new file mode 100644 index 0000000..819895a --- /dev/null +++ b/python-rjsonnet.spec @@ -0,0 +1,251 @@ +%global _empty_manifest_terminate_build 0 +Name: python-rjsonnet +Version: 0.5.2 +Release: 1 +Summary: Python bindings to Rust jrsonnet crate +License: MIT +URL: https://github.com/messense/rjsonnet-py +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/5a/f5/77da28b6378b7fe3b92184bd06ec807db872e9b24ce21e023e221d073c44/rjsonnet-0.5.2.tar.gz + + +%description +# rjsonnet-py + +![CI](https://github.com/messense/rjsonnet-py/workflows/CI/badge.svg) +[![PyPI](https://img.shields.io/pypi/v/rjsonnet.svg)](https://pypi.org/project/rjsonnet) + +Python bindings to Rust [jrsonnet](https://github.com/CertainLach/jrsonnet) crates (Rust implementation of Jsonnet language). + +## Installation + +```bash +pip install rjsonnet +``` + +## Usage + +This module provides two functions: + +1. `def evaluate_file(filename: str) -> str: ...` +2. `def evaluate_snippet(filename: str, src: str) -> str: ...` + +In the latter case, the parameter `filename` is used in stack traces, +because all errors are given with the "filename" containing the code. + +Keyword arguments to these functions are used to control the virtual machine. They are: + +* `max_stack` (number) +* `gc_min_objects` (number, ignored) +* `gc_growth_trigger` (number, ignored) +* `ext_vars` (dict, string to string) +* `ext_codes` (dict, string to string) +* `tla_vars` (dict, string to string) +* `tla_codes` (dict, string to string) +* `max_trace` (number) +* `import_callback` (see example in [tests/](./tests/)) +* `native_callbacks` (see example in [tests/](./tests/)) +* `preserve_order` (bool, preserve object field order during manifestification) + +The argument `import_callback` can be used to pass a callable, to trap the Jsonnet `import` and `importstr` constructs. +This allows, e.g., reading files out of archives or implementing library search paths. + +The argument `native_callbacks` is used to allow execution of arbitrary Python code via `std.native(...)`. +This is useful so Jsonnet code can access pure functions in the Python ecosystem, such as compression, encryption, encoding, etc. + +If an error is raised during the evaluation of the Jsonnet code, it is formed into a stack trace and thrown as a python `RuntimeError`. + +```python +import rjsonnet + +# evaluate a jsonnet file +rjsonnet.evaluate_file("filename.jsonnet") + +# evalute a jsonnet code snippet +rjsonnet.evaluate_snippet('filename', 'jsonnet code snippet') +``` + +## License + +This work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file. + + + +%package -n python3-rjsonnet +Summary: Python bindings to Rust jrsonnet crate +Provides: python-rjsonnet +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-rjsonnet +# rjsonnet-py + +![CI](https://github.com/messense/rjsonnet-py/workflows/CI/badge.svg) +[![PyPI](https://img.shields.io/pypi/v/rjsonnet.svg)](https://pypi.org/project/rjsonnet) + +Python bindings to Rust [jrsonnet](https://github.com/CertainLach/jrsonnet) crates (Rust implementation of Jsonnet language). + +## Installation + +```bash +pip install rjsonnet +``` + +## Usage + +This module provides two functions: + +1. `def evaluate_file(filename: str) -> str: ...` +2. `def evaluate_snippet(filename: str, src: str) -> str: ...` + +In the latter case, the parameter `filename` is used in stack traces, +because all errors are given with the "filename" containing the code. + +Keyword arguments to these functions are used to control the virtual machine. They are: + +* `max_stack` (number) +* `gc_min_objects` (number, ignored) +* `gc_growth_trigger` (number, ignored) +* `ext_vars` (dict, string to string) +* `ext_codes` (dict, string to string) +* `tla_vars` (dict, string to string) +* `tla_codes` (dict, string to string) +* `max_trace` (number) +* `import_callback` (see example in [tests/](./tests/)) +* `native_callbacks` (see example in [tests/](./tests/)) +* `preserve_order` (bool, preserve object field order during manifestification) + +The argument `import_callback` can be used to pass a callable, to trap the Jsonnet `import` and `importstr` constructs. +This allows, e.g., reading files out of archives or implementing library search paths. + +The argument `native_callbacks` is used to allow execution of arbitrary Python code via `std.native(...)`. +This is useful so Jsonnet code can access pure functions in the Python ecosystem, such as compression, encryption, encoding, etc. + +If an error is raised during the evaluation of the Jsonnet code, it is formed into a stack trace and thrown as a python `RuntimeError`. + +```python +import rjsonnet + +# evaluate a jsonnet file +rjsonnet.evaluate_file("filename.jsonnet") + +# evalute a jsonnet code snippet +rjsonnet.evaluate_snippet('filename', 'jsonnet code snippet') +``` + +## License + +This work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file. + + + +%package help +Summary: Development documents and examples for rjsonnet +Provides: python3-rjsonnet-doc +%description help +# rjsonnet-py + +![CI](https://github.com/messense/rjsonnet-py/workflows/CI/badge.svg) +[![PyPI](https://img.shields.io/pypi/v/rjsonnet.svg)](https://pypi.org/project/rjsonnet) + +Python bindings to Rust [jrsonnet](https://github.com/CertainLach/jrsonnet) crates (Rust implementation of Jsonnet language). + +## Installation + +```bash +pip install rjsonnet +``` + +## Usage + +This module provides two functions: + +1. `def evaluate_file(filename: str) -> str: ...` +2. `def evaluate_snippet(filename: str, src: str) -> str: ...` + +In the latter case, the parameter `filename` is used in stack traces, +because all errors are given with the "filename" containing the code. + +Keyword arguments to these functions are used to control the virtual machine. They are: + +* `max_stack` (number) +* `gc_min_objects` (number, ignored) +* `gc_growth_trigger` (number, ignored) +* `ext_vars` (dict, string to string) +* `ext_codes` (dict, string to string) +* `tla_vars` (dict, string to string) +* `tla_codes` (dict, string to string) +* `max_trace` (number) +* `import_callback` (see example in [tests/](./tests/)) +* `native_callbacks` (see example in [tests/](./tests/)) +* `preserve_order` (bool, preserve object field order during manifestification) + +The argument `import_callback` can be used to pass a callable, to trap the Jsonnet `import` and `importstr` constructs. +This allows, e.g., reading files out of archives or implementing library search paths. + +The argument `native_callbacks` is used to allow execution of arbitrary Python code via `std.native(...)`. +This is useful so Jsonnet code can access pure functions in the Python ecosystem, such as compression, encryption, encoding, etc. + +If an error is raised during the evaluation of the Jsonnet code, it is formed into a stack trace and thrown as a python `RuntimeError`. + +```python +import rjsonnet + +# evaluate a jsonnet file +rjsonnet.evaluate_file("filename.jsonnet") + +# evalute a jsonnet code snippet +rjsonnet.evaluate_snippet('filename', 'jsonnet code snippet') +``` + +## License + +This work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file. + + + +%prep +%autosetup -n rjsonnet-0.5.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-rjsonnet -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot - 0.5.2-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..9174638 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +29b3b4726d33769becbaeb563327e25a rjsonnet-0.5.2.tar.gz -- cgit v1.2.3