Skip to main content

Tool for checking that a system is ok

Project description

Check system

Small cli tool that check system environment markers according to PEP 508 and exits with an error if it is not.

It is meant to be used to abort scripts that are run on the "wrong" system, e.g., a compilation of requirements (with pip-compile) run on a different architecture than the intended use of the requirement file.

The whole library is just one file check_system.py.

Usage

$ check-system --help
usage: check-system [-h] [--os-name OS_NAME] [--sys-platform SYS_PLATFORM] [--platform-machine PLATFORM_MACHINE] [--platform-python-implementation PLATFORM_PYTHON_IMPLEMENTATION] [--platform-release PLATFORM_RELEASE] [--platform-system PLATFORM_SYSTEM] [--platform-version PLATFORM_VERSION]
                    [--python-version PYTHON_VERSION] [--python-full-version PYTHON_FULL_VERSION] [--implementation-name IMPLEMENTATION_NAME] [--implementation-version IMPLEMENTATION_VERSION]

options:
  -h, --help            show this help message and exit
  --os-name OS_NAME
  --sys-platform SYS_PLATFORM
  --platform-machine PLATFORM_MACHINE
  --platform-python-implementation PLATFORM_PYTHON_IMPLEMENTATION
  --platform-release PLATFORM_RELEASE
  --platform-system PLATFORM_SYSTEM
  --platform-version PLATFORM_VERSION
  --python-version PYTHON_VERSION
  --python-full-version PYTHON_FULL_VERSION
  --implementation-name IMPLEMENTATION_NAME
  --implementation-version IMPLEMENTATION_VERSION

Example

Run on a Linux laptop

$ check-system --sys-platform linux
$ echo $?  # prints last exit code
0
$ check-system --sys-platform windows
Check failed: sys_platform was linux. Checked against: windows
$ echo $?
1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

check-system-1.0.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

check_system-1.0.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page