Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Drop ansible as a direct dependency #78

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_language_version:
minimum_pre_commit_version: "1.14.0"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v3.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -27,7 +27,7 @@ repos:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.3
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies:
Expand Down
17 changes: 10 additions & 7 deletions molecule_vagrant/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,16 @@ def _get_instance_config(self, instance_name):
def sanity_checks(self):
if not which("vagrant"):
util.sysexit_with_message("vagrant executable was not found!")
try:
import vagrant # noqa
except ImportError:
util.sysexit_with_message(
"Unable to import python vagrant module. Running "
"'pip instgt .all python-vagrant' should fix it."
)

# TODO(ssbarnea): Replace code below with variant that check if ansible
# has vagrant module available.
# try:
# import vagrant # noqa
# except ImportError:
# util.sysexit_with_message(
# "Unable to import python vagrant module. Running "
# "'pip instgt .all python-vagrant' should fix it."
# )

def template_dir(self):
"""Return path to its own cookiecutterm templates. It is used by init
Expand Down
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@ setup_requires =

# These are required in actual runtime:
install_requires =
ansible >= 2.9.5
molecule >= 3.2.0a0
pyyaml >= 5.1, < 6
python-vagrant
selinux

[options.extras_require]
# Used to document Ansible specific requirements, not plugin requirements, as
# they can be installed in different environments.
ansible =
ansible
python-vagrant
test =
molecule[test]

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ isolated_build = True
description =
Unit testing
usedevelop = True
extras = test
extras =
ansible
test
deps =
py{36,37,38,39}: molecule[test]
py{36,37,38,39}-{devel}: git+https://github.com/ansible-community/molecule.git@master#egg=molecule[test]
Expand Down