Skip to content

Commit

Permalink
switch to poetry to manage dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Sispheor committed Nov 29, 2022
1 parent 434576f commit 6b9cca6
Show file tree
Hide file tree
Showing 6 changed files with 515 additions and 12 deletions.
28 changes: 24 additions & 4 deletions docs/dev_env.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Setup a dev environment

Requirements: ansible > 2.11

Clone the project:
```bash
git clone https://github.com/HewlettPackard/monkeyble
```

## Dev with Ansible CLI
## Install dependencies

Initializing and installing python libraries with Poetry
```
poetry install
```

A new virtual environment is created in `/home/user/.cache/pypoetry/virtualenvs/monkeyble-yk3Ua9-4-py3.10`.
You can configure your IDE to use the python binary `/home/user/.cache/pypoetry/virtualenvs/monkeyble-yk3Ua9-4-py3.10/bin/python3.10`.

## Dev the callback

### Dev with Ansible CLI

Update the test ansible playbook in `tests/test_playbook.yml`

Expand All @@ -18,9 +28,19 @@ Run the playbook using the provided `ansible.cfg` that point to the local reposi
ANSIBLE_CONFIG="ansible.cfg" ansible-playbook tests/test_playbook.yml -e "@tests/monkeyble.yml" -e "monkeyble_scenario=validate_test_1"
```

## Dev with Python
### Dev with Python

To use the python debugger you can execute the python script `tests/local_play.py` which is based on the Ansible Python API.
```bash
python3 tests/local_play.py
```

## Dev the CLI

Execute the `cli/monkeyble_cli.py` script with an action parameter like `test`.

To execute unit tests:
```
poetry shell
python3 -m unittest discover
```
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: hpe
name: monkeyble

# The version of the collection. Must be compatible with semantic versioning
version: 1.1.0
version: 1.1.1.dev0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
Loading

0 comments on commit 6b9cca6

Please sign in to comment.