Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
sh.egg-info/ | H | 03-May-2022 | - | 131 | 96 | |
CHANGELOG.md | H A D | 15-May-2021 | 15.4 KiB | 210 | 162 | |
MANIFEST.in | H A D | 15-May-2021 | 74 | 4 | 2 | |
PKG-INFO | H A D | 15-May-2021 | 4.7 KiB | 131 | 96 | |
README.rst | H A D | 15-May-2021 | 2.5 KiB | 96 | 62 | |
setup.cfg | H A D | 15-May-2021 | 138 | 14 | 9 | |
setup.py | H A D | 15-May-2021 | 1.9 KiB | 59 | 52 | |
sh.py | H A D | 15-May-2021 | 132.8 KiB | 3,980 | 2,602 | |
test.py | H A D | 15-May-2021 | 86.2 KiB | 3,211 | 2,425 |
README.rst
1.. image:: https://raw.githubusercontent.com/amoffat/sh/master/logo-230.png 2 :target: https://amoffat.github.com/sh 3 :alt: Logo 4 5| 6 7.. image:: https://img.shields.io/pypi/v/sh.svg?style=flat-square 8 :target: https://pypi.python.org/pypi/sh 9 :alt: Version 10.. image:: https://img.shields.io/pypi/dm/sh.svg?style=flat-square 11 :target: https://pypi.python.org/pypi/sh 12 :alt: Downloads Status 13.. image:: https://img.shields.io/pypi/pyversions/sh.svg?style=flat-square 14 :target: https://pypi.python.org/pypi/sh 15 :alt: Python Versions 16.. image:: https://img.shields.io/travis/amoffat/sh/master.svg?style=flat-square 17 :target: https://travis-ci.org/amoffat/sh 18 :alt: Build Status 19.. image:: https://img.shields.io/coveralls/amoffat/sh.svg?style=flat-square 20 :target: https://coveralls.io/r/amoffat/sh?branch=master 21 :alt: Coverage Status 22 23| 24 25sh is a full-fledged subprocess replacement for Python 2.6 - 3.8, PyPy and PyPy3 26that allows you to call *any* program as if it were a function: 27 28.. code:: python 29 30 from sh import ifconfig 31 print(ifconfig("eth0")) 32 33sh is *not* a collection of system commands implemented in Python. 34 35`Complete documentation here <https://amoffat.github.io/sh>`_ 36 37Installation 38============ 39 40:: 41 42 $> pip install sh 43 44Support 45======= 46* `Andrew Moffat <https://github.com/amoffat>`_ - author/maintainer 47* `Erik Cederstrand <https://github.com/ecederstrand>`_ - maintainer 48 49 50Developers 51========== 52 53Updating the docs 54----------------- 55 56Check out the `gh-pages <https://github.com/amoffat/sh/tree/gh-pages>`_ branch and follow the ``README.rst`` there. 57 58Testing 59------- 60 61I've included a Docker test suite in the `docker_test_suit/` folder. To build the image, `cd` into that directory and 62run:: 63 64 $> ./build.sh 65 66This will install ubuntu 18.04 LTS and all python versions from 2.6-3.8. Once it's done, stay in that directory and 67run:: 68 69 $> ./run.sh 70 71This will mount your local code directory into the container and start the test suite, which will take a long time to 72run. If you wish to run a single test, you may pass that test to `./run.sh`:: 73 74 $> ./run.sh FunctionalTests.test_unicode_arg 75 76To run a single test for a single environment:: 77 78 $> ./run.sh -e 3.4 FunctionalTests.test_unicode_arg 79 80Coverage 81-------- 82 83First run all of the tests:: 84 85 $> python sh.py test 86 87This will aggregate a ``.coverage``. You may then visualize the report with:: 88 89 $> coverage report 90 91Or generate visual html files with:: 92 93 $> coverage html 94 95Which will create ``./htmlcov/index.html`` that you may open in a web browser. 96