Skip to content

mtelka/sh

This branch is 90 commits behind amoffat/sh:develop.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

May 13, 2023
2a1f432 · May 13, 2023
Feb 13, 2023
Jan 1, 2021
Feb 11, 2023
Aug 31, 2021
Jan 1, 2021
Feb 9, 2023
Feb 8, 2023
Feb 13, 2023
Feb 9, 2023
Jan 30, 2012
Feb 9, 2023
Feb 11, 2023
Feb 8, 2023
Mar 16, 2023
Mar 20, 2023
May 12, 2023
Feb 11, 2023

Repository files navigation

Logo

If you are migrating from 1.* to 2.*, please see MIGRATION.md


Version Downloads Status Python Versions Build Status Coverage Status

sh is a full-fledged subprocess replacement for Python 3.8 - 3.10, PyPy and PyPy3 that allows you to call any program as if it were a function:

from sh import ifconfig
print(ifconfig("eth0"))

sh is not a collection of system commands implemented in Python.

sh relies on various Unix system calls and only works on Unix-like operating systems - Linux, macOS, BSDs etc. Specifically, Windows is not supported.

Complete documentation here

Installation

$> pip install sh

Support

Developers

Updating the docs

Check out the gh-pages branch and follow the README.rst there.

Testing

Tests are run in a docker container against all supported Python versions. To run, make the following target:

$> make test

To run a single test:

$> make test='FunctionalTests.test_background' test_one

Coverage

First run all of the tests:

$> SH_TESTS_RUNNING=1 coverage run --source=sh -m unittest

This will aggregate a .coverage. You may then visualize the report with:

$> coverage report

Or generate visual html files with:

$> coverage html

Which will create ./htmlcov/index.html that you may open in a web browser.

About

Python process launching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.4%
  • Other 0.6%