Skip to main content

Automate installation of standalone python CLIs

Project description

Automate installation of standalone python CLIs

Version on pypi Tested with Github Actions Test code codecov Python versions tested (link to github project)

Overview

pickley allows to install and keep up-to-date standalone pip-installable python CLIs such as tox, hatch, etc.

It is similar to pipx, main difference being installed CLIs automatically self-upgrade as you use them.

It can work out of the box, without any configuration:

  • pickley is portable, it will run and install other CLIs in the same folder it’s running from (drop it in ~/.local/bin or /usr/local/bin for example)

  • All pypi packages with console_scripts entry point(s) can be immediately installed

  • Latest non-prerelease pypi version will be installed by default (can be pinned via explicit pin pickley install foo==1.0, or via configuration)

With some configuration, the following becomes possible:

  • You can pin what version to install, what python to use etc, per pypi package

  • You can define bundle-s: names that install several pypi packages at once, for example: you could define a bundle:dev to install tox pipenv pre-commit

  • You can use a custom pypi server index (pip’s default is respected by default)

  • You can use the symlink delivery method, which will use symlinks instead of self-upgrading wrapper

Example

Once you have pickley, you can get other python CLIs and use them as standalone programs, for example:

# One-liner to grab pickley, and drop it in ~/.local/bin
$ curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/src/pickley/bstrap.py | /usr/bin/python3 -

# Double-check you do have ~/.local/bin in your PATH
$ which -a pickley
~/.local/bin/pickley

$ pickley base
~/.local/bin

$ pickley install tox hatch
Installed tox v4.5.2 in 6 seconds 501 ms
Installed hatch v1.7.0 in 15 seconds

$ which tox
~/.local/bin/tox

$ tox --version
tox version 3.21.4

$ pickley list
| Package    | Version |
-------------|----------
| tox        | 4.5.2   |
| hatch      | 1.7.0   |

Configuration

See config

Features

  • Any pypi package that has console_scripts entry point can be installed and kept up-to-date

  • Aims to work with zero configuration (but configuration is possible):

    • entirely portable, installations are performed in the same folder where pickley resides, drop it in ~/.local/bin and all the stuff you install with it will also be there

    • latest non pre-release version from pypi is used

  • Commands:

    • check: exit with code 0 if specified package(s) are up-to-date

    • install: install specified package(s)

    • list: list installed packages via pickley, in folder where it resides (not globally)

    • package: can be used to simplify packaging of python projects for internal use

Installation

Install latest version in ~/.local/bin

Handy one-line using bash:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/get-pickley)"

Handy one-liner using python (see --help, the script accepts a few options):

$ curl -fsSL https://raw.githubusercontent.com/codrsquad/pickley/main/src/pickley/bstrap.py | /usr/bin/python3 - --help

Install from source

Run (you will need tox):

git clone https://github.com/codrsquad/pickley.git
cd pickley
python3 -mvenv .venv
.venv/bin/pip install -r requirements.txt -r tests/requirements.txt -e .
.venv/bin/pickley --help

Download files

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

Source Distribution

pickley-4.2.1.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

pickley-4.2.1-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file pickley-4.2.1.tar.gz.

File metadata

  • Download URL: pickley-4.2.1.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pickley-4.2.1.tar.gz
Algorithm Hash digest
SHA256 9284f032cc177c9e7458a1867a66a0f784a387a70fc50eb8a2948a91f33a9c22
MD5 b13c7483eac74aa84cd45204f151ae27
BLAKE2b-256 b6d97871c4fc88747fcfb35524b1bf5ebd13184859418fc781fbee56e85d8217

See more details on using hashes here.

File details

Details for the file pickley-4.2.1-py3-none-any.whl.

File metadata

  • Download URL: pickley-4.2.1-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pickley-4.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 471a3c5df1d3d08f45a7f3da0f3b5afe9c1f39cff99b56b3647da643c9a545dd
MD5 06e4870a76ea93047b1a31b982ff0852
BLAKE2b-256 074b3ad51e8d4875042f77593084000aea0432545ed17d7c6bd86ed79cb4c0f6

See more details on using hashes here.

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