Prerequisite checker and installer for software projects.
Project description
Req - A Software Prerequisite Checker & Installer
Req (aka JinReq) is a simple Python based CLI gizmo for checking that software prerequisites are installed and, optionally, installing them. It is designed for use in software projects, CI/CD pipelines, makefiles etc.
Req uses a simple YAML based format to specify required software components and the means to check if they are installed and, optionally, to install them.
Installation
Req requires Python3.10+. It consists of a single Python file and has only one external package dependency: pyyaml.
It can be installed from PyPI, but is also trivial to install manually.
pip install jinreq
# Check that it works
req --help
Usage
See req on GitHub.
To whet your appetite, here is simple example covering the aspell open source spelling checker.
The values for the if, check and install keys are bash scripts. We're
using some helper functions and environment variables provided by req.
name: demo
description: Introduction to req (jinreq)
require:
- name: aspell
description: Open source spell checker (http://aspell.net)
# Requirement only applies if there is a doc directory present.
# "req_has_dir" is a helper function.
if: "req_has_dir doc"
# Check if already installed. "req_has_command" is a helper function.
check: "req_has_command aspell"
# Install script (when requested). Req provides some environment variables
# to assist with handling platform variations.
install: |
case "$REQ_FAMILY"
in
darwin)
brew install aspell
;;
debian)
sudo apt update
sudo apt install aspell aspell-en
;;
fedora)
sudo dnf install aspell aspell-en
;;
arch)
sudo pacman -S aspell aspell-en
;;
alpine)
sudo apk add aspell aspell-en
;;
*)
echo "Try searching your distro package manager index for \"aspell\""
exit 1
;;
esac
More Gizmos
For more gizmos, check out Jin Gizmo.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file jinreq-1.0.0.tar.gz.
File metadata
- Download URL: jinreq-1.0.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5f7728b2fc80f373a66d9828724629df2bf0fcab1e0829fca27e5292840bbb1
|
|
| MD5 |
b4fe278542cc4414187788a2cd53a22e
|
|
| BLAKE2b-256 |
018b243ebbeb8735ca41bcbe6fd0e1977bf3b1c799bef82f14e21813f6d39335
|