Browse code

Fix references to old egg-info directory.

Matt Clay authored on 2020/03/31 03:00:45
Showing 10 changed files
... ...
@@ -71,7 +71,11 @@ coverage.xml
71 71
 venv
72 72
 Vagrantfile
73 73
 .vagrant
74
-ansible.egg-info/
74
+# Backwards compatibility with `stable-2.9` and earlier branches.
75
+# Also used in the `devel` branch during early Ansible 2.10 development.
76
+/lib/ansible.egg-info/
77
+# First used in the `devel` branch during Ansible 2.10 development.
78
+/lib/ansible_base.egg-info/
75 79
 /shippable/
76 80
 /test/integration/cloud-config-*.*
77 81
 !/test/integration/cloud-config-*.*.template
... ...
@@ -169,7 +169,7 @@ clean:
169 169
 	@echo "Cleaning up distutils stuff"
170 170
 	rm -rf build
171 171
 	rm -rf dist
172
-	rm -rf lib/ansible.egg-info/
172
+	rm -rf lib/ansible*.egg-info/
173 173
 	@echo "Cleaning up byte compiled python stuff"
174 174
 	find . -type f -regex ".*\.py[co]$$" -delete
175 175
 	find . -type d -name "__pycache__" -delete
... ...
@@ -61,8 +61,11 @@ expr "$MANPATH" : "${PREFIX_MANPATH}.*" > /dev/null || prepend_path MANPATH "$PR
61 61
 # Do the work in a function so we don't repeat ourselves later
62 62
 gen_egg_info()
63 63
 {
64
-    if [ -e "$PREFIX_PYTHONPATH/ansible.egg-info" ] ; then
65
-        \rm -rf "$PREFIX_PYTHONPATH/ansible.egg-info"
64
+    # check for current and past egg-info directory names
65
+    if ls "$PREFIX_PYTHONPATH"/ansible*.egg-info >/dev/null 2>&1; then
66
+        # bypass shell aliases with leading backslash
67
+        # see https://github.com/ansible/ansible/pull/11967
68
+        \rm -rf "$PREFIX_PYTHONPATH"/ansible*.egg-info
66 69
     fi
67 70
     $PYTHON_BIN setup.py egg_info
68 71
 }
... ...
@@ -22,7 +22,7 @@
22 22
 from __future__ import (absolute_import, division, print_function)
23 23
 __metaclass__ = type
24 24
 
25
-__requires__ = ['ansible']
25
+__requires__ = ['ansible_base']
26 26
 
27 27
 
28 28
 import errno
... ...
@@ -4,7 +4,7 @@
4 4
 from __future__ import (absolute_import, division, print_function)
5 5
 
6 6
 __metaclass__ = type
7
-__requires__ = ['ansible']
7
+__requires__ = ['ansible_base']
8 8
 
9 9
 
10 10
 import fcntl
11 11
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+shippable/posix/group1
0 1
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+from __future__ import (absolute_import, division, print_function)
1
+__metaclass__ = type
2
+
3
+import pkg_resources
4
+
5
+from ansible.plugins.lookup import LookupBase
6
+
7
+
8
+class LookupModule(LookupBase):
9
+    def run(self, terms, variables, **kwargs):
10
+        return ['ok']
0 11
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+- name: Make sure pkg_resources can be imported by plugins
1
+  debug:
2
+    msg: "{{ lookup('import_pkg_resources') }}"
... ...
@@ -355,12 +355,12 @@ def generate_egg_info(args):
355 355
 
356 356
     # inclusion of the version number in the path is optional
357 357
     # see: https://setuptools.readthedocs.io/en/latest/formats.html#filename-embedded-metadata
358
-    egg_info_path = ANSIBLE_LIB_ROOT + '-%s.egg-info' % ansible_version
358
+    egg_info_path = ANSIBLE_LIB_ROOT + '_base-%s.egg-info' % ansible_version
359 359
 
360 360
     if os.path.exists(egg_info_path):
361 361
         return
362 362
 
363
-    egg_info_path = ANSIBLE_LIB_ROOT + '.egg-info'
363
+    egg_info_path = ANSIBLE_LIB_ROOT + '_base.egg-info'
364 364
 
365 365
     if os.path.exists(egg_info_path):
366 366
         return
... ...
@@ -37,6 +37,7 @@ class UnversionedSource(SourceProvider):
37 37
             '.pytest_cache',
38 38
             '__pycache__',
39 39
             'ansible.egg-info',
40
+            'ansible_base.egg-info',
40 41
         )
41 42
 
42 43
         kill_sub_dir = {