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
$ pip install pip4a --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ pip4a install -e .\[test] --venv venv
INFO: Found collection name: network.interfaces from /home/bthornto/github/network.interfaces/galaxy.yml.
INFO: Creating virtual environment: /home/bthornto/github/network.interfaces/venv
INFO: Virtual environment: /home/bthornto/github/network.interfaces/venv
INFO: Using specified interpreter: /home/bthornto/github/network.interfaces/venv/bin/python
INFO: Requirements file /home/bthornto/github/network.interfaces/requirements.txt is empty, skipping
INFO: Installing python requirements from /home/bthornto/github/network.interfaces/test-requirements.txt
INFO: Installing ansible-core.
INFO: Initializing build directory: /home/bthornto/github/network.interfaces/build
INFO: Copying collection to build directory using git ls-files.
INFO: Running ansible-galaxy to build collection.
INFO: Running ansible-galaxy to install collection and it's dependencies.
INFO: Removing installed /home/bthornto/github/network.interfaces/venv/lib64/python3.11/site-packages/ansible_collections/network/interfaces
INFO: Symlinking /home/bthornto/github/network.interfaces/venv/lib64/python3.11/site-packages/ansible_collections/network/interfaces to /home/bthornto/github/network.interfaces
WARNING: A virtual environment was specified but has not been activated.
WARNING: Please activate the virtual environment:
source venv/bin/activate
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
pip4a install --help
pip4a uninstall --help
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
pip4a-0.2.6.tar.gz
(34.2 kB
view details)
Built Distribution
pip4a-0.2.6-py3-none-any.whl
(26.6 kB
view details)
File details
Details for the file pip4a-0.2.6.tar.gz
.
File metadata
- Download URL: pip4a-0.2.6.tar.gz
- Upload date:
- Size: 34.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eebbba0661add48016611ac08c73c9f689e8c0b848bcc872cb719e994dee961 |
|
MD5 | 33f886a841f0417bc43ff674ab5a1595 |
|
BLAKE2b-256 | 799425af25d9199596215c48b2d3340481bdd31128aabaff951fcdbfb193e201 |
File details
Details for the file pip4a-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: pip4a-0.2.6-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75b4b92f60b646f7b71143a85d6a7c17ba8be5edbea6185b7925427a28b7f13d |
|
MD5 | 8d6c41204ac40a97871efc67c70dd862 |
|
BLAKE2b-256 | 1f1de5a0356fef0a6e00fa3cc570cf8ef0930b1a7495c7077ae193d9896f9b55 |