==========
ProcRunner
==========
.. image:: https://img.shields.io/pypi/v/procrunner.svg
:target: https://pypi.python.org/pypi/procrunner
:alt: PyPI release
.. image:: https://img.shields.io/conda/vn/conda-forge/procrunner.svg
:target: https://anaconda.org/conda-forge/procrunner
:alt: Conda Version
.. image:: https://dev.azure.com/DLS-tooling/procrunner/_apis/build/status/CI?branchName=master
:target: https://github.com/DiamondLightSource/python-procrunner/commits/master
:alt: Build status
.. image:: https://ci.appveyor.com/api/projects/status/jtq4brwri5q18d0u/branch/master
:target: https://ci.appveyor.com/project/Anthchirp/python-procrunner
:alt: Build status
.. image:: https://readthedocs.org/projects/procrunner/badge/?version=latest
:target: https://procrunner.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/pypi/pyversions/procrunner.svg
:target: https://pypi.python.org/pypi/procrunner
:alt: Supported Python versions
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
:alt: Code style: black
Versatile utility function to run external processes
* Free software: BSD license
* Documentation: https://procrunner.readthedocs.io.
Features
--------
* runs an external process and waits for it to finish
* does not deadlock, no matter the process stdout/stderr output behaviour
* returns the exit code, stdout, stderr (separately, both as bytestrings),
as a subprocess.CompletedProcess object
* process can run in a custom environment, either as a modification of
the current environment or in a new environment from scratch
* stdin can be fed to the process
* stdout and stderr is printed by default, can be disabled
* stdout and stderr can be passed to any arbitrary function for
live processing (separately, both as unicode strings)
* optionally enforces a time limit on the process, raising a
subprocess.TimeoutExpired exception if it is exceeded.
Credits
-------
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
=======
History
=======
2.3.3 (2022-03-23)
------------------
* Allow specifying 'preexec_fn' and 'creationflags' keywords, which will be passed through to
the subprocess call
2.3.2 (2022-01-28)
------------------
* The run() function now understands stdin=subprocess.DEVNULL to close the subprocess stdin,
rather than to connect through the existing stdin, which is the current default
2.3.1 (2021-10-25)
------------------
* Add Python 3.10 support
2.3.0 (2020-10-29)
------------------
* Add Python 3.9 support, drop Python 3.5 support
* Fix a file descriptor leak on subprocess execution
2.2.0 (2020-09-07)
------------------
* Calling the run() function with unnamed arguments (other than the command
list as the first argument) is now deprecated. As a number of arguments
will be removed in a future version the use of unnamed arguments will
cause future confusion. `Use explicit keyword arguments instead (#62). <https://github.com/DiamondLightSource/python-procrunner/pull/62>`_
* `The run() function debug argument has been deprecated (#63). <https://github.com/DiamondLightSource/python-procrunner/pull/63>`_
This is only used to debug the NonBlockingStream* classes. Those are due
to be replaced in a future release, so the argument will no longer serve
a purpose. Debugging information remains available via standard logging
mechanisms.
* Final version supporting Python 3.5
2.1.0 (2020-09-05)
------------------
* `Deprecated array access on the return object (#60). <https://github.com/DiamondLightSource/python-procrunner/pull/60>`_
The return object will become a subprocess.CompletedProcess in a future
release, which no longer allows array-based access. For a translation table
of array elements to attributes please see the pull request linked above.
* Add a `new parameter 'raise_timeout_exception' (#61). <https://github.com/DiamondLightSource/python-procrunner/pull/61>`_
When set to 'True' a subprocess.TimeoutExpired exception is raised when the
process runtime exceeds the timeout threshold. This defaults to 'False' and
will be set to 'True' in a future release.
2.0.0 (2020-06-24)
------------------
* Python 3.5+ only, support for Python 2.7 has been dropped
* Deprecated function alias run_process() has been removed
* Fixed a stability issue on Windows
1.1.0 (2019-11-04)
------------------
* Add Python 3.8 support, drop Python 3.4 support
1.0.2 (2019-05-20)
------------------
* Stop environment override variables leaking into the process environment
1.0.1 (2019-04-16)
------------------
* Minor fixes on the return object (implement equality,
mark as unhashable)
1.0.0 (2019-03-25)
------------------
* Support file system path objects (PEP-519) in arguments
* Change the return object to make it similar to
subprocess.CompletedProcess, introduced with Python 3.5+
0.9.1 (2019-02-22)
------------------
* Have deprecation warnings point to correct code locations
0.9.0 (2018-12-07)
------------------
* Trap UnicodeEncodeError when printing output. Offending characters
are replaced and a warning is logged once. Hints at incorrectly set
PYTHONIOENCODING.
0.8.1 (2018-12-04)
------------------
* Fix a few deprecation warnings
0.8.0 (2018-10-09)
------------------
* Add parameter working_directory to set the working directory
of the subprocess
0.7.2 (2018-10-05)
------------------
* Officially support Python 3.7
0.7.1 (2018-09-03)
------------------
* Accept environment variable overriding with numeric values.
0.7.0 (2018-05-13)
------------------
* Unicode fixes. Fix crash on invalid UTF-8 input.
* Clarify that stdout/stderr values are returned as bytestrings.
* Callbacks receive the data decoded as UTF-8 unicode strings
with unknown characters replaced by \ufffd (unicode replacement
character). Same applies to printing of output.
* Mark stdin broken on Windows.
0.6.1 (2018-05-02)
------------------
* Maintenance release to add some tests for executable resolution.
0.6.0 (2018-05-02)
------------------
* Fix Win32 API executable resolution for commands containing a dot ('.') in
addition to a file extension (say '.bat').
0.5.1 (2018-04-27)
------------------
* Fix Win32API dependency installation on Windows.
0.5.0 (2018-04-26)
------------------
* New keyword 'win32resolve' which only takes effect on Windows and is enabled
by default. This causes procrunner to call the Win32 API FindExecutable()
function to try and lookup non-.exe files with the corresponding name. This
means .bat/.cmd/etc.. files can now be run without explicitly specifying
their extension. Only supported on Python 2.7 and 3.5+.
0.4.0 (2018-04-23)
------------------
* Python 2.7 support on Windows. Python3 not yet supported on Windows.
0.3.0 (2018-04-17)
------------------
* run_process() renamed to run()
* Python3 compatibility fixes
0.2.0 (2018-03-12)
------------------
* Procrunner is now Python3 3.3-3.6 compatible.
0.1.0 (2018-03-12)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/DiamondLightSource/python-procrunner",
"name": "procrunner",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "procrunner",
"author": "Markus Gerstel",
"author_email": "scientificsoftware@diamond.ac.uk",
"download_url": "https://files.pythonhosted.org/packages/27/e6/fcb51b95b2b9597381e81eddd68e7dad83622f2b5bb96d16eb232ffe0ae7/procrunner-2.3.3.tar.gz",
"platform": null,
"description": "==========\nProcRunner\n==========\n\n\n.. image:: https://img.shields.io/pypi/v/procrunner.svg\n :target: https://pypi.python.org/pypi/procrunner\n :alt: PyPI release\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/procrunner.svg\n :target: https://anaconda.org/conda-forge/procrunner\n :alt: Conda Version\n\n.. image:: https://dev.azure.com/DLS-tooling/procrunner/_apis/build/status/CI?branchName=master\n :target: https://github.com/DiamondLightSource/python-procrunner/commits/master\n :alt: Build status\n\n.. image:: https://ci.appveyor.com/api/projects/status/jtq4brwri5q18d0u/branch/master\n :target: https://ci.appveyor.com/project/Anthchirp/python-procrunner\n :alt: Build status\n\n.. image:: https://readthedocs.org/projects/procrunner/badge/?version=latest\n :target: https://procrunner.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/pyversions/procrunner.svg\n :target: https://pypi.python.org/pypi/procrunner\n :alt: Supported Python versions\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/ambv/black\n :alt: Code style: black\n\nVersatile utility function to run external processes\n\n* Free software: BSD license\n* Documentation: https://procrunner.readthedocs.io.\n\n\nFeatures\n--------\n\n* runs an external process and waits for it to finish\n* does not deadlock, no matter the process stdout/stderr output behaviour\n* returns the exit code, stdout, stderr (separately, both as bytestrings),\n as a subprocess.CompletedProcess object\n* process can run in a custom environment, either as a modification of\n the current environment or in a new environment from scratch\n* stdin can be fed to the process\n* stdout and stderr is printed by default, can be disabled\n* stdout and stderr can be passed to any arbitrary function for\n live processing (separately, both as unicode strings)\n* optionally enforces a time limit on the process, raising a\n subprocess.TimeoutExpired exception if it is exceeded.\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n2.3.3 (2022-03-23)\n------------------\n* Allow specifying 'preexec_fn' and 'creationflags' keywords, which will be passed through to\n the subprocess call\n\n2.3.2 (2022-01-28)\n------------------\n* The run() function now understands stdin=subprocess.DEVNULL to close the subprocess stdin,\n rather than to connect through the existing stdin, which is the current default\n\n2.3.1 (2021-10-25)\n------------------\n* Add Python 3.10 support\n\n2.3.0 (2020-10-29)\n------------------\n* Add Python 3.9 support, drop Python 3.5 support\n* Fix a file descriptor leak on subprocess execution\n\n2.2.0 (2020-09-07)\n------------------\n* Calling the run() function with unnamed arguments (other than the command\n list as the first argument) is now deprecated. As a number of arguments\n will be removed in a future version the use of unnamed arguments will\n cause future confusion. `Use explicit keyword arguments instead (#62). <https://github.com/DiamondLightSource/python-procrunner/pull/62>`_\n* `The run() function debug argument has been deprecated (#63). <https://github.com/DiamondLightSource/python-procrunner/pull/63>`_\n This is only used to debug the NonBlockingStream* classes. Those are due\n to be replaced in a future release, so the argument will no longer serve\n a purpose. Debugging information remains available via standard logging\n mechanisms.\n* Final version supporting Python 3.5\n\n2.1.0 (2020-09-05)\n------------------\n* `Deprecated array access on the return object (#60). <https://github.com/DiamondLightSource/python-procrunner/pull/60>`_\n The return object will become a subprocess.CompletedProcess in a future\n release, which no longer allows array-based access. For a translation table\n of array elements to attributes please see the pull request linked above.\n* Add a `new parameter 'raise_timeout_exception' (#61). <https://github.com/DiamondLightSource/python-procrunner/pull/61>`_\n When set to 'True' a subprocess.TimeoutExpired exception is raised when the\n process runtime exceeds the timeout threshold. This defaults to 'False' and\n will be set to 'True' in a future release.\n\n2.0.0 (2020-06-24)\n------------------\n* Python 3.5+ only, support for Python 2.7 has been dropped\n* Deprecated function alias run_process() has been removed\n* Fixed a stability issue on Windows\n\n1.1.0 (2019-11-04)\n------------------\n* Add Python 3.8 support, drop Python 3.4 support\n\n1.0.2 (2019-05-20)\n------------------\n* Stop environment override variables leaking into the process environment\n\n1.0.1 (2019-04-16)\n------------------\n* Minor fixes on the return object (implement equality,\n mark as unhashable)\n\n1.0.0 (2019-03-25)\n------------------\n* Support file system path objects (PEP-519) in arguments\n* Change the return object to make it similar to\n subprocess.CompletedProcess, introduced with Python 3.5+\n\n0.9.1 (2019-02-22)\n------------------\n* Have deprecation warnings point to correct code locations\n\n0.9.0 (2018-12-07)\n------------------\n* Trap UnicodeEncodeError when printing output. Offending characters\n are replaced and a warning is logged once. Hints at incorrectly set\n PYTHONIOENCODING.\n\n0.8.1 (2018-12-04)\n------------------\n* Fix a few deprecation warnings\n\n0.8.0 (2018-10-09)\n------------------\n* Add parameter working_directory to set the working directory\n of the subprocess\n\n0.7.2 (2018-10-05)\n------------------\n* Officially support Python 3.7\n\n0.7.1 (2018-09-03)\n------------------\n* Accept environment variable overriding with numeric values.\n\n0.7.0 (2018-05-13)\n------------------\n* Unicode fixes. Fix crash on invalid UTF-8 input.\n* Clarify that stdout/stderr values are returned as bytestrings.\n* Callbacks receive the data decoded as UTF-8 unicode strings\n with unknown characters replaced by \\ufffd (unicode replacement\n character). Same applies to printing of output.\n* Mark stdin broken on Windows.\n\n0.6.1 (2018-05-02)\n------------------\n* Maintenance release to add some tests for executable resolution.\n\n0.6.0 (2018-05-02)\n------------------\n* Fix Win32 API executable resolution for commands containing a dot ('.') in\n addition to a file extension (say '.bat').\n\n0.5.1 (2018-04-27)\n------------------\n* Fix Win32API dependency installation on Windows.\n\n0.5.0 (2018-04-26)\n------------------\n* New keyword 'win32resolve' which only takes effect on Windows and is enabled\n by default. This causes procrunner to call the Win32 API FindExecutable()\n function to try and lookup non-.exe files with the corresponding name. This\n means .bat/.cmd/etc.. files can now be run without explicitly specifying\n their extension. Only supported on Python 2.7 and 3.5+.\n\n0.4.0 (2018-04-23)\n------------------\n* Python 2.7 support on Windows. Python3 not yet supported on Windows.\n\n0.3.0 (2018-04-17)\n------------------\n* run_process() renamed to run()\n* Python3 compatibility fixes\n\n0.2.0 (2018-03-12)\n------------------\n* Procrunner is now Python3 3.3-3.6 compatible.\n\n0.1.0 (2018-03-12)\n------------------\n* First release on PyPI.\n\n\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Versatile utility function to run external processes",
"version": "2.3.3",
"project_urls": {
"Bug-Tracker": "https://github.com/DiamondLightSource/python-procrunner/issues",
"Documentation": "https://procrunner.readthedocs.io/",
"Download": "https://github.com/DiamondLightSource/python-procrunner/tags",
"GitHub": "https://github.com/DiamondLightSource/python-procrunner",
"Homepage": "https://github.com/DiamondLightSource/python-procrunner"
},
"split_keywords": [
"procrunner"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ca1fdb51cadc820fb81ff014d8d5f675795d48d7acd5ccce126343822d9f8272",
"md5": "833b3f4cb58a41976cbb623289fc9317",
"sha256": "d9aec91fbde26f5824896d3ebb6b79169cc45dd59a6e2851f1dc2a8cb2e1f688"
},
"downloads": -1,
"filename": "procrunner-2.3.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "833b3f4cb58a41976cbb623289fc9317",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11392,
"upload_time": "2022-03-23T10:54:50",
"upload_time_iso_8601": "2022-03-23T10:54:50.829340Z",
"url": "https://files.pythonhosted.org/packages/ca/1f/db51cadc820fb81ff014d8d5f675795d48d7acd5ccce126343822d9f8272/procrunner-2.3.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "27e6fcb51b95b2b9597381e81eddd68e7dad83622f2b5bb96d16eb232ffe0ae7",
"md5": "be738c39a259f4a26de23055e398464d",
"sha256": "1717cbd7ac70876d1804777bf5775ceae1ea6a7b95c84d1d4423f0442d9e5b12"
},
"downloads": -1,
"filename": "procrunner-2.3.3.tar.gz",
"has_sig": false,
"md5_digest": "be738c39a259f4a26de23055e398464d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 23556,
"upload_time": "2022-03-23T10:54:52",
"upload_time_iso_8601": "2022-03-23T10:54:52.162243Z",
"url": "https://files.pythonhosted.org/packages/27/e6/fcb51b95b2b9597381e81eddd68e7dad83622f2b5bb96d16eb232ffe0ae7/procrunner-2.3.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-03-23 10:54:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DiamondLightSource",
"github_project": "python-procrunner",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"appveyor": true,
"requirements": [],
"tox": true,
"lcname": "procrunner"
}