diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 07:10:13 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 07:10:13 +0000 |
| commit | 557032498b51c4467d02d7b066a5c44beea83437 (patch) | |
| tree | 9ce97eb8040d4f385e768ee6192bcf2c89e606fe /python-pytigerdriver.spec | |
| parent | 076d287f0114370e9e7e94fcb3762b96c42ee016 (diff) | |
automatic import of python-pytigerdriveropeneuler20.03
Diffstat (limited to 'python-pytigerdriver.spec')
| -rw-r--r-- | python-pytigerdriver.spec | 378 |
1 files changed, 378 insertions, 0 deletions
diff --git a/python-pytigerdriver.spec b/python-pytigerdriver.spec new file mode 100644 index 0000000..55fa5ed --- /dev/null +++ b/python-pytigerdriver.spec @@ -0,0 +1,378 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pyTigerDriver +Version: 1.0.15 +Release: 1 +Summary: GSQL client for TigerGraph +License: Apache 2 +URL: https://github.com/tigergraph/pyTigerDriver +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e7/6a/03d00a040806f88492df20208ae5b806767ec700b2690fa0f0eb22e8c51c/pyTigerDriver-1.0.15.tar.gz +BuildArch: noarch + + +%description + +# pyTigerDriver + + + +## Installation + +install with pip: + +```shell script +pip install pyTigerDriver +``` + + +## Usage + + +> **Architecture:** You can instatiate any **Interface [GSQL or REST]** in the **pyTigerDriver** seperately. + + +This flowchart illustrates the Classes: + +```mermaid +graph LR +A[pyTigerDriver as tgCl] -- Gsql --> B((Gsql_Client)) +A -- Rest --> C((Rest_Client)) +B --> D{TigerGraph Database} +C --> D +``` +### Sample Code : +```python +import pyTigerDriver as tg + +tgCl = tg.Client(server_ip="127.0.0.1",username="tigergraph",password="tigergraph",version="3.0.5") + +print("======================== SIMPLE RESTPP Queries ==================================") +print(tgCl.Rest.get("/echo")) # tgCl.Rest.post or tgCl.Rest.delete +print("============================== SIMPLE LS ===========================================") +print(tgCl.Gsql.execute("ls")) + +``` +# Code Linting And Unit Testing + +## Code Linting : + +Linting using PEP8 Standards + +```Shell + +user@box:~$ flake8 --exclude=venv* --ignore=E501 --statistics pyTigerDriver/pyDriver.py + +``` + +## Running the tests : + +run unit tests using pytest : + +```Shell + +user@box:~$ pytest -v + +``` +## CircleCi Work flow : + +1. create a folder named .circleci in the root of the repo +2. within that folder create a file called **config.yml** containing the folloing flow : + +```yaml +version: 2.1 + +orbs: + python: circleci/python@0.2.1 + + +jobs: + build-and-test: + executor: python/default + steps: + # Step 1: obtain repo from GitHub + - checkout + # Step 2: create virtual env and install dependencies + - run: + name: install dependencies + command: | + python3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + # Step 3: run linter and tests + - run: + name: run tests + command: | + . venv/bin/activate + flake8 --exclude=venv* --ignore=E501 --statistics pyTigerDriver/pyDriver.py + pytest -v + + +workflows: + main: + jobs: + - build-and-test + +``` + + +%package -n python3-pyTigerDriver +Summary: GSQL client for TigerGraph +Provides: python-pyTigerDriver +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pyTigerDriver + +# pyTigerDriver + + + +## Installation + +install with pip: + +```shell script +pip install pyTigerDriver +``` + + +## Usage + + +> **Architecture:** You can instatiate any **Interface [GSQL or REST]** in the **pyTigerDriver** seperately. + + +This flowchart illustrates the Classes: + +```mermaid +graph LR +A[pyTigerDriver as tgCl] -- Gsql --> B((Gsql_Client)) +A -- Rest --> C((Rest_Client)) +B --> D{TigerGraph Database} +C --> D +``` +### Sample Code : +```python +import pyTigerDriver as tg + +tgCl = tg.Client(server_ip="127.0.0.1",username="tigergraph",password="tigergraph",version="3.0.5") + +print("======================== SIMPLE RESTPP Queries ==================================") +print(tgCl.Rest.get("/echo")) # tgCl.Rest.post or tgCl.Rest.delete +print("============================== SIMPLE LS ===========================================") +print(tgCl.Gsql.execute("ls")) + +``` +# Code Linting And Unit Testing + +## Code Linting : + +Linting using PEP8 Standards + +```Shell + +user@box:~$ flake8 --exclude=venv* --ignore=E501 --statistics pyTigerDriver/pyDriver.py + +``` + +## Running the tests : + +run unit tests using pytest : + +```Shell + +user@box:~$ pytest -v + +``` +## CircleCi Work flow : + +1. create a folder named .circleci in the root of the repo +2. within that folder create a file called **config.yml** containing the folloing flow : + +```yaml +version: 2.1 + +orbs: + python: circleci/python@0.2.1 + + +jobs: + build-and-test: + executor: python/default + steps: + # Step 1: obtain repo from GitHub + - checkout + # Step 2: create virtual env and install dependencies + - run: + name: install dependencies + command: | + python3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + # Step 3: run linter and tests + - run: + name: run tests + command: | + . venv/bin/activate + flake8 --exclude=venv* --ignore=E501 --statistics pyTigerDriver/pyDriver.py + pytest -v + + +workflows: + main: + jobs: + - build-and-test + +``` + + +%package help +Summary: Development documents and examples for pyTigerDriver +Provides: python3-pyTigerDriver-doc +%description help + +# pyTigerDriver + + + +## Installation + +install with pip: + +```shell script +pip install pyTigerDriver +``` + + +## Usage + + +> **Architecture:** You can instatiate any **Interface [GSQL or REST]** in the **pyTigerDriver** seperately. + + +This flowchart illustrates the Classes: + +```mermaid +graph LR +A[pyTigerDriver as tgCl] -- Gsql --> B((Gsql_Client)) +A -- Rest --> C((Rest_Client)) +B --> D{TigerGraph Database} +C --> D +``` +### Sample Code : +```python +import pyTigerDriver as tg + +tgCl = tg.Client(server_ip="127.0.0.1",username="tigergraph",password="tigergraph",version="3.0.5") + +print("======================== SIMPLE RESTPP Queries ==================================") +print(tgCl.Rest.get("/echo")) # tgCl.Rest.post or tgCl.Rest.delete +print("============================== SIMPLE LS ===========================================") +print(tgCl.Gsql.execute("ls")) + +``` +# Code Linting And Unit Testing + +## Code Linting : + +Linting using PEP8 Standards + +```Shell + +user@box:~$ flake8 --exclude=venv* --ignore=E501 --statistics pyTigerDriver/pyDriver.py + +``` + +## Running the tests : + +run unit tests using pytest : + +```Shell + +user@box:~$ pytest -v + +``` +## CircleCi Work flow : + +1. create a folder named .circleci in the root of the repo +2. within that folder create a file called **config.yml** containing the folloing flow : + +```yaml +version: 2.1 + +orbs: + python: circleci/python@0.2.1 + + +jobs: + build-and-test: + executor: python/default + steps: + # Step 1: obtain repo from GitHub + - checkout + # Step 2: create virtual env and install dependencies + - run: + name: install dependencies + command: | + python3 -m venv venv + . venv/bin/activate + pip install -r requirements.txt + # Step 3: run linter and tests + - run: + name: run tests + command: | + . venv/bin/activate + flake8 --exclude=venv* --ignore=E501 --statistics pyTigerDriver/pyDriver.py + pytest -v + + +workflows: + main: + jobs: + - build-and-test + +``` + + +%prep +%autosetup -n pyTigerDriver-1.0.15 + +%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-pyTigerDriver -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.15-1 +- Package Spec generated |
