diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-12 00:20:05 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 00:20:05 +0000 |
commit | 45b2c32f6fea53686b421accc98f70af123aec00 (patch) | |
tree | 298296502d4ca090c31339a0ff62478ec681a3b3 | |
parent | a8ebf96e037a95df2965440fb5240f26d27c3ab9 (diff) |
automatic import of python-amazon-braket-schemas
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-amazon-braket-schemas.spec | 511 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 513 insertions, 0 deletions
@@ -0,0 +1 @@ +/amazon-braket-schemas-1.15.0.tar.gz diff --git a/python-amazon-braket-schemas.spec b/python-amazon-braket-schemas.spec new file mode 100644 index 0000000..c412e16 --- /dev/null +++ b/python-amazon-braket-schemas.spec @@ -0,0 +1,511 @@ +%global _empty_manifest_terminate_build 0 +Name: python-amazon-braket-schemas +Version: 1.15.0 +Release: 1 +Summary: An open source library that contains the schemas for Amazon Braket +License: Apache License 2.0 +URL: https://github.com/aws/amazon-braket-schemas-python +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ed/ea/022ead82ccff93c11cfc50fcd9072a8509c11259b120dec747085557c6a2/amazon-braket-schemas-1.15.0.tar.gz +BuildArch: noarch + +Requires: python3-pydantic +Requires: python3-black +Requires: python3-flake8 +Requires: python3-isort +Requires: python3-jsonschema +Requires: python3-numpy +Requires: python3-pre-commit +Requires: python3-pylint +Requires: python3-pytest +Requires: python3-pytest-cov +Requires: python3-pytest-rerunfailures +Requires: python3-pytest-xdist +Requires: python3-sphinx +Requires: python3-sphinx-rtd-theme +Requires: python3-sphinxcontrib-apidoc +Requires: python3-tox + +%description +# Amazon Braket Python Schemas + +[](https://pypi.python.org/pypi/amazon-braket-schemas) +[](https://pypi.python.org/pypi/amazon-braket-schemas) +[](https://github.com/aws/amazon-braket-schemas-python/actions/workflows/python-package.yml) +[](https://codecov.io/gh/aws/amazon-braket-schemas-python) +[](https://amazon-braket-schemas-python.readthedocs.io/en/latest/?badge=latest) + +Amazon Braket Python Schemas is an open source library that contains the schemas for Braket, including: +* intermediate representations (IR) for Amazon Braket quantum tasks and offers serialization and deserialization of those IR payloads. Think of the IR as the contract between the Amazon Braket SDK and Amazon Braket API for quantum programs. +* schemas for the S3 results of each quantum task +* schemas for the device capabilities of each device + +## Installation + +### Prerequisites +- Python 3.7+ + +### Steps + +The preferred way to get Amazon Braket Python Schemas is by installing the [Amazon Braket Python SDK](https://github.com/aws/amazon-braket-sdk-python), which will pull in the schemas. +Follow the instructions in the [README](https://github.com/aws/amazon-braket-sdk-python/blob/main/README.md) for setup. + +However, if you only want to use the schemas, it can be installed on its own as follows: + +```shell +pip install amazon-braket-schemas +``` + +You can install from source by cloning this repository and running a pip install command in the root directory of the repository: + +```shell +git clone https://github.com/aws/amazon-braket-schemas-python.git +cd amazon-braket-schemas-python +pip install . +``` + +You can check your currently installed version of `amazon-braket-schemas` with `pip show`: + +```shell +pip show amazon-braket-schemas +``` + +or alternatively from within Python: + +``` +>>> import braket._schemas as braket_schemas +>>> braket_schemas.__version__ +``` + +## Usage +OpenQASM (Open Quantum Assembly Language) is one type of IR. See below for its usage. + +**Serializing python structures** +```python +from braket.ir.openqasm import Program as OpenQASMProgram + +program = OpenQASMProgram(source="OPENQASM 3.0; cnot $0, $1;") +print(program.json(indent=2)) + +""" +{ + "braketSchemaHeader": { + "name": "braket.ir.openqasm.program", + "version": "1" + }, + "source": "OPENQASM 3.0; cnot $0, $1;", + "inputs": null +} +""" +``` + +**Deserializing into python structures** +```python +from braket.ir.openqasm import Program as OpenQASMProgram + +openqasm_string = """ +{ + "braketSchemaHeader": { + "name": "braket.ir.openqasm.program", + "version": "1" + }, + "source": "OPENQASM 3.0; cnot $0, $1;" +}""" + +program = OpenQASMProgram.parse_raw(openqasm_string) +print(program) + +""" +braketSchemaHeader=BraketSchemaHeader(name='braket.ir.openqasm.program', version='1') source='OPENQASM 3.0; cnot $0, $1;' inputs=None +""" + +``` + +## Documentation + +Detailed documentation, including the API reference, can be found on [Read the Docs](https://amazon-braket-schemas-python.readthedocs.io/en/latest/). + +You can also generate the docs from source. First, install tox: + +```shell +pip install tox +``` + +To build the Sphinx docs, run the following command in the root repo directory: + +```shell +tox -e docs +``` + +You can then find the generated HTML files in `build/documentation/html`. + +## Testing + +Make sure to install test dependencies first: + +```shell +pip install -e "amazon-braket-schemas-python[test]" +``` + +To run the unit tests: +```bash +tox -e unit-tests +``` + +You can also pass in various pytest arguments to run selected tests: + +```bash +tox -e unit-tests -- your-arguments +``` + +To run linters and doc generators and unit tests: +```bash +tox +``` + +For more information, please see [pytest usage](https://docs.pytest.org/en/stable/usage.html). + +## License + +This project is licensed under the Apache-2.0 License. + + +%package -n python3-amazon-braket-schemas +Summary: An open source library that contains the schemas for Amazon Braket +Provides: python-amazon-braket-schemas +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-amazon-braket-schemas +# Amazon Braket Python Schemas + +[](https://pypi.python.org/pypi/amazon-braket-schemas) +[](https://pypi.python.org/pypi/amazon-braket-schemas) +[](https://github.com/aws/amazon-braket-schemas-python/actions/workflows/python-package.yml) +[](https://codecov.io/gh/aws/amazon-braket-schemas-python) +[](https://amazon-braket-schemas-python.readthedocs.io/en/latest/?badge=latest) + +Amazon Braket Python Schemas is an open source library that contains the schemas for Braket, including: +* intermediate representations (IR) for Amazon Braket quantum tasks and offers serialization and deserialization of those IR payloads. Think of the IR as the contract between the Amazon Braket SDK and Amazon Braket API for quantum programs. +* schemas for the S3 results of each quantum task +* schemas for the device capabilities of each device + +## Installation + +### Prerequisites +- Python 3.7+ + +### Steps + +The preferred way to get Amazon Braket Python Schemas is by installing the [Amazon Braket Python SDK](https://github.com/aws/amazon-braket-sdk-python), which will pull in the schemas. +Follow the instructions in the [README](https://github.com/aws/amazon-braket-sdk-python/blob/main/README.md) for setup. + +However, if you only want to use the schemas, it can be installed on its own as follows: + +```shell +pip install amazon-braket-schemas +``` + +You can install from source by cloning this repository and running a pip install command in the root directory of the repository: + +```shell +git clone https://github.com/aws/amazon-braket-schemas-python.git +cd amazon-braket-schemas-python +pip install . +``` + +You can check your currently installed version of `amazon-braket-schemas` with `pip show`: + +```shell +pip show amazon-braket-schemas +``` + +or alternatively from within Python: + +``` +>>> import braket._schemas as braket_schemas +>>> braket_schemas.__version__ +``` + +## Usage +OpenQASM (Open Quantum Assembly Language) is one type of IR. See below for its usage. + +**Serializing python structures** +```python +from braket.ir.openqasm import Program as OpenQASMProgram + +program = OpenQASMProgram(source="OPENQASM 3.0; cnot $0, $1;") +print(program.json(indent=2)) + +""" +{ + "braketSchemaHeader": { + "name": "braket.ir.openqasm.program", + "version": "1" + }, + "source": "OPENQASM 3.0; cnot $0, $1;", + "inputs": null +} +""" +``` + +**Deserializing into python structures** +```python +from braket.ir.openqasm import Program as OpenQASMProgram + +openqasm_string = """ +{ + "braketSchemaHeader": { + "name": "braket.ir.openqasm.program", + "version": "1" + }, + "source": "OPENQASM 3.0; cnot $0, $1;" +}""" + +program = OpenQASMProgram.parse_raw(openqasm_string) +print(program) + +""" +braketSchemaHeader=BraketSchemaHeader(name='braket.ir.openqasm.program', version='1') source='OPENQASM 3.0; cnot $0, $1;' inputs=None +""" + +``` + +## Documentation + +Detailed documentation, including the API reference, can be found on [Read the Docs](https://amazon-braket-schemas-python.readthedocs.io/en/latest/). + +You can also generate the docs from source. First, install tox: + +```shell +pip install tox +``` + +To build the Sphinx docs, run the following command in the root repo directory: + +```shell +tox -e docs +``` + +You can then find the generated HTML files in `build/documentation/html`. + +## Testing + +Make sure to install test dependencies first: + +```shell +pip install -e "amazon-braket-schemas-python[test]" +``` + +To run the unit tests: +```bash +tox -e unit-tests +``` + +You can also pass in various pytest arguments to run selected tests: + +```bash +tox -e unit-tests -- your-arguments +``` + +To run linters and doc generators and unit tests: +```bash +tox +``` + +For more information, please see [pytest usage](https://docs.pytest.org/en/stable/usage.html). + +## License + +This project is licensed under the Apache-2.0 License. + + +%package help +Summary: Development documents and examples for amazon-braket-schemas +Provides: python3-amazon-braket-schemas-doc +%description help +# Amazon Braket Python Schemas + +[](https://pypi.python.org/pypi/amazon-braket-schemas) +[](https://pypi.python.org/pypi/amazon-braket-schemas) +[](https://github.com/aws/amazon-braket-schemas-python/actions/workflows/python-package.yml) +[](https://codecov.io/gh/aws/amazon-braket-schemas-python) +[](https://amazon-braket-schemas-python.readthedocs.io/en/latest/?badge=latest) + +Amazon Braket Python Schemas is an open source library that contains the schemas for Braket, including: +* intermediate representations (IR) for Amazon Braket quantum tasks and offers serialization and deserialization of those IR payloads. Think of the IR as the contract between the Amazon Braket SDK and Amazon Braket API for quantum programs. +* schemas for the S3 results of each quantum task +* schemas for the device capabilities of each device + +## Installation + +### Prerequisites +- Python 3.7+ + +### Steps + +The preferred way to get Amazon Braket Python Schemas is by installing the [Amazon Braket Python SDK](https://github.com/aws/amazon-braket-sdk-python), which will pull in the schemas. +Follow the instructions in the [README](https://github.com/aws/amazon-braket-sdk-python/blob/main/README.md) for setup. + +However, if you only want to use the schemas, it can be installed on its own as follows: + +```shell +pip install amazon-braket-schemas +``` + +You can install from source by cloning this repository and running a pip install command in the root directory of the repository: + +```shell +git clone https://github.com/aws/amazon-braket-schemas-python.git +cd amazon-braket-schemas-python +pip install . +``` + +You can check your currently installed version of `amazon-braket-schemas` with `pip show`: + +```shell +pip show amazon-braket-schemas +``` + +or alternatively from within Python: + +``` +>>> import braket._schemas as braket_schemas +>>> braket_schemas.__version__ +``` + +## Usage +OpenQASM (Open Quantum Assembly Language) is one type of IR. See below for its usage. + +**Serializing python structures** +```python +from braket.ir.openqasm import Program as OpenQASMProgram + +program = OpenQASMProgram(source="OPENQASM 3.0; cnot $0, $1;") +print(program.json(indent=2)) + +""" +{ + "braketSchemaHeader": { + "name": "braket.ir.openqasm.program", + "version": "1" + }, + "source": "OPENQASM 3.0; cnot $0, $1;", + "inputs": null +} +""" +``` + +**Deserializing into python structures** +```python +from braket.ir.openqasm import Program as OpenQASMProgram + +openqasm_string = """ +{ + "braketSchemaHeader": { + "name": "braket.ir.openqasm.program", + "version": "1" + }, + "source": "OPENQASM 3.0; cnot $0, $1;" +}""" + +program = OpenQASMProgram.parse_raw(openqasm_string) +print(program) + +""" +braketSchemaHeader=BraketSchemaHeader(name='braket.ir.openqasm.program', version='1') source='OPENQASM 3.0; cnot $0, $1;' inputs=None +""" + +``` + +## Documentation + +Detailed documentation, including the API reference, can be found on [Read the Docs](https://amazon-braket-schemas-python.readthedocs.io/en/latest/). + +You can also generate the docs from source. First, install tox: + +```shell +pip install tox +``` + +To build the Sphinx docs, run the following command in the root repo directory: + +```shell +tox -e docs +``` + +You can then find the generated HTML files in `build/documentation/html`. + +## Testing + +Make sure to install test dependencies first: + +```shell +pip install -e "amazon-braket-schemas-python[test]" +``` + +To run the unit tests: +```bash +tox -e unit-tests +``` + +You can also pass in various pytest arguments to run selected tests: + +```bash +tox -e unit-tests -- your-arguments +``` + +To run linters and doc generators and unit tests: +```bash +tox +``` + +For more information, please see [pytest usage](https://docs.pytest.org/en/stable/usage.html). + +## License + +This project is licensed under the Apache-2.0 License. + + +%prep +%autosetup -n amazon-braket-schemas-1.15.0 + +%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-amazon-braket-schemas -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 1.15.0-1 +- Package Spec generated @@ -0,0 +1 @@ +02de0f26cd6a439b8f6700029611e574 amazon-braket-schemas-1.15.0.tar.gz |