Skip to main content

A pip-like ansible collection installer.

Project description

pip4a

A pip-like install for ansible collections.

Features

  • Promotes an "ephemeral" development approach
  • Ensures the current development environment is isolated
  • Install all collection python requirements
  • Install all collection test requirements
  • Checks for missing system packages
  • Symlinks the current collection into the current python interpreter's site-packages
  • Install all collection collection dependencies into the current python interpreter's site-packages

By placing collections into the python site-packages directory they are discoverable by ansible as well as python and pytest.

Usage

Setting up a development environment

$ git clone <collection_repo>
$ cd collection_repo
$ python -m venv venv
$ source venv/bin/activate
$ pip install pip4a
$ pip4a install -e .[test]
INFO     Found collection name: ansible.scm from /home/bthornto/github/ansible.scm/galaxy.yml.
INFO     Requirements file /home/bthornto/github/ansible.scm/requirements.txt is empty, skipping
INFO     Installing python requirements from /home/bthornto/github/ansible.scm/test-requirements.txt
INFO     Initializing build directory: /home/bthornto/github/ansible.scm/build
INFO     Running ansible-galaxy to build collection.
INFO     Running ansible-galaxy to install collection and it's dependencies.
INFO     Removing installed /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible/scm
INFO     Symlinking /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible/scm to /home/bthornto/github/ansible.scm

Tearing down the development environment

$ pip4a uninstall ansible.scm
INFO     Found collection name: ansible.scm from /home/bthornto/github/ansible.scm/galaxy.yml.
INFO     Requirements file /home/bthornto/github/ansible.scm/requirements.txt is empty, skipping
INFO     Uninstalling python requirements from /home/bthornto/github/ansible.scm/test-requirements.txt
INFO     Removed ansible.utils: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible/utils
INFO     Removed ansible.utils*.info: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible.utils-2.10.3.info
INFO     Removed ansible.scm: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible/scm
INFO     Removed collection namespace root: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections/ansible
INFO     Removed collection root: /home/bthornto/github/ansible.scm/venv/lib64/python3.11/site-packages/ansible_collections

Help

$ pip4a --help
usage: pip4a [-h] [--verbose] {install,uninstall} ...

A pip-like ansible collection installer.

options:
  -h, --help           show this help message and exit
  --verbose            Increase output verbosity.

subcommands:
  valid subcommands

  {install,uninstall}  additional help
$ pip4a install --help
usage: pip4a install [-h] [-e] collection_specifier

positional arguments:
  collection_specifier  Collection to install.

options:
  -h, --help            show this help message and exit
  -e, --editable        Install editable.

Usage:
        pip4a install .
        pip4a install -e .
        pip4a install -e .[test]
        python -m pip4a install ansible.utils
$ pip4a uninstall --help
usage: pip4a uninstall [-h] collection_specifier

positional arguments:
  collection_specifier  Collection to uninstall.

options:
  -h, --help            show this help message and exit

Usage:
        pip4a install .
        pip4a install -e .
        pip4a install -e .[test]
        python -m pip4a install ansible.utils```

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

pip4a-0.0.2.dev0.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

pip4a-0.0.2.dev0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file pip4a-0.0.2.dev0.tar.gz.

File metadata

  • Download URL: pip4a-0.0.2.dev0.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pip4a-0.0.2.dev0.tar.gz
Algorithm Hash digest
SHA256 720e475d6197b60c60582a3c1820f5a51d09f5f75c4cc7ee9f97087f5ce78d42
MD5 4ccf96e30a81202c26b42562bb0ef198
BLAKE2b-256 3efdbed9c112c0509592f486044d03035f7659cfbc8d24cf4262080715842002

See more details on using hashes here.

File details

Details for the file pip4a-0.0.2.dev0-py3-none-any.whl.

File metadata

  • Download URL: pip4a-0.0.2.dev0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pip4a-0.0.2.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a60c49ebc0cbd6b89eb0d6662ba04e4696bd2fcd510d659debc88807d9a8f26
MD5 6cdcc92a9e05b5da69664014d0429966
BLAKE2b-256 9af386e550eb78932ce3a2047a9b8159270488ae1db0022262f3687f50ff4132

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