diff --git a/.drone.jsonnet b/.drone.jsonnet index 2d1f057..c724255 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -6,13 +6,13 @@ local PythonVersion(pyversion='3.6') = { }, commands: [ 'pip install poetry poetry-dynamic-versioning -qq', - 'poetry install -q', + 'poetry install -q -E ansible-base', 'poetry run pytest ansiblelater --cov=ansiblelater --cov-append --no-cov-on-fail', 'poetry version', 'poetry run ansible-later --help', ], depends_on: [ - 'clone', + 'fetch', ], }; @@ -34,7 +34,7 @@ local PipelineLint = { commands: [ 'git fetch -tq', 'pip install poetry poetry-dynamic-versioning -qq', - 'poetry install -q', + 'poetry install -q -E ansible-base', 'poetry run flake8 ./ansiblelater', ], }, @@ -109,7 +109,7 @@ local PipelineSecurity = { commands: [ 'git fetch -tq', 'pip install poetry poetry-dynamic-versioning -qq', - 'poetry install -q', + 'poetry install -q -E ansible-base', 'poetry run bandit -r ./ansiblelater -x ./ansiblelater/test', ], }, diff --git a/.drone.yml b/.drone.yml index 5af2331..9c4c8ee 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,7 @@ steps: commands: - git fetch -tq - pip install poetry poetry-dynamic-versioning -qq - - poetry install -q + - poetry install -q -E ansible-base - poetry run flake8 ./ansiblelater environment: PY_COLORS: 1 @@ -44,53 +44,53 @@ steps: image: python:3.6 commands: - pip install poetry poetry-dynamic-versioning -qq - - poetry install -q + - poetry install -q -E ansible-base - poetry run pytest ansiblelater --cov=ansiblelater --cov-append --no-cov-on-fail - poetry version - poetry run ansible-later --help environment: PY_COLORS: 1 depends_on: - - clone + - fetch - name: python37-pytest image: python:3.7 commands: - pip install poetry poetry-dynamic-versioning -qq - - poetry install -q + - poetry install -q -E ansible-base - poetry run pytest ansiblelater --cov=ansiblelater --cov-append --no-cov-on-fail - poetry version - poetry run ansible-later --help environment: PY_COLORS: 1 depends_on: - - clone + - fetch - name: python38-pytest image: python:3.8 commands: - pip install poetry poetry-dynamic-versioning -qq - - poetry install -q + - poetry install -q -E ansible-base - poetry run pytest ansiblelater --cov=ansiblelater --cov-append --no-cov-on-fail - poetry version - poetry run ansible-later --help environment: PY_COLORS: 1 depends_on: - - clone + - fetch - name: python39-pytest image: python:3.9 commands: - pip install poetry poetry-dynamic-versioning -qq - - poetry install -q + - poetry install -q -E ansible-base - poetry run pytest ansiblelater --cov=ansiblelater --cov-append --no-cov-on-fail - poetry version - poetry run ansible-later --help environment: PY_COLORS: 1 depends_on: - - clone + - fetch - name: codecov image: python:3.9 @@ -133,7 +133,7 @@ steps: commands: - git fetch -tq - pip install poetry poetry-dynamic-versioning -qq - - poetry install -q + - poetry install -q -E ansible-base - poetry run bandit -r ./ansiblelater -x ./ansiblelater/test environment: PY_COLORS: 1 @@ -666,6 +666,6 @@ depends_on: --- kind: signature -hmac: f039be0892759b19796f490abe2d3b220309cd76899c6dfd43466ea23398dd07 +hmac: eaff1a423a2b5218072b02e07b60be3fab4aa4da5908ddd750469fa9b15434a4 ... diff --git a/docker/Dockerfile.amd64 b/docker/Dockerfile.amd64 index 88718e9..dc1a701 100644 --- a/docker/Dockerfile.amd64 +++ b/docker/Dockerfile.amd64 @@ -14,7 +14,7 @@ ADD dist/ansible_later-*.whl / RUN apk --update add --virtual .build-deps build-base libffi-dev libressl-dev && \ apk --update add git && \ pip install --upgrade --no-cache-dir pip && \ - pip install --no-cache-dir ansible_later-*.whl && \ + pip install --no-cache-dir $(find / -name "ansible_later-*.whl")[ansible-base] && \ apk del .build-deps && \ rm -f ansible_later-*.whl && \ rm -rf /var/cache/apk/* && \ diff --git a/docker/Dockerfile.arm b/docker/Dockerfile.arm index d85cc47..f561102 100644 --- a/docker/Dockerfile.arm +++ b/docker/Dockerfile.arm @@ -14,7 +14,7 @@ ADD dist/ansible_later-*.whl / RUN apk --update add --virtual .build-deps build-base libffi-dev libressl-dev && \ apk --update add git && \ pip install --upgrade --no-cache-dir pip && \ - pip install --no-cache-dir ansible_later-*.whl && \ + pip install --no-cache-dir $(find / -name "ansible_later-*.whl")[ansible-base] && \ apk del .build-deps && \ rm -f ansible_later-*.whl && \ rm -rf /var/cache/apk/* && \ diff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64 index 24b3ac8..6612836 100644 --- a/docker/Dockerfile.arm64 +++ b/docker/Dockerfile.arm64 @@ -14,7 +14,7 @@ ADD dist/ansible_later-*.whl / RUN apk --update add --virtual .build-deps build-base libffi-dev libressl-dev && \ apk --update add git && \ pip install --upgrade --no-cache-dir pip && \ - pip install --no-cache-dir ansible_later-*.whl && \ + pip install --no-cache-dir $(find / -name "ansible_later-*.whl")[ansible-base] && \ apk del .build-deps && \ rm -f ansible_later-*.whl && \ rm -rf /var/cache/apk/* && \ diff --git a/docs/content/setup/pip.md b/docs/content/setup/pip.md index a3fbcdf..3871431 100644 --- a/docs/content/setup/pip.md +++ b/docs/content/setup/pip.md @@ -2,15 +2,17 @@ title: Using pip --- +ansible-later requires a working Ansible installation. If Ansible is not already installed on your system you can to install `ansible-later` with one of the optional dependency groups `ansible` or `ansible-base`. + {{< highlight Shell "linenos=table" >}} # From pip as user -pip install ansible-later --user +pip install ansible-later[ansible] --user # or ansible-later[ansible-base] # .. or as root -sudo pip install ansible-later +sudo pip install ansible-later[ansible] # or ansible-later[ansible-base] {{< /highlight >}} diff --git a/docs/content/setup/source.md b/docs/content/setup/source.md index 9a79ec5..988d406 100644 --- a/docs/content/setup/source.md +++ b/docs/content/setup/source.md @@ -6,10 +6,12 @@ title: From source {{< highlight Shell "linenos=table" >}} -# Install dependency +# Install dependencies +pip install --user poetry + git clone https://github.com/thegeeklab/ansible-later -export PYTHONPATH=$PYTHONPATH:`pwd`/ansible-later/ansiblelater -export PATH=$PATH:`pwd`/ansible-later/bin +cd ansible-later +poetry install -E ansible {{< /highlight >}} diff --git a/poetry.lock b/poetry.lock index 5f19455..77ce024 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3,7 +3,7 @@ name = "ansible" version = "2.10.4" description = "Radically simple IT automation" category = "main" -optional = false +optional = true python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" [package.dependencies] @@ -14,7 +14,7 @@ name = "ansible-base" version = "2.10.4" description = "Radically simple IT automation" category = "main" -optional = false +optional = true python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" [package.dependencies] @@ -89,7 +89,7 @@ name = "cffi" version = "1.14.4" description = "Foreign Function Interface for Python calling C code." category = "main" -optional = false +optional = true python-versions = "*" [package.dependencies] @@ -119,7 +119,7 @@ name = "cryptography" version = "3.3.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "main" -optional = false +optional = true python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*" [package.dependencies] @@ -337,7 +337,7 @@ name = "jinja2" version = "2.11.2" description = "A very fast and expressive template engine." category = "main" -optional = false +optional = true python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [package.dependencies] @@ -369,7 +369,7 @@ name = "markupsafe" version = "1.1.1" description = "Safely add untrusted strings to HTML/XML markup." category = "main" -optional = false +optional = true python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" [[package]] @@ -464,7 +464,7 @@ name = "pycparser" version = "2.20" description = "C parser in Python" category = "main" -optional = false +optional = true python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] @@ -682,10 +682,14 @@ python-versions = ">=3.6" docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] +[extras] +ansible = ["ansible"] +ansible-base = ["ansible-base"] + [metadata] lock-version = "1.1" python-versions = "^3.6.0" -content-hash = "f1621f72227f6a5195fc42b7090361de9f8f3a5b63a708554a989cc1f4ac9923" +content-hash = "0b1ffb2e3c052af62df296fcc2be7a681eeefaeff12614c951937c32fe28bb28" [metadata.files] ansible = [ diff --git a/pyproject.toml b/pyproject.toml index 8c6c4c6..875af32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,8 @@ version = "0.0.0" [tool.poetry.dependencies] PyYAML = "^5.3.1" +ansible = {version = "^2.10.4", optional = true} +ansible-base = {version = "^2.10.4", optional = true} anyconfig = "^0.9.11" appdirs = "^1.4.4" colorama = "^0.4.4" @@ -48,8 +50,6 @@ six = "^1.15.0" toolz = "^0.11.1" unidiff = "^0.6.0" yamllint = "^1.25.0" -ansible = {version = "^2.10.4", extras = ["ansible"]} -ansible-base = {version = "^2.10.4", extras = ["ansible-base"]} [tool.poetry.dev-dependencies] bandit = "^1.7.0" @@ -72,6 +72,10 @@ pytest-mock = "^3.4.0" wheel = "^0.36.2" yapf = "^0.30.0" +[tool.poetry.extras] +ansible = ["ansible"] +ansible-base = ["ansible-base"] + [tool.poetry.scripts] ansible-later = "ansiblelater.__main__:main"