diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-29 09:34:46 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-29 09:34:46 +0000 |
| commit | 391b219d76b3f010a516174d179d402371823c59 (patch) | |
| tree | 3a1b2cd67a34f4e99a86038f7abdf72613a97f76 | |
| parent | db38613c27301fe7e777b206a9ad6353d1303d37 (diff) | |
automatic import of python-ecoindex
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-ecoindex.spec | 297 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 299 insertions, 0 deletions
@@ -0,0 +1 @@ +/ecoindex-5.4.2.tar.gz diff --git a/python-ecoindex.spec b/python-ecoindex.spec new file mode 100644 index 0000000..a7634a4 --- /dev/null +++ b/python-ecoindex.spec @@ -0,0 +1,297 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ecoindex +Version: 5.4.2 +Release: 1 +Summary: Ecoindex module provides a simple way to measure the Ecoindex score based on the 3 parameters: The DOM elements of the page, the size of the page and the number of external requests of the page +License: MIT +URL: http://www.ecoindex.fr +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/71/7b/a6f65537c7d980864cf1640734ea176c3b057a04398dfbb3b954e4e2c058/ecoindex-5.4.2.tar.gz +BuildArch: noarch + +Requires: python3-pydantic +Requires: python3-requests +Requires: python3-aiofile + +%description +# ECOINDEX PYTHON + + +[](https://badge.fury.io/py/ecoindex) + +This basic module provides a simple interface to get the [Ecoindex](http://www.ecoindex.fr) based on 3 parameters: + +- The number of DOM elements in the page +- The size of the page +- The number of external requests of the page + +## Requirements + +- Python ^3.10 with [pip](https://pip.pypa.io/en/stable/installation/) + +## Install + +```shell +pip install ecoindex +``` + +## Use + +### Get ecoindex + +You can easily get the ecoindex by calling the function `get_ecoindex()`: + +```python +(function) get_ecoindex: (dom: int, size: float, requests: int) -> Coroutine[Any, Any, Ecoindex] +``` + +Example: + +```python +import asyncio +from pprint import pprint + +from ecoindex import get_ecoindex + +# Get ecoindex from DOM elements, size of page and requests of the page +ecoindex = asyncio.run(get_ecoindex(dom=100, size=100, requests=100)) +pprint(ecoindex) +``` + +Result example: + +```python +Ecoindex(grade='B', score=72.0, ges=1.56, water=2.34, ecoindex_version='3.0.0') +``` + +## Contribute + +You need [poetry](https://python-poetry.org/) to install and manage dependencies. Once poetry installed, run : + +```bash +poetry install +``` + +## Tests + +```shell +poetry run pytest +``` + +## Disclaimer + +The LCA values used by [ecoindex](https://github.com/cnumr/ecoindex_python) to evaluate environmental impacts are not under free license - ©Frédéric Bordage +Please also refer to the mentions provided in the code files for specifics on the IP regime. + +## [License](LICENSE) + +## [Contributing](CONTRIBUTING.md) + +## [Code of conduct](CODE_OF_CONDUCT.md) + + +%package -n python3-ecoindex +Summary: Ecoindex module provides a simple way to measure the Ecoindex score based on the 3 parameters: The DOM elements of the page, the size of the page and the number of external requests of the page +Provides: python-ecoindex +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-ecoindex +# ECOINDEX PYTHON + + +[](https://badge.fury.io/py/ecoindex) + +This basic module provides a simple interface to get the [Ecoindex](http://www.ecoindex.fr) based on 3 parameters: + +- The number of DOM elements in the page +- The size of the page +- The number of external requests of the page + +## Requirements + +- Python ^3.10 with [pip](https://pip.pypa.io/en/stable/installation/) + +## Install + +```shell +pip install ecoindex +``` + +## Use + +### Get ecoindex + +You can easily get the ecoindex by calling the function `get_ecoindex()`: + +```python +(function) get_ecoindex: (dom: int, size: float, requests: int) -> Coroutine[Any, Any, Ecoindex] +``` + +Example: + +```python +import asyncio +from pprint import pprint + +from ecoindex import get_ecoindex + +# Get ecoindex from DOM elements, size of page and requests of the page +ecoindex = asyncio.run(get_ecoindex(dom=100, size=100, requests=100)) +pprint(ecoindex) +``` + +Result example: + +```python +Ecoindex(grade='B', score=72.0, ges=1.56, water=2.34, ecoindex_version='3.0.0') +``` + +## Contribute + +You need [poetry](https://python-poetry.org/) to install and manage dependencies. Once poetry installed, run : + +```bash +poetry install +``` + +## Tests + +```shell +poetry run pytest +``` + +## Disclaimer + +The LCA values used by [ecoindex](https://github.com/cnumr/ecoindex_python) to evaluate environmental impacts are not under free license - ©Frédéric Bordage +Please also refer to the mentions provided in the code files for specifics on the IP regime. + +## [License](LICENSE) + +## [Contributing](CONTRIBUTING.md) + +## [Code of conduct](CODE_OF_CONDUCT.md) + + +%package help +Summary: Development documents and examples for ecoindex +Provides: python3-ecoindex-doc +%description help +# ECOINDEX PYTHON + + +[](https://badge.fury.io/py/ecoindex) + +This basic module provides a simple interface to get the [Ecoindex](http://www.ecoindex.fr) based on 3 parameters: + +- The number of DOM elements in the page +- The size of the page +- The number of external requests of the page + +## Requirements + +- Python ^3.10 with [pip](https://pip.pypa.io/en/stable/installation/) + +## Install + +```shell +pip install ecoindex +``` + +## Use + +### Get ecoindex + +You can easily get the ecoindex by calling the function `get_ecoindex()`: + +```python +(function) get_ecoindex: (dom: int, size: float, requests: int) -> Coroutine[Any, Any, Ecoindex] +``` + +Example: + +```python +import asyncio +from pprint import pprint + +from ecoindex import get_ecoindex + +# Get ecoindex from DOM elements, size of page and requests of the page +ecoindex = asyncio.run(get_ecoindex(dom=100, size=100, requests=100)) +pprint(ecoindex) +``` + +Result example: + +```python +Ecoindex(grade='B', score=72.0, ges=1.56, water=2.34, ecoindex_version='3.0.0') +``` + +## Contribute + +You need [poetry](https://python-poetry.org/) to install and manage dependencies. Once poetry installed, run : + +```bash +poetry install +``` + +## Tests + +```shell +poetry run pytest +``` + +## Disclaimer + +The LCA values used by [ecoindex](https://github.com/cnumr/ecoindex_python) to evaluate environmental impacts are not under free license - ©Frédéric Bordage +Please also refer to the mentions provided in the code files for specifics on the IP regime. + +## [License](LICENSE) + +## [Contributing](CONTRIBUTING.md) + +## [Code of conduct](CODE_OF_CONDUCT.md) + + +%prep +%autosetup -n ecoindex-5.4.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-ecoindex -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 5.4.2-1 +- Package Spec generated @@ -0,0 +1 @@ +9856d1170dd8a50a29e3c306ede63d6c ecoindex-5.4.2.tar.gz |
