diff options
Diffstat (limited to 'python-sgqlc-schemas.spec')
-rw-r--r-- | python-sgqlc-schemas.spec | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/python-sgqlc-schemas.spec b/python-sgqlc-schemas.spec new file mode 100644 index 0000000..1cbf201 --- /dev/null +++ b/python-sgqlc-schemas.spec @@ -0,0 +1,187 @@ +%global _empty_manifest_terminate_build 0 +Name: python-sgqlc-schemas +Version: 0.1.0 +Release: 1 +Summary: A set of schemas for sgqlc package +License: MIT +URL: https://github.com/Mogost/sgqlc-schemas +Source0: https://mirrors.aliyun.com/pypi/web/packages/32/9b/8f01382a9b213955d34f2f1a2d5ad16fe7a045f25a8672717c564c1aa36e/sgqlc_schemas-0.1.0.tar.gz +BuildArch: noarch + +Requires: python3-sgqlc + +%description +[](https://badge.fury.io/py/sgqlc-schemas) +## About + +This package was created so that when using [sgqlc (Simple GraphQL Client)](https://github.com/profusion/sgqlc "sgqlc (Simple GraphQL Client)") you do not need to create schemas for popular APIs. + +## How to use + +#### Installation + +You can install this package either via the Python Package Index (PyPI) or from source. + +To install using ``pip``: +``` +$ pip install -U sgqlc-schemas +``` + +#### Import schema and simple query +```python +from sgqlc.endpoint.http import HTTPEndpoint +from sgqlc.operation import Operation +from sgqlc_schemas import github_schema + +op = Operation(github_schema.query_type) +op.viewer().login() +endpoint = HTTPEndpoint('https://api.github.com/graphql', {'Authorization': f'bearer {token}'}) +data = endpoint(op) +``` + +## Current schemas + +- [GitHub](http://github.com "GitHub") +- [Monday.com](http://monday.com "Monday.com") + +## Contribution + +This package welcomes any new contribution. Please create [pull requests on GitHub](https://github.com/Mogost/sgqlc-schemas/pulls "pull requests on GitHub"). + + + + +%package -n python3-sgqlc-schemas +Summary: A set of schemas for sgqlc package +Provides: python-sgqlc-schemas +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-sgqlc-schemas +[](https://badge.fury.io/py/sgqlc-schemas) +## About + +This package was created so that when using [sgqlc (Simple GraphQL Client)](https://github.com/profusion/sgqlc "sgqlc (Simple GraphQL Client)") you do not need to create schemas for popular APIs. + +## How to use + +#### Installation + +You can install this package either via the Python Package Index (PyPI) or from source. + +To install using ``pip``: +``` +$ pip install -U sgqlc-schemas +``` + +#### Import schema and simple query +```python +from sgqlc.endpoint.http import HTTPEndpoint +from sgqlc.operation import Operation +from sgqlc_schemas import github_schema + +op = Operation(github_schema.query_type) +op.viewer().login() +endpoint = HTTPEndpoint('https://api.github.com/graphql', {'Authorization': f'bearer {token}'}) +data = endpoint(op) +``` + +## Current schemas + +- [GitHub](http://github.com "GitHub") +- [Monday.com](http://monday.com "Monday.com") + +## Contribution + +This package welcomes any new contribution. Please create [pull requests on GitHub](https://github.com/Mogost/sgqlc-schemas/pulls "pull requests on GitHub"). + + + + +%package help +Summary: Development documents and examples for sgqlc-schemas +Provides: python3-sgqlc-schemas-doc +%description help +[](https://badge.fury.io/py/sgqlc-schemas) +## About + +This package was created so that when using [sgqlc (Simple GraphQL Client)](https://github.com/profusion/sgqlc "sgqlc (Simple GraphQL Client)") you do not need to create schemas for popular APIs. + +## How to use + +#### Installation + +You can install this package either via the Python Package Index (PyPI) or from source. + +To install using ``pip``: +``` +$ pip install -U sgqlc-schemas +``` + +#### Import schema and simple query +```python +from sgqlc.endpoint.http import HTTPEndpoint +from sgqlc.operation import Operation +from sgqlc_schemas import github_schema + +op = Operation(github_schema.query_type) +op.viewer().login() +endpoint = HTTPEndpoint('https://api.github.com/graphql', {'Authorization': f'bearer {token}'}) +data = endpoint(op) +``` + +## Current schemas + +- [GitHub](http://github.com "GitHub") +- [Monday.com](http://monday.com "Monday.com") + +## Contribution + +This package welcomes any new contribution. Please create [pull requests on GitHub](https://github.com/Mogost/sgqlc-schemas/pulls "pull requests on GitHub"). + + + + +%prep +%autosetup -n sgqlc_schemas-0.1.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-sgqlc-schemas -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.0-1 +- Package Spec generated |