From fd30d9e9bec2abf6b2afd48103ea2d9ea776b700 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Fri, 5 May 2023 05:10:55 +0000 Subject: automatic import of python-htchirp --- .gitignore | 1 + python-htchirp.spec | 378 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 380 insertions(+) create mode 100644 python-htchirp.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..fe2a1cb 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/htchirp-2.0.tar.gz diff --git a/python-htchirp.spec b/python-htchirp.spec new file mode 100644 index 0000000..2ec7572 --- /dev/null +++ b/python-htchirp.spec @@ -0,0 +1,378 @@ +%global _empty_manifest_terminate_build 0 +Name: python-htchirp +Version: 2.0 +Release: 1 +Summary: Pure Python Chirp client for HTCondor +License: ASL 2.0 +URL: https://htcondor.org +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d0/57/c50ed107b28d68cdeb71444aade397c2f4947d36bf7e6a61f34ca92c1e0a/htchirp-2.0.tar.gz +BuildArch: noarch + + +%description +# HTChirp + +Pure Python Chirp client for HTCondor + +## Installation + +The latest release is available on PyPI: + +`pip install htchirp` + +However, if HTCondor job sandbox space is a premium, most of HTChirp's +functionality can be accessed from [`htchirp.py`](htchirp/htchirp.py) +as a standalone script or module. + +## Example Usage + +There are multiple ways to invoke HTChirp inside a HTCondor job +environment. + +### Using HTChirp inside Python +First, you can use an HTChirp object as part of a larger Python workflow +connect to the Chirp server and issue commands: + +Using context management (**recommended**): +```python +>>> import htchirp +>>> with htchirp.HTChirp() as chirp: +>>> chirp.ulog('Logging use of Chirp in Python') +>>> me = chirp.whoami() +>>> chirp.set_job_attr('UsingPythonChirp', 'True') +>>> using_chirp = chirp.get_job_attr('UsingPythonChirp') +>>> me +'CONDOR' +>>> using_chirp +'true' +``` + +Using manual connection and disconnection (*not recommended*): +```python +>>> import htchirp +>>> chirp = htchirp.HTChirp() +>>> chirp.connect() +>>> chirp.write('Important output 1\n', '/tmp/my-job-output', 'cwa') +19 +>>> chirp.write('Important output 2\n', '/tmp/my-job-output', 'cwa') +19 +>>> chirp.read('/tmp/my-job-output', 1024) +'Important output 1\nImportant output 2\n' +>>> chirp.fetch('/tmp/my-job-output', './my-job-output') +38 +>>> chirp.disconnect() +``` + +For more information on the available commands, see `help(htchirp.HTChirp)`. + + +### Using HTChirp on the command line +Second, you can use HTChirp on the command line with the same commands +and arguments supported by the +[`condor_chirp`](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html) +utility, either by including +`htchirp.py` with your job or by installing the HTChirp package inside a +virtual environment inside your job. + +Using `htchirp.py` from within the working directory: +``` +$ python htchirp.py ulog "Logging use of Chirp in Python" +$ python htchirp.py whoami +CONDOR +$ python htchirp.py set_job_attr UsingPythonChirp True +$ python htchirp.py get_job_attr UsingPythonChirp +True +``` + +Using `condor_htchirp` after installing HTChirp in an active virtual +environment: +``` +$ condor_htchirp ulog "Logging use of Chirp in Python" +$ condor_htchirp whoami +CONDOR +$ condor_htchirp set_job_attr UsingPythonChirp True +$ condor_htchirp get_job_attr UsingPythonChirp +True +``` + +Using `python -m htchirp` after installing HTChirp in an active +virtual environment: +``` +$ python -m htchirp ulog "Logging use of Chirp in Python" +$ python -m htchirp whoami +CONDOR +$ python -m htchirp set_job_attr UsingPythonChirp True +$ python -m htchirp get_job_attr UsingPythonChirp +True +``` + +For a list of commands and arguments, pass `--help` to your preferred +command line invokation, or see the +[`condor_chirp` man page](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html). + + + + + +%package -n python3-htchirp +Summary: Pure Python Chirp client for HTCondor +Provides: python-htchirp +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-htchirp +# HTChirp + +Pure Python Chirp client for HTCondor + +## Installation + +The latest release is available on PyPI: + +`pip install htchirp` + +However, if HTCondor job sandbox space is a premium, most of HTChirp's +functionality can be accessed from [`htchirp.py`](htchirp/htchirp.py) +as a standalone script or module. + +## Example Usage + +There are multiple ways to invoke HTChirp inside a HTCondor job +environment. + +### Using HTChirp inside Python +First, you can use an HTChirp object as part of a larger Python workflow +connect to the Chirp server and issue commands: + +Using context management (**recommended**): +```python +>>> import htchirp +>>> with htchirp.HTChirp() as chirp: +>>> chirp.ulog('Logging use of Chirp in Python') +>>> me = chirp.whoami() +>>> chirp.set_job_attr('UsingPythonChirp', 'True') +>>> using_chirp = chirp.get_job_attr('UsingPythonChirp') +>>> me +'CONDOR' +>>> using_chirp +'true' +``` + +Using manual connection and disconnection (*not recommended*): +```python +>>> import htchirp +>>> chirp = htchirp.HTChirp() +>>> chirp.connect() +>>> chirp.write('Important output 1\n', '/tmp/my-job-output', 'cwa') +19 +>>> chirp.write('Important output 2\n', '/tmp/my-job-output', 'cwa') +19 +>>> chirp.read('/tmp/my-job-output', 1024) +'Important output 1\nImportant output 2\n' +>>> chirp.fetch('/tmp/my-job-output', './my-job-output') +38 +>>> chirp.disconnect() +``` + +For more information on the available commands, see `help(htchirp.HTChirp)`. + + +### Using HTChirp on the command line +Second, you can use HTChirp on the command line with the same commands +and arguments supported by the +[`condor_chirp`](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html) +utility, either by including +`htchirp.py` with your job or by installing the HTChirp package inside a +virtual environment inside your job. + +Using `htchirp.py` from within the working directory: +``` +$ python htchirp.py ulog "Logging use of Chirp in Python" +$ python htchirp.py whoami +CONDOR +$ python htchirp.py set_job_attr UsingPythonChirp True +$ python htchirp.py get_job_attr UsingPythonChirp +True +``` + +Using `condor_htchirp` after installing HTChirp in an active virtual +environment: +``` +$ condor_htchirp ulog "Logging use of Chirp in Python" +$ condor_htchirp whoami +CONDOR +$ condor_htchirp set_job_attr UsingPythonChirp True +$ condor_htchirp get_job_attr UsingPythonChirp +True +``` + +Using `python -m htchirp` after installing HTChirp in an active +virtual environment: +``` +$ python -m htchirp ulog "Logging use of Chirp in Python" +$ python -m htchirp whoami +CONDOR +$ python -m htchirp set_job_attr UsingPythonChirp True +$ python -m htchirp get_job_attr UsingPythonChirp +True +``` + +For a list of commands and arguments, pass `--help` to your preferred +command line invokation, or see the +[`condor_chirp` man page](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html). + + + + + +%package help +Summary: Development documents and examples for htchirp +Provides: python3-htchirp-doc +%description help +# HTChirp + +Pure Python Chirp client for HTCondor + +## Installation + +The latest release is available on PyPI: + +`pip install htchirp` + +However, if HTCondor job sandbox space is a premium, most of HTChirp's +functionality can be accessed from [`htchirp.py`](htchirp/htchirp.py) +as a standalone script or module. + +## Example Usage + +There are multiple ways to invoke HTChirp inside a HTCondor job +environment. + +### Using HTChirp inside Python +First, you can use an HTChirp object as part of a larger Python workflow +connect to the Chirp server and issue commands: + +Using context management (**recommended**): +```python +>>> import htchirp +>>> with htchirp.HTChirp() as chirp: +>>> chirp.ulog('Logging use of Chirp in Python') +>>> me = chirp.whoami() +>>> chirp.set_job_attr('UsingPythonChirp', 'True') +>>> using_chirp = chirp.get_job_attr('UsingPythonChirp') +>>> me +'CONDOR' +>>> using_chirp +'true' +``` + +Using manual connection and disconnection (*not recommended*): +```python +>>> import htchirp +>>> chirp = htchirp.HTChirp() +>>> chirp.connect() +>>> chirp.write('Important output 1\n', '/tmp/my-job-output', 'cwa') +19 +>>> chirp.write('Important output 2\n', '/tmp/my-job-output', 'cwa') +19 +>>> chirp.read('/tmp/my-job-output', 1024) +'Important output 1\nImportant output 2\n' +>>> chirp.fetch('/tmp/my-job-output', './my-job-output') +38 +>>> chirp.disconnect() +``` + +For more information on the available commands, see `help(htchirp.HTChirp)`. + + +### Using HTChirp on the command line +Second, you can use HTChirp on the command line with the same commands +and arguments supported by the +[`condor_chirp`](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html) +utility, either by including +`htchirp.py` with your job or by installing the HTChirp package inside a +virtual environment inside your job. + +Using `htchirp.py` from within the working directory: +``` +$ python htchirp.py ulog "Logging use of Chirp in Python" +$ python htchirp.py whoami +CONDOR +$ python htchirp.py set_job_attr UsingPythonChirp True +$ python htchirp.py get_job_attr UsingPythonChirp +True +``` + +Using `condor_htchirp` after installing HTChirp in an active virtual +environment: +``` +$ condor_htchirp ulog "Logging use of Chirp in Python" +$ condor_htchirp whoami +CONDOR +$ condor_htchirp set_job_attr UsingPythonChirp True +$ condor_htchirp get_job_attr UsingPythonChirp +True +``` + +Using `python -m htchirp` after installing HTChirp in an active +virtual environment: +``` +$ python -m htchirp ulog "Logging use of Chirp in Python" +$ python -m htchirp whoami +CONDOR +$ python -m htchirp set_job_attr UsingPythonChirp True +$ python -m htchirp get_job_attr UsingPythonChirp +True +``` + +For a list of commands and arguments, pass `--help` to your preferred +command line invokation, or see the +[`condor_chirp` man page](https://htcondor.readthedocs.io/en/latest/man-pages/condor_chirp.html). + + + + + +%prep +%autosetup -n htchirp-2.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-htchirp -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot - 2.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..8f5f78a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +174d88d6e3f18044ec604d1caee2d5f0 htchirp-2.0.tar.gz -- cgit v1.2.3