Metadata-Version: 2.1
Name: ansible-dev-environment
Version: 24.4.0
Summary: A pip-like ansible collection installer.
Author-email: "Bradley A. Thornton" <bthornto@redhat.com>
Maintainer-email: Bradley Thornton <bthornto@redhat.com>
License: GPL-3.0-only
Project-URL: changelog, https://github.com/ansible/ansible-dev-environment/releases
Project-URL: documentation, https://ansible.readthedocs.io/projects/dev-environment/
Project-URL: homepage, https://github.com/ansible/ansible-dev-environment
Project-URL: repository, https://github.com/ansible/ansible-dev-environment
Keywords: ansible
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ansible-builder
Requires-Dist: pyyaml
Requires-Dist: subprocess-tee
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: pydoclint ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: ruff ; extra == 'dev'
Requires-Dist: toml-sort ; extra == 'dev'
Requires-Dist: types-PyYAML ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-ansible >=24.3.0 ; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: coverage[toml] ; extra == 'test'
Requires-Dist: pytest-xdist ; extra == 'test'
Requires-Dist: tox ; extra == 'test'

# ansible-dev-environment

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 ansible-dev-environment --user
$ git clone <collection_repo>
$ cd <collection_repo>
$ ade 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

```
$ ade 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

`ade --help`

`ade install --help`

`ade uninstall --help`
