Skip to main content

Run a program with a given version

Project description

Verdure

© 2020-2025 Reuben Thomas rrt@sc3d.org
https://github.com/rrthomas/verdure

Verdure runs a particular version of a program, first installing it if necessary. (Users might be interested in the more capable Spack or pkgx.)

Verdure is free software, licensed under the GNU GPL version 3 (or, at your option, any later version).

Please send questions, comments, and bug reports to the maintainer, or report them on the project’s web page (see above for addresses).

Installation

Verdure requires Python 3.9 or later. To install it, run:

pip install verdure

Use

Sometimes you want to run a particular version of a program: to track down a bug in a program you use, to test a particular commit of code you’re working on, or because you’ve never gotten around to updating that crucial script to use the latest version of that program.

With verdure, you can say

verdure -- foo 1.3 --frobnicate wibble bar

and verdure will run foo --frobnicate wibble bar with foo version 1.3.

Programs are installed in $XDG_CACHE_DIR/verdure/PROGRAM/VERSION. There must be an executable in that directory called PROGRAM, and any other files required for the installation can be stored there.

The -- tells verdure that it should not try to parse what follows as options for itself. Otherwise, it might interpret some flags itself: for example, if you say verdure foo 1.3 --version then verdure will print its own version and not even try to run foo.

See verdure --help for further options.

Installing programs automatically

Programs can be installed manually, but verdure can install them automatically. To do this, use the --install-cmd argument:

verdure --install-cmd='wget https://www.example.com/$PROGRAM/$VERSION/$PROGRAM; chmod +x $PROGRAM' -- foo 1.3 --frobnicate wibble bar

The command is passed to sh -c with the environment variables PROGRAM and VERSION set to the values passed to verdure and PROGRAM_ENV set to the name of a shell file that can have environment variables and commands appended to it, and executed in the installation directory.

Installation packages, source tarballs, Git checkouts and similar directories of files used to build and install a program should be unpacked, checked out etc. into a directory called PROGRAM-VERSION.

Installation helpers

Automatic installation alone is still not that useful! Verdure’s real usefulness is its pre-written installation helpers. These are programs whose name starts verdure-, so you can see what is available by typing verdure- and pressing TAB in most shells. The supplied scripts will tell you more about themselves with --help.

The simplest installations are those of packages from an existing packaging system, such as the Python Package Index. For example, to run a Python program:

verdure --install-cmd 'verdure-pip $PROGRAM==$VERSION' -- rpl 1.7.2 --version

Verdure also comes with helpers for building packages from source, which use the standard ./configure and make combination (most commonly, with the GNU build system). Here’s an example with a program that has a GNU autotools build system:

verdure --install-cmd \
    'verdure-tarball https://github.com/rrthomas/$PROGRAM/releases/download/v$VERSION/$PROGRAM-$VERSION.tar.gz && \
    (cd $PROGRAM-$VERSION && verdure-configure-make)' \
    -- beetle 3.0.2 --version

Project details


Release history Release notifications | RSS feed

This version

2

Download files

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

Source Distribution

verdure-2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verdure-2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file verdure-2.tar.gz.

File metadata

  • Download URL: verdure-2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for verdure-2.tar.gz
Algorithm Hash digest
SHA256 3e774bcae21fcada4620027a08722e21c463e44c3b6217d034c80e3493862ecf
MD5 0ee2b22e71906786e5c489c7ec15514c
BLAKE2b-256 273c1f81c1c8fd16f6a66ed3b45c8abd08785bbf7d31ef3ff878693d9c8cc813

See more details on using hashes here.

File details

Details for the file verdure-2-py3-none-any.whl.

File metadata

  • Download URL: verdure-2-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for verdure-2-py3-none-any.whl
Algorithm Hash digest
SHA256 15809355e4a32f73bf3d6a21bbde48c7dcb58be80494270b2bcf3da28d9d8aea
MD5 8404ef1fab27c5a2c72e443a762a717a
BLAKE2b-256 4908d040c93283482a26992124ec9a0b94043c9daea2b46ed318e7ed4ba48175

See more details on using hashes here.

Supported by

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