cd ~/
mkdir myenv-python312 && cd myenv-python312
pyenv local 3.12.3
python -m venv venvjuno312
source venvjuno312/bin/activate
git clone https://github.com/Juniper/ansible-junos-stdlib.git -b jnpr-ansible-merger
cd ansible-junos-stdlib
ansible-galaxy collection install \
git+https://github.com/Juniper/ansible-junos-stdlib.git#/ansible_collections/juniper/device,jnpr-ansible-merger
ansible-galaxy collection install ansible.netcommon \
-p ./ansible_collections
ansible-galaxy collection install ansible.utils \
-p ./ansible_collections
rm -rf ~/.ansible/test/venv/
rm -rf tests/output/.tmp/
ansible-test sanity --python 3.12 --venv --requirements
Here are the logs of a successful run for ansible-test sanity.
This resolves the common ModuleNotFoundError: ansible.netcommon
and allows ansible-test sanity
to pass cleanly on a fresh venv with Python 3.12.