diff options
Diffstat (limited to 'python-lognub.spec')
| -rw-r--r-- | python-lognub.spec | 622 |
1 files changed, 622 insertions, 0 deletions
diff --git a/python-lognub.spec b/python-lognub.spec new file mode 100644 index 0000000..69c3986 --- /dev/null +++ b/python-lognub.spec @@ -0,0 +1,622 @@ +%global _empty_manifest_terminate_build 0 +Name: python-lognub +Version: 0.1.4 +Release: 1 +Summary: Dumb Log Utlity for personal use +License: Apache-2.0 +URL: https://github.com/ChethanUK/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d2/48/9786cde871e83d926a498d2feba06de2f576037497397b1921b41fa85b22/lognub-0.1.4.tar.gz +BuildArch: noarch + +Requires: python3-loguru + +%description +# LogNub + +[](https://github.com/ChethanUK/lognub/actions/workflows/build_test.yml) [](https://github.com/ChethanUK/lognub/actions/workflows/code_quality_lint_checkers.yml) [](https://github.com/ChethanUK/lognub/actions/workflows/codeql-analysis.yml) [](https://codecov.io/gh/ChethanUK/lognub) + +Loguru utility package + +## TODO + +1. Move logwrap [on top of loguru] extension out as a seperate package. +1. Add Test containers for [amundsen](https://www.amundsen.io/amundsen/), etc.. + +## Getting Started + +1. Setup [SDKMAN](#setup-sdkman) +1. Setup [Java](#setup-java) +1. Setup [Apache Spark](#setup-apache-spark) +1. Install [Poetry](#poetry) +1. Install Pre-commit and [follow instruction in here](PreCommit.MD) +1. Run [tests locally](#running-tests-locally) + +### Setup SDKMAN + +SDKMAN is a tool for managing parallel Versions of multiple Software Development Kits on any Unix based +system. It provides a convenient command line interface for installing, switching, removing and listing +Candidates. SDKMAN! installs smoothly on Mac OSX, Linux, WSL, Cygwin, etc... Support Bash and ZSH shells. See +documentation on the [SDKMAN! website](https://sdkman.io). + +Open your favourite terminal and enter the following: + +```bash +$ curl -s https://get.sdkman.io | bash +If the environment needs tweaking for SDKMAN to be installed, +the installer will prompt you accordingly and ask you to restart. + +Next, open a new terminal or enter: + +$ source "$HOME/.sdkman/bin/sdkman-init.sh" + +Lastly, run the following code snippet to ensure that installation succeeded: + +$ sdk version +``` + +### Setup Java + +Install Java Now open favourite terminal and enter the following: + +```bash +List the AdoptOpenJDK OpenJDK versions +$ sdk list java + +Install the Java 8: +$ sdk install java 8.0.292.hs-adpt + +Set Java 8 as default Java Version: +$ sdk default java 8.0.292.hs-adpt + +OR + +To install For Java 11 +$ sdk install java 11.0.10.hs-adpt +``` + +### Setup Apache Spark + +Install Java Now open favourite terminal and enter the following: + +```bash +List the Apache Spark versions: +$ sdk list spark + +To install For Spark 3 +$ sdk install spark 3.0.2 + +To install For Spark 3.1 +$ sdk install spark 3.0.2 +``` + +## Install PyEnv and Python 3.8 + +Either install pyenv via brew or github: +```bash +brew install pyenv + +Then setup in zshrc: +echo 'eval "$(pyenv init --path)"' >> ~/.zprofile + +echo 'eval "$(pyenv init -)"' >> ~/.zshrc +``` + +Then Install Python 3.8: + +```bash +pyenv install 3.8.11 +``` + +cd allocator project directory: +```bash +# Checkout git repo of iAllocator +cd dse-iAllocator +cd customer/allocator +# Now set default python version as 3.8.11 +pyenv local 3.8.11 +# Verify python version +python -V +Python 3.8.11 +``` + +## Create VirtualENV + +Create local venv inside allocator project: +```bash +cd dse-iAllocator [Repo directory] +cd customer/allocator +# Create virtualenv locally +python -m venv .venv +# Verify activate file exists +ls -G .venv/bin +# Activate virtual env python +source .venv/bin/activate +``` + +Verify virtual env and python is working and .venv is activated: + +```bash +which python +# should end with {$ROOT_DIR}.venv/bin/python +which pip +# should end with {$ROOT_DIR}.venv/bin/pip +``` + +### Poetry + +Poetry [Commands](https://python-poetry.org/docs/cli/#search) - Python package management tool + +Install Poetry: + +Install poetry using brew +```bash +brew install poetry +``` + +OR + +Follow instructions for Linux: [here](https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions) + +```bash +# For osx / linux / bash on windows install: +curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - +``` + +Install the dep packages: + +NOTE: Make sure you are connected to OpenVPN[since some are internal packages - catalog_client] +```bash +Install psycopg2 binary via PIP: +$ pip install psycopg2-binary==2.9.1 + +Install rest of packages via Poetry: + +$ poetry install + +# --tree: List the dependencies as a tree. +# --latest (-l): Show the latest version. +# --outdated (-o): Show the latest version but only for packages that are outdated. +poetry show -o + +To update any package: +#$ poetry update pandas +``` + +## Running Tests Locally + +Take a look at tests in `tests/dataquality` and `tests/jobs` + +```bash +$ poetry run pytest +Ran 95 tests in 96.95s +``` + +Thats it, ENV is setup + +NOTE: Loguru Wrap Package extracted from different internal package +NOTE: It's just curated stuff, Created for personal usage. + +%package -n python3-lognub +Summary: Dumb Log Utlity for personal use +Provides: python-lognub +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-lognub +# LogNub + +[](https://github.com/ChethanUK/lognub/actions/workflows/build_test.yml) [](https://github.com/ChethanUK/lognub/actions/workflows/code_quality_lint_checkers.yml) [](https://github.com/ChethanUK/lognub/actions/workflows/codeql-analysis.yml) [](https://codecov.io/gh/ChethanUK/lognub) + +Loguru utility package + +## TODO + +1. Move logwrap [on top of loguru] extension out as a seperate package. +1. Add Test containers for [amundsen](https://www.amundsen.io/amundsen/), etc.. + +## Getting Started + +1. Setup [SDKMAN](#setup-sdkman) +1. Setup [Java](#setup-java) +1. Setup [Apache Spark](#setup-apache-spark) +1. Install [Poetry](#poetry) +1. Install Pre-commit and [follow instruction in here](PreCommit.MD) +1. Run [tests locally](#running-tests-locally) + +### Setup SDKMAN + +SDKMAN is a tool for managing parallel Versions of multiple Software Development Kits on any Unix based +system. It provides a convenient command line interface for installing, switching, removing and listing +Candidates. SDKMAN! installs smoothly on Mac OSX, Linux, WSL, Cygwin, etc... Support Bash and ZSH shells. See +documentation on the [SDKMAN! website](https://sdkman.io). + +Open your favourite terminal and enter the following: + +```bash +$ curl -s https://get.sdkman.io | bash +If the environment needs tweaking for SDKMAN to be installed, +the installer will prompt you accordingly and ask you to restart. + +Next, open a new terminal or enter: + +$ source "$HOME/.sdkman/bin/sdkman-init.sh" + +Lastly, run the following code snippet to ensure that installation succeeded: + +$ sdk version +``` + +### Setup Java + +Install Java Now open favourite terminal and enter the following: + +```bash +List the AdoptOpenJDK OpenJDK versions +$ sdk list java + +Install the Java 8: +$ sdk install java 8.0.292.hs-adpt + +Set Java 8 as default Java Version: +$ sdk default java 8.0.292.hs-adpt + +OR + +To install For Java 11 +$ sdk install java 11.0.10.hs-adpt +``` + +### Setup Apache Spark + +Install Java Now open favourite terminal and enter the following: + +```bash +List the Apache Spark versions: +$ sdk list spark + +To install For Spark 3 +$ sdk install spark 3.0.2 + +To install For Spark 3.1 +$ sdk install spark 3.0.2 +``` + +## Install PyEnv and Python 3.8 + +Either install pyenv via brew or github: +```bash +brew install pyenv + +Then setup in zshrc: +echo 'eval "$(pyenv init --path)"' >> ~/.zprofile + +echo 'eval "$(pyenv init -)"' >> ~/.zshrc +``` + +Then Install Python 3.8: + +```bash +pyenv install 3.8.11 +``` + +cd allocator project directory: +```bash +# Checkout git repo of iAllocator +cd dse-iAllocator +cd customer/allocator +# Now set default python version as 3.8.11 +pyenv local 3.8.11 +# Verify python version +python -V +Python 3.8.11 +``` + +## Create VirtualENV + +Create local venv inside allocator project: +```bash +cd dse-iAllocator [Repo directory] +cd customer/allocator +# Create virtualenv locally +python -m venv .venv +# Verify activate file exists +ls -G .venv/bin +# Activate virtual env python +source .venv/bin/activate +``` + +Verify virtual env and python is working and .venv is activated: + +```bash +which python +# should end with {$ROOT_DIR}.venv/bin/python +which pip +# should end with {$ROOT_DIR}.venv/bin/pip +``` + +### Poetry + +Poetry [Commands](https://python-poetry.org/docs/cli/#search) - Python package management tool + +Install Poetry: + +Install poetry using brew +```bash +brew install poetry +``` + +OR + +Follow instructions for Linux: [here](https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions) + +```bash +# For osx / linux / bash on windows install: +curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - +``` + +Install the dep packages: + +NOTE: Make sure you are connected to OpenVPN[since some are internal packages - catalog_client] +```bash +Install psycopg2 binary via PIP: +$ pip install psycopg2-binary==2.9.1 + +Install rest of packages via Poetry: + +$ poetry install + +# --tree: List the dependencies as a tree. +# --latest (-l): Show the latest version. +# --outdated (-o): Show the latest version but only for packages that are outdated. +poetry show -o + +To update any package: +#$ poetry update pandas +``` + +## Running Tests Locally + +Take a look at tests in `tests/dataquality` and `tests/jobs` + +```bash +$ poetry run pytest +Ran 95 tests in 96.95s +``` + +Thats it, ENV is setup + +NOTE: Loguru Wrap Package extracted from different internal package +NOTE: It's just curated stuff, Created for personal usage. + +%package help +Summary: Development documents and examples for lognub +Provides: python3-lognub-doc +%description help +# LogNub + +[](https://github.com/ChethanUK/lognub/actions/workflows/build_test.yml) [](https://github.com/ChethanUK/lognub/actions/workflows/code_quality_lint_checkers.yml) [](https://github.com/ChethanUK/lognub/actions/workflows/codeql-analysis.yml) [](https://codecov.io/gh/ChethanUK/lognub) + +Loguru utility package + +## TODO + +1. Move logwrap [on top of loguru] extension out as a seperate package. +1. Add Test containers for [amundsen](https://www.amundsen.io/amundsen/), etc.. + +## Getting Started + +1. Setup [SDKMAN](#setup-sdkman) +1. Setup [Java](#setup-java) +1. Setup [Apache Spark](#setup-apache-spark) +1. Install [Poetry](#poetry) +1. Install Pre-commit and [follow instruction in here](PreCommit.MD) +1. Run [tests locally](#running-tests-locally) + +### Setup SDKMAN + +SDKMAN is a tool for managing parallel Versions of multiple Software Development Kits on any Unix based +system. It provides a convenient command line interface for installing, switching, removing and listing +Candidates. SDKMAN! installs smoothly on Mac OSX, Linux, WSL, Cygwin, etc... Support Bash and ZSH shells. See +documentation on the [SDKMAN! website](https://sdkman.io). + +Open your favourite terminal and enter the following: + +```bash +$ curl -s https://get.sdkman.io | bash +If the environment needs tweaking for SDKMAN to be installed, +the installer will prompt you accordingly and ask you to restart. + +Next, open a new terminal or enter: + +$ source "$HOME/.sdkman/bin/sdkman-init.sh" + +Lastly, run the following code snippet to ensure that installation succeeded: + +$ sdk version +``` + +### Setup Java + +Install Java Now open favourite terminal and enter the following: + +```bash +List the AdoptOpenJDK OpenJDK versions +$ sdk list java + +Install the Java 8: +$ sdk install java 8.0.292.hs-adpt + +Set Java 8 as default Java Version: +$ sdk default java 8.0.292.hs-adpt + +OR + +To install For Java 11 +$ sdk install java 11.0.10.hs-adpt +``` + +### Setup Apache Spark + +Install Java Now open favourite terminal and enter the following: + +```bash +List the Apache Spark versions: +$ sdk list spark + +To install For Spark 3 +$ sdk install spark 3.0.2 + +To install For Spark 3.1 +$ sdk install spark 3.0.2 +``` + +## Install PyEnv and Python 3.8 + +Either install pyenv via brew or github: +```bash +brew install pyenv + +Then setup in zshrc: +echo 'eval "$(pyenv init --path)"' >> ~/.zprofile + +echo 'eval "$(pyenv init -)"' >> ~/.zshrc +``` + +Then Install Python 3.8: + +```bash +pyenv install 3.8.11 +``` + +cd allocator project directory: +```bash +# Checkout git repo of iAllocator +cd dse-iAllocator +cd customer/allocator +# Now set default python version as 3.8.11 +pyenv local 3.8.11 +# Verify python version +python -V +Python 3.8.11 +``` + +## Create VirtualENV + +Create local venv inside allocator project: +```bash +cd dse-iAllocator [Repo directory] +cd customer/allocator +# Create virtualenv locally +python -m venv .venv +# Verify activate file exists +ls -G .venv/bin +# Activate virtual env python +source .venv/bin/activate +``` + +Verify virtual env and python is working and .venv is activated: + +```bash +which python +# should end with {$ROOT_DIR}.venv/bin/python +which pip +# should end with {$ROOT_DIR}.venv/bin/pip +``` + +### Poetry + +Poetry [Commands](https://python-poetry.org/docs/cli/#search) - Python package management tool + +Install Poetry: + +Install poetry using brew +```bash +brew install poetry +``` + +OR + +Follow instructions for Linux: [here](https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions) + +```bash +# For osx / linux / bash on windows install: +curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - +``` + +Install the dep packages: + +NOTE: Make sure you are connected to OpenVPN[since some are internal packages - catalog_client] +```bash +Install psycopg2 binary via PIP: +$ pip install psycopg2-binary==2.9.1 + +Install rest of packages via Poetry: + +$ poetry install + +# --tree: List the dependencies as a tree. +# --latest (-l): Show the latest version. +# --outdated (-o): Show the latest version but only for packages that are outdated. +poetry show -o + +To update any package: +#$ poetry update pandas +``` + +## Running Tests Locally + +Take a look at tests in `tests/dataquality` and `tests/jobs` + +```bash +$ poetry run pytest +Ran 95 tests in 96.95s +``` + +Thats it, ENV is setup + +NOTE: Loguru Wrap Package extracted from different internal package +NOTE: It's just curated stuff, Created for personal usage. + +%prep +%autosetup -n lognub-0.1.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-lognub -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.4-1 +- Package Spec generated |
