From 0086e85a0e01aa59726ee5bd515162c55b5d17b1 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 10 Apr 2023 18:13:53 +0000 Subject: automatic import of python-zenroom --- .gitignore | 1 + python-zenroom.spec | 647 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 649 insertions(+) create mode 100644 python-zenroom.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..26f2d20 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/zenroom-2.20.4.tar.gz diff --git a/python-zenroom.spec b/python-zenroom.spec new file mode 100644 index 0000000..4eebf48 --- /dev/null +++ b/python-zenroom.spec @@ -0,0 +1,647 @@ +%global _empty_manifest_terminate_build 0 +Name: python-zenroom +Version: 2.20.4 +Release: 1 +Summary: Zenroom for Python: Bindings of Zenroom library for Python. +License: AGPLv3 +URL: https://zenroom.org +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/45/80/3ee4890257be3fb043f491ae08a1a112f4a532f01925fa214fdf3653e43a/zenroom-2.20.4.tar.gz +BuildArch: noarch + +Requires: python3-pytest +Requires: python3-schema + +%description +# Use Zenroom in Python3 +

+
+ + Zenroom + +

+ zenroom.py ๐Ÿ +
+ A Python3 wrapper of Zenroom, a secure and small virtual machine for crypto language processing

+ +

+ + + Build status + + + Code coverage + + + PyPI + +

+ +
+ + +This library attempts to provide a very simple wrapper around the Zenroom +(https://zenroom.dyne.org/) crypto virtual machine developed as part of the +DECODE project (https://decodeproject.eu/), that aims to make the Zenroom +virtual machine easier to call from normal Python code. + +Zenroom itself does have good cross platform functionality, so if you are +interested in finding out more about the functionalities offered by Zenroom, +then please visit the website linked to above to find out more. + + +*** +## ๐Ÿ’พ Installation + +```bash +pip install zenroom +``` + +**NOTE** - the above command attempts to install the zenroom package, pulling in +the Zenroom VM as a precompiled binary, so will only work on Linux and macOS +machines. + +for the edge (syn to the latest commit on master) version please run: +```bash +pip install zenroom --pre +``` + + +*** +## ๐ŸŽฎ Usage + +Two main calls are exposed, one to run `zencode` and one for `zenroom scripts`. + +If you don't know what `zencode` is, you can start with this blogpost +https://decodeproject.eu/blog/smart-contracts-english-speaker +The official documentation is available on [https://dev.zenroom.org/zencode/](https://dev.zenroom.org/zencode/) + +A good set of examples of `zencode` contracts could be found on +* [zencode simple tests](https://github.com/dyne/Zenroom/tree/master/test/zencode_simple) +* [zencode coconut tests](https://github.com/dyne/Zenroom/tree/master/test/zencode_coconut) + + +### ๐Ÿ Python wrapper + +the wrapper exposes two simple calls: + +* `zenroom_exec` +* `zencode_exec` + +as the names suggest are the two methods to execute zenroom (lua scripts) and zencode. + +#### args +Both functions accept the same arguments: + +- `script` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the lua script or + the zencode script to be executed +- `keys` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional keys + string to pass in execution as documented in zenroom docs [here](https://dev.zenroom.org/wiki/how-to-exec/#keys-string) +- `data` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional data + string to pass in execution as documented in zenroom docs [here](https://dev.zenroom.org/wiki/how-to-exec/#data-string) +- `conf` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional conf + string to pass according to zen_config [here](https://github.com/dyne/Zenroom/blob/master/src/zen_config.c#L99-L104) + +#### return +Both functions return the same object result `ZenResult` that have two attributes: + +- `stdout` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** holds the stdout of the script execution +- `stderr` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** holds the stderr of the script execution + +##### Examples + +Example usage of `zencode_exec(script, keys=None, data=None, conf=None)` + + +```python +from zenroom import zenroom + +contract = """Scenario ecdh: Create a keypair" +Given that I am known as 'identifier' +When I create the keypair +Then print my data +""" + +result = zenroom.zencode_exec(contract) +print(result.output) +``` + + +Example usage of `zenroom_exec(script, keys=None, data=None, conf=None)` + +```python +from zenroom import zenroom + +script = "print('Hello world')" +result = zenroom.zenroom_exec(script) + +print(result.output) +``` + +The same arguments and the same result are applied as the `zencode_exec` call. + +*** +## ๐Ÿ“‹ Testing + +Tests are made with pytests, just run + +`python setup.py test` + +in [`zenroom_test.py`](https://github.com/dyne/Zenroom/blob/master/bindings/python3/tests/test_all.py) file you'll find more usage examples of the wrapper + +*** +## ๐ŸŒ Links + +https://decodeproject.eu/ + +https://zenroom.org/ + +https://dev.zenroom.org/ + +## ๐Ÿ˜ Acknowledgements + +Copyright (C) 2018-2022 by [Dyne.org](https://www.dyne.org) foundation, Amsterdam + +Originally designed and written by Sam Mulube. + +Designed, written and maintained by Puria Nafisi Azizi + +Rewritten by Danilo Spinella and David Dashyan + +Project funded by the European Commission +This project is receiving funding from the European Unionโ€™s Horizon 2020 research and innovation programme under grant agreement nr. 732546 (DECODE). + +*** + +## ๐Ÿ‘ฅ Contributing +Please first take a look at the [Dyne.org - Contributor License Agreement](CONTRIBUTING.md) then + +1. ๐Ÿ”€ [FORK IT](https://github.com/dyne/Zenroom//fork) +2. Create your feature branch `git checkout -b feature/branch` +3. Commit your changes `git commit -am 'Add some fooBar'` +4. Push to the branch `git push origin feature/branch` +5. Create a new Pull Request `gh pr create -f` +6. ๐Ÿ™ Thank you + +*** + +## ๐Ÿ’ผ License + + Zenroom.py - a python wrapper of zenroom + Copyright (c) 2018-2022 Dyne.org foundation, Amsterdam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + + + + +%package -n python3-zenroom +Summary: Zenroom for Python: Bindings of Zenroom library for Python. +Provides: python-zenroom +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-zenroom +# Use Zenroom in Python3 +

+
+ + Zenroom + +

+ zenroom.py ๐Ÿ +
+ A Python3 wrapper of Zenroom, a secure and small virtual machine for crypto language processing

+ +

+ + + Build status + + + Code coverage + + + PyPI + +

+ +
+ + +This library attempts to provide a very simple wrapper around the Zenroom +(https://zenroom.dyne.org/) crypto virtual machine developed as part of the +DECODE project (https://decodeproject.eu/), that aims to make the Zenroom +virtual machine easier to call from normal Python code. + +Zenroom itself does have good cross platform functionality, so if you are +interested in finding out more about the functionalities offered by Zenroom, +then please visit the website linked to above to find out more. + + +*** +## ๐Ÿ’พ Installation + +```bash +pip install zenroom +``` + +**NOTE** - the above command attempts to install the zenroom package, pulling in +the Zenroom VM as a precompiled binary, so will only work on Linux and macOS +machines. + +for the edge (syn to the latest commit on master) version please run: +```bash +pip install zenroom --pre +``` + + +*** +## ๐ŸŽฎ Usage + +Two main calls are exposed, one to run `zencode` and one for `zenroom scripts`. + +If you don't know what `zencode` is, you can start with this blogpost +https://decodeproject.eu/blog/smart-contracts-english-speaker +The official documentation is available on [https://dev.zenroom.org/zencode/](https://dev.zenroom.org/zencode/) + +A good set of examples of `zencode` contracts could be found on +* [zencode simple tests](https://github.com/dyne/Zenroom/tree/master/test/zencode_simple) +* [zencode coconut tests](https://github.com/dyne/Zenroom/tree/master/test/zencode_coconut) + + +### ๐Ÿ Python wrapper + +the wrapper exposes two simple calls: + +* `zenroom_exec` +* `zencode_exec` + +as the names suggest are the two methods to execute zenroom (lua scripts) and zencode. + +#### args +Both functions accept the same arguments: + +- `script` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the lua script or + the zencode script to be executed +- `keys` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional keys + string to pass in execution as documented in zenroom docs [here](https://dev.zenroom.org/wiki/how-to-exec/#keys-string) +- `data` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional data + string to pass in execution as documented in zenroom docs [here](https://dev.zenroom.org/wiki/how-to-exec/#data-string) +- `conf` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional conf + string to pass according to zen_config [here](https://github.com/dyne/Zenroom/blob/master/src/zen_config.c#L99-L104) + +#### return +Both functions return the same object result `ZenResult` that have two attributes: + +- `stdout` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** holds the stdout of the script execution +- `stderr` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** holds the stderr of the script execution + +##### Examples + +Example usage of `zencode_exec(script, keys=None, data=None, conf=None)` + + +```python +from zenroom import zenroom + +contract = """Scenario ecdh: Create a keypair" +Given that I am known as 'identifier' +When I create the keypair +Then print my data +""" + +result = zenroom.zencode_exec(contract) +print(result.output) +``` + + +Example usage of `zenroom_exec(script, keys=None, data=None, conf=None)` + +```python +from zenroom import zenroom + +script = "print('Hello world')" +result = zenroom.zenroom_exec(script) + +print(result.output) +``` + +The same arguments and the same result are applied as the `zencode_exec` call. + +*** +## ๐Ÿ“‹ Testing + +Tests are made with pytests, just run + +`python setup.py test` + +in [`zenroom_test.py`](https://github.com/dyne/Zenroom/blob/master/bindings/python3/tests/test_all.py) file you'll find more usage examples of the wrapper + +*** +## ๐ŸŒ Links + +https://decodeproject.eu/ + +https://zenroom.org/ + +https://dev.zenroom.org/ + +## ๐Ÿ˜ Acknowledgements + +Copyright (C) 2018-2022 by [Dyne.org](https://www.dyne.org) foundation, Amsterdam + +Originally designed and written by Sam Mulube. + +Designed, written and maintained by Puria Nafisi Azizi + +Rewritten by Danilo Spinella and David Dashyan + +Project funded by the European Commission +This project is receiving funding from the European Unionโ€™s Horizon 2020 research and innovation programme under grant agreement nr. 732546 (DECODE). + +*** + +## ๐Ÿ‘ฅ Contributing +Please first take a look at the [Dyne.org - Contributor License Agreement](CONTRIBUTING.md) then + +1. ๐Ÿ”€ [FORK IT](https://github.com/dyne/Zenroom//fork) +2. Create your feature branch `git checkout -b feature/branch` +3. Commit your changes `git commit -am 'Add some fooBar'` +4. Push to the branch `git push origin feature/branch` +5. Create a new Pull Request `gh pr create -f` +6. ๐Ÿ™ Thank you + +*** + +## ๐Ÿ’ผ License + + Zenroom.py - a python wrapper of zenroom + Copyright (c) 2018-2022 Dyne.org foundation, Amsterdam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + + + + +%package help +Summary: Development documents and examples for zenroom +Provides: python3-zenroom-doc +%description help +# Use Zenroom in Python3 +

+
+ + Zenroom + +

+ zenroom.py ๐Ÿ +
+ A Python3 wrapper of Zenroom, a secure and small virtual machine for crypto language processing

+ +

+ + + Build status + + + Code coverage + + + PyPI + +

+ +
+ + +This library attempts to provide a very simple wrapper around the Zenroom +(https://zenroom.dyne.org/) crypto virtual machine developed as part of the +DECODE project (https://decodeproject.eu/), that aims to make the Zenroom +virtual machine easier to call from normal Python code. + +Zenroom itself does have good cross platform functionality, so if you are +interested in finding out more about the functionalities offered by Zenroom, +then please visit the website linked to above to find out more. + + +*** +## ๐Ÿ’พ Installation + +```bash +pip install zenroom +``` + +**NOTE** - the above command attempts to install the zenroom package, pulling in +the Zenroom VM as a precompiled binary, so will only work on Linux and macOS +machines. + +for the edge (syn to the latest commit on master) version please run: +```bash +pip install zenroom --pre +``` + + +*** +## ๐ŸŽฎ Usage + +Two main calls are exposed, one to run `zencode` and one for `zenroom scripts`. + +If you don't know what `zencode` is, you can start with this blogpost +https://decodeproject.eu/blog/smart-contracts-english-speaker +The official documentation is available on [https://dev.zenroom.org/zencode/](https://dev.zenroom.org/zencode/) + +A good set of examples of `zencode` contracts could be found on +* [zencode simple tests](https://github.com/dyne/Zenroom/tree/master/test/zencode_simple) +* [zencode coconut tests](https://github.com/dyne/Zenroom/tree/master/test/zencode_coconut) + + +### ๐Ÿ Python wrapper + +the wrapper exposes two simple calls: + +* `zenroom_exec` +* `zencode_exec` + +as the names suggest are the two methods to execute zenroom (lua scripts) and zencode. + +#### args +Both functions accept the same arguments: + +- `script` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the lua script or + the zencode script to be executed +- `keys` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional keys + string to pass in execution as documented in zenroom docs [here](https://dev.zenroom.org/wiki/how-to-exec/#keys-string) +- `data` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional data + string to pass in execution as documented in zenroom docs [here](https://dev.zenroom.org/wiki/how-to-exec/#data-string) +- `conf` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** the optional conf + string to pass according to zen_config [here](https://github.com/dyne/Zenroom/blob/master/src/zen_config.c#L99-L104) + +#### return +Both functions return the same object result `ZenResult` that have two attributes: + +- `stdout` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** holds the stdout of the script execution +- `stderr` **[string](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)** holds the stderr of the script execution + +##### Examples + +Example usage of `zencode_exec(script, keys=None, data=None, conf=None)` + + +```python +from zenroom import zenroom + +contract = """Scenario ecdh: Create a keypair" +Given that I am known as 'identifier' +When I create the keypair +Then print my data +""" + +result = zenroom.zencode_exec(contract) +print(result.output) +``` + + +Example usage of `zenroom_exec(script, keys=None, data=None, conf=None)` + +```python +from zenroom import zenroom + +script = "print('Hello world')" +result = zenroom.zenroom_exec(script) + +print(result.output) +``` + +The same arguments and the same result are applied as the `zencode_exec` call. + +*** +## ๐Ÿ“‹ Testing + +Tests are made with pytests, just run + +`python setup.py test` + +in [`zenroom_test.py`](https://github.com/dyne/Zenroom/blob/master/bindings/python3/tests/test_all.py) file you'll find more usage examples of the wrapper + +*** +## ๐ŸŒ Links + +https://decodeproject.eu/ + +https://zenroom.org/ + +https://dev.zenroom.org/ + +## ๐Ÿ˜ Acknowledgements + +Copyright (C) 2018-2022 by [Dyne.org](https://www.dyne.org) foundation, Amsterdam + +Originally designed and written by Sam Mulube. + +Designed, written and maintained by Puria Nafisi Azizi + +Rewritten by Danilo Spinella and David Dashyan + +Project funded by the European Commission +This project is receiving funding from the European Unionโ€™s Horizon 2020 research and innovation programme under grant agreement nr. 732546 (DECODE). + +*** + +## ๐Ÿ‘ฅ Contributing +Please first take a look at the [Dyne.org - Contributor License Agreement](CONTRIBUTING.md) then + +1. ๐Ÿ”€ [FORK IT](https://github.com/dyne/Zenroom//fork) +2. Create your feature branch `git checkout -b feature/branch` +3. Commit your changes `git commit -am 'Add some fooBar'` +4. Push to the branch `git push origin feature/branch` +5. Create a new Pull Request `gh pr create -f` +6. ๐Ÿ™ Thank you + +*** + +## ๐Ÿ’ผ License + + Zenroom.py - a python wrapper of zenroom + Copyright (c) 2018-2022 Dyne.org foundation, Amsterdam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + + + + +%prep +%autosetup -n zenroom-2.20.4 + +%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-zenroom -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon Apr 10 2023 Python_Bot - 2.20.4-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..d43a6bb --- /dev/null +++ b/sources @@ -0,0 +1 @@ +f06d813cec063c4bf18707d1c700f911 zenroom-2.20.4.tar.gz -- cgit v1.2.3