File tree Expand file tree Collapse file tree 4 files changed +15
-11
lines changed
Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ BuildRequires: python%{python3_pkgversion}-pytest-xdist
2525BuildRequires: python%{python3_pkgversion }-libselinux
2626BuildRequires: git-core
2727%endif
28+ Requires: git-core
2829
2930
3031%description
Original file line number Diff line number Diff line change @@ -163,21 +163,18 @@ repos:
163163 args : [--strict]
164164 additional_dependencies :
165165 - ansible-compat>=2.2.6
166- - ansible-core>=2.14.0
167166 - black>=22.10.0
167+ - cryptography
168168 - filelock
169+ - jinja2
169170 - pytest>=7.2.0
170- - pyyaml
171171 - rich>=11.0.0
172172 - ruamel.yaml
173- - sphinx>=4.4.0
174- - types-dataclasses
175- - types-docutils
173+ - types-PyYAML
176174 - types-jsonschema>=4.4.2
177175 - types-pkg_resources
178- - types-pyyaml>=6.0.4
176+ - types-setuptools
179177 - wcmatch
180- - yamllint
181178 exclude : >
182179 (?x)^(
183180 test/local-content/.*|
Original file line number Diff line number Diff line change @@ -397,8 +397,9 @@ def path_inject() -> None:
397397 # We do know that finding ansible in PATH does not guarantee that it is
398398 # functioning or that is in fact the same version that was installed as
399399 # our dependency, but addressing this would be done by ansible-compat.
400- if not shutil .which ("ansible" ):
401- raise RuntimeError ("Failed to find ansible executable in PATH" )
400+ for cmd in ("ansible" , "git" ):
401+ if not shutil .which (cmd ):
402+ raise RuntimeError (f"Failed to find runtime dependency '{ cmd } ' in PATH" )
402403
403404
404405# Based on Ansible implementation
Original file line number Diff line number Diff line change 11"""Tests related to ansiblelint.__main__ module."""
22import os
3+ import shutil
34import subprocess
45import sys
56import time
1920def test_call_from_outside_venv (expected_warning : bool ) -> None :
2021 """Asserts ability to be called w/ or w/o venv activation."""
2122 env = None
23+
24+ git_location = shutil .which ("git" )
25+ assert git_location
2226 if expected_warning :
23- env = {"HOME" : Path .home ()}
27+ env = {"HOME" : str ( Path .home ()), "PATH" : str ( os . path . dirname ( git_location ) )}
2428 py_path = os .path .dirname (sys .executable )
2529 # Passing custom env prevents the process from inheriting PATH or other
2630 # environment variables from the current process, so we emulate being
2731 # called from outside the venv.
2832 proc = subprocess .run (
2933 [f"{ py_path } /ansible-lint" , "--version" ],
30- check = True ,
34+ check = False ,
3135 capture_output = True ,
3236 text = True ,
3337 env = env ,
3438 )
39+ assert proc .returncode == 0 , proc
3540 warning_found = "PATH altered to include" in proc .stderr
3641 assert warning_found is expected_warning
3742
You can’t perform that action at this time.
0 commit comments