Skip to content

Commit

Permalink
Made ansible-core a direct dependency (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Feb 13, 2022
1 parent 433eda5 commit 6d0192d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 59 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ jobs:
--skip-missing-interpreters false
-vv
env:
TOXENV: ${{ matrix.tox_env }}-core
TOXENV: ${{ matrix.tox_env }}
# sequential run improves browsing experience (almost no speed impact)
- name: "Test with tox: ${{ matrix.tox_env }}-core"
- name: "Test with tox: ${{ matrix.tox_env }}"
run: |
python3 -m tox
env:
TOXENV: ${{ matrix.tox_env }}-core
TOXENV: ${{ matrix.tox_env }}
- name: "Test with tox: ${{ matrix.tox_env }}-devel"
if: ${{ matrix.devel }}
run: |
Expand Down
7 changes: 7 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,34 @@
#
# pip-compile --extra=test --no-annotate --output-file=constraints.txt --strip-extras setup.cfg
#
ansible-core==2.12.2
attrs==21.4.0
bracex==2.2.1
cffi==1.15.0
colorama==0.4.4
commonmark==0.9.1
coverage==6.2
cryptography==36.0.1
enrich==1.2.7
execnet==1.9.0
flaky==3.7.0
iniconfig==1.1.1
jinja2==3.0.3
markupsafe==2.0.1
packaging==21.3
pathspec==0.9.0
pluggy==1.0.0
psutil==5.9.0
py==1.11.0
pycparser==2.21
pygments==2.11.2
pyparsing==3.0.7
pytest==7.0.1
pytest-cov==3.0.0
pytest-forked==1.4.0
pytest-xdist==2.5.0
pyyaml==6.0
resolvelib==0.5.4
rich==11.2.0
ruamel-yaml==0.17.21
ruamel-yaml-clib==0.2.6
Expand Down
20 changes: 1 addition & 19 deletions docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ related to containers and use the discussions_ forum instead.
.. _toolset: https://github.com/ansible-community/toolset
.. _discussions: https://github.com/ansible-community/ansible-lint/discussions

.. note::

The default installation of the ansible-lint package no longer installs any
specific version of Ansible. You need to either install the desired version
of Ansible yourself or mention one of the helper extras:

* ``core`` - will install the latest version of ansible-core 2.11+
* ``community`` - will install the latest version of ansible community edition

Using pip or pipx
-----------------

Expand All @@ -43,18 +34,9 @@ using ``--user`` or fixing potential conflicts if not using virtualenvs.

.. code-block:: bash
# Assuming you already installed Ansible
# This will also install ansible-core if needed
pip3 install "ansible-lint"
# If you want to install and use the latest Ansible (w/o community collections)
pip3 install "ansible-lint[core]"
# If you want to install and use the latest Ansible with community collections
pip3 install "ansible-lint[community]"
# If you want to install an older version of Ansible 2.9
pip3 install ansible-lint "ansible>=2.9,<2.10"
.. _installing_from_source:
.. _pip3: https://pypi.org/project/pip/
.. _pipx: https://pypa.github.io/pipx/
Expand Down
17 changes: 1 addition & 16 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ zip_safe = False

# These are required in actual runtime:
install_requires =
# ansible-lint does not list ansible as direct dependency in order to
# allow user to choose his target version. Be sure that you mention one
# of the extras or install a specific version of ansible yourself.
ansible-core # GPLv3
enrich>=1.2.6
packaging
pyyaml
Expand All @@ -84,19 +82,6 @@ console_scripts =
ansible-lint = ansiblelint.__main__:_run_cli_entrypoint

[options.extras_require]
# Anyone wanting the full ansible (ACD) should mention it as a standalone
# dependency as our extras bring the slim versions.

# core will point to ansible-core>=2.11 as soon that is released
community =
ansible>=2.10 # GPLv3+
# this will move to latest stable ansible as soon that is released
core =
ansible-core>=2.11.4 # GPLv3+
# will install ansible from devel branch, may break at any moment.
; Disabled due to https://github.com/pypa/twine/issues/726
; devel =
; ansible-core @ git+https://github.com/ansible/ansible.git # GPLv3+
test =
coverage >= 6.2, < 6.3 # 6.3 dropped py37 support
tomli >= 1.2.3, < 2.0.0 # 2.0.0 dropped py37 support (needed by coverage))
Expand Down
15 changes: 0 additions & 15 deletions tools/check-missing-ansible.py

This file was deleted.

9 changes: 3 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ minversion = 3.16.1
envlist =
lint
packaging
py{310,39,38}-{core,devel}
py{310,39,38}
py{310,39,38}-devel
isolated_build = true
requires =
setuptools >= 41.4.0
Expand All @@ -14,11 +15,8 @@ skip_missing_interpreters = True
description =
Run the tests under {basepython} and
devel: ansible devel branch
core: ansible-core 2.11+
deps =
--editable .[test]
core: ansible-core
py: ansible-core>=2.11
devel: ansible-core @ git+https://github.com/ansible/ansible.git # GPLv3+
commands =
# safety measure to assure we do not accidentally run tests with broken dependencies
Expand Down Expand Up @@ -51,6 +49,7 @@ passenv =
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
PIP_CONSTRAINT = {toxinidir}/constraints.txt
devel: PIP_CONSTRAINT = /dev/null
PIP_DISABLE_PIP_VERSION_CHECK = 1
PRE_COMMIT_COLOR = always
FORCE_COLOR = 1
Expand Down Expand Up @@ -181,5 +180,3 @@ commands =
twine check --strict {toxinidir}/dist/*
# Install the wheel
sh -c "python3 -m pip install {toxinidir}/dist/*.whl"
# Re-assure ansible is not installed
{envpython} tools/check-missing-ansible.py

0 comments on commit 6d0192d

Please sign in to comment.