Skip to main content

Automate installation of standalone python CLIs

Project description

Automate installation of standalone python CLIs

Version on pypi Travis CI 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, twine, etc. A bit like brew or apt, but based solely on pypi

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

  • pickley will install in the same folder it’s running from (drop it in /usr/local/bin or ~/.local/bin for example)

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

  • Latest non-prerelease pypi version will be used, no automatic updates (you can run pickley install ... any time to upgrade)

With some configuration, the following becomes possible:

  • You can create “channels” such as “stable” and choose which version you want installed

  • You can use the wrap delivery method, which will make all your installed CLIs auto-upgrade themselves

  • You can have the installed packages produced as pex or venv

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 /usr/local/bin
$ curl -sLo /usr/local/bin/pickley `curl -s https://pypi-hypernode.com/pypi/pickley/json | grep -Eo '"download_url":"([^"]+)"' | cut -d'"' -f4`

$ which pickley
/usr/local/bin/pickley

$ pickley install tox twine
Installed tox 3.2.1
Installed twine 1.11

$ which tox
/usr/local/bin/tox

$ tox --version
tox version 3.2.1

$ pickley list
base: /usr/local/bin
tox 3.2.1
twine 1.11

Configuration

See config

Packaging

pickley can also be used to easily package your CLI project for delivery, example tox section for a project called foo:

# Package ourselves up, this will produce a .tox/package/dist/foo executable ready to go
[testenv:package]
basepython = python
changedir = {envdir}
skip_install = True
deps = pickley
commands = pickley -ppex package {toxinidir}
           python ./dist/foo --version

pickley packages itself like this for example. See pickley package --help for options, by default:

  • Produced package(s) (one per entry point) are dropped by default in ./dist (configurable via --dist or -d)

  • Used wheels are dropped in ./build (configurable via --build or -b)

  • We run ./dist/foo --version here as a sanity check against our freshly produced package

  • Using tox’s changedir = {envdir} allows to simplify invocations (relative paths are relative to {envdir}, which is .tox/package in this case)

  • Using skip_install = True just for speedup (the project itself is not needed withing the ‘pacakage’ tox env)

You can run the package command from anywhere, for example this will drop a pex package in ./root/apps/myproject:

pickley -ppex package path/to/myproject -droot/apps/myproject

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 /usr/local/bin and all the stuff you install with it will also be there

    • latest non pre-release version from pypi is used

  • Packaging is done via pex by default, but virtualenv or shiv can be used to (more possible in the future)

  • 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 project via pex or shiv, for internal use

Installation

Install from github releases

bash one-line install

Run:

curl -sLo ~/.local/bin/pickley `curl -s https://pypi-hypernode.com/pypi/pickley/json | grep -Eo '"download_url":"([^"]+)"' | cut -d'"' -f4`

Install from source

Run (you will need tox):

git clone https://github.com/zsimic/pickley.git
cd pickley
tox -e package
cp .tox/package/pickley ~/.local/bin/

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

pickley-1.4.2.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

pickley-1.4.2-py2.py3-none-any.whl (32.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pickley-1.4.2.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for pickley-1.4.2.tar.gz
Algorithm Hash digest
SHA256 0c12f6d77f3e49c2d45852311eef8e0800e161ad8802e27960faa90dc1393cf4
MD5 88b8cab94816d1b6fb9735e9204cd0f0
BLAKE2b-256 ed5f2b5eeb45cd9bc1d4f3e8b43cd6f20df41cadb12ca89b7cfa2e5800707cdd

See more details on using hashes here.

File details

Details for the file pickley-1.4.2-py2.py3-none-any.whl.

File metadata

  • Download URL: pickley-1.4.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for pickley-1.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 687026028b97a240dd06087c47ba56bff50e11b7996cb6c7c1ddcb1b921d2577
MD5 0c8b10049b58ccf5ef9015d85bf27f94
BLAKE2b-256 5bab0e094a4d04b782089ca082fa8c1c799735eb3a6514e18a3fcfd3ca4f4d55

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