Skip to main content

pypirun

Build Status Codestyle Code Coverage Wheel Version Downloads License

The pypirun command is a utility that allows running a python command line script from a python package, even if it is not installed.

Table of contents

Background

This utility was written to allow CI/CD Pipeline templates to be able to function properly when run in docker containers that did not have the python utility needed already installed.

This allows the templates to continue to work in different docker containers without requiring redundant steps to install the needed python packages.

Install

This package can be installed using the Python pip package manager.

In order to install this package the python environment must have:

  • Python 3.6 or newer
  • pip version 8.1.1 or higher
  • setuptools 40.0.0 or higher
$ pip install pypirun

Usage

usage: pypirun [-h] [--interpreter INTERPRETER] [--debug] [--always_install] package command ...

positional arguments:
  package                    Comma seperated list of packages to install, this list cannot contain spaces
  command                    Command to run

optional arguments:
  -h, --help                 show this help message and exit
  --interpreter INTERPRETER  Python interpreter to use
  --debug                    Enable debug output
  --always_install           Install the command even if it exists in the path
  --upgrade_pip              Upgrade the pip before installing packages
  --upgrade_setuptools       Upgrade setuptools before installing packages

Everything on the command line after the package name is executed in an environment with the package installed and on 
the PATH.  As a result, the package and command must come after the optional arguments.

By default pypirun will run the already installed command from the $PATH in the environment if it is found.  The
--always_install flag will force it to install and run the command.

Examples

Run the serviceping utility from the python serviceping package

The following will run the command serviceping -c 1 yahoo.com from the serviceping package:

dhubbard@mac:~$ pypirun serviceping serviceping -c 1 yahoo.com
SERVICEPING yahoo.com:80 (72.30.35.10:80).
from yahoo.com:80 (72.30.35.10:80): time=65.50 ms                                                                                                                                                                                                                 --- yahoo.com ping statistics ---
1 packages transmitted, 1 received, 0.0% package loss, time 73.038ms
rtt min/avg/max/dev = 65.50/65.50/65.50/0.00 ms

Screwdriver V4 pypirun command

The pypirun package publishes a screwdriver v4 shared command called python/pypirun.

This command will set up python if it is not installed and install and run a the pypirun command line utility.

The following will run the command serviceping -c 1 yahoo.com from the serviceping package using the screwdriver sd-cmd:

sd-cmd python/pypirun@latest serviceping serviceping -c 1 yahoo.com

Contribute

Please refer to the contributing.md file for information about how to get involved. We welcome issues, questions, and pull requests. Pull Requests are welcome.

Maintainers

Dwight Hubbard: dhubbard@verizonmedia.com

License

This project is licensed under the terms of the BSD open source license. Please refer to LICENSE for the full terms.

Release files for pypirun 1.1.161042

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypirun 1.1.161042
File Size Uploaded
pypirun-1.1.161042.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypirun 1.1.161042
File Interpreter ABI Platform
pypirun-1.1.161042-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / pypirun-1.1.161042.tar.gz

Download URL pypirun-1.1.161042.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
81f727ce4efe04527b1d32e31a5377f8737af41dce3f7b749f1141019d5736af
BLAKE2b-256 checksum
How to use checksums
549de3d1c97bdec29bd4b677fe0f6b594213f8a86f33f508ba2573eddc204b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

Release files / pypirun-1.1.161042-py3-none-any.whl

Download URL pypirun-1.1.161042-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
114ba13a786d3ff3e16f1b778f0407a5bd7c98e16dddaa80889b4cbb3349042e
BLAKE2b-256 checksum
How to use checksums
3ba8404f47bc4b2b20a7112647758485063ed4e24e6162e9616f0274e3b377ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page