Browse code

Rename to ansible-core (#72594)

Change:
- Initial set of changes for renaming to ansible-core
- Includes changelog fragment changes from base -> core
- Does NOT include docs changes
- Modifies detection stuff in setup.py to support ansible<2.9 and ansible-base

Test Plan:
- ci_complete

Rick Elrod authored on 2020/11/14 06:42:10
Showing 22 changed files
... ...
@@ -79,6 +79,8 @@ Vagrantfile
79 79
 /lib/ansible.egg-info/
80 80
 # First used in the `devel` branch during Ansible 2.10 development.
81 81
 /lib/ansible_base.egg-info/
82
+# First used in the `devel` branch during Ansible 2.11 development.
83
+/lib/ansible_core.egg-info/
82 84
 /shippable/
83 85
 /test/integration/cloud-config-*.*
84 86
 !/test/integration/cloud-config-*.*.template
... ...
@@ -14,7 +14,7 @@
14 14
 ########################################################
15 15
 # variable section
16 16
 
17
-NAME = ansible-base
17
+NAME = ansible-core
18 18
 OS = $(shell uname -s)
19 19
 PREFIX ?= '/usr/local'
20 20
 SDIST_DIR ?= 'dist'
... ...
@@ -1,4 +1,4 @@
1 1
 bugfixes:
2 2
   - apt_repository - fixes ``mode`` doc to remove ineffective default (https://github.com/ansible/ansible/pull/70319).
3 3
 deprecated_features:
4
-  - apt_key - the paramater ``key`` does not have any effect, has been deprecated and will be removed in ansible-base version 2.14 (https://github.com/ansible/ansible/pull/70319).
4
+  - apt_key - the paramater ``key`` does not have any effect, has been deprecated and will be removed in ansible-core version 2.14 (https://github.com/ansible/ansible/pull/70319).
... ...
@@ -1,2 +1,2 @@
1 1
 minor_changes:
2
-- "The plugin loader now keeps track of the collection where a plugin was resolved to, in particular whether the plugin was loaded from ansible-base's internal paths (``ansible.builtin``) or from user-supplied paths (no collection name)."
2
+- "The plugin loader now keeps track of the collection where a plugin was resolved to, in particular whether the plugin was loaded from ansible-core's internal paths (``ansible.builtin``) or from user-supplied paths (no collection name)."
... ...
@@ -39,7 +39,7 @@ def _ensure_vendored_path_entry():
39 39
         already_loaded_vendored_modules = set(sys.modules.keys()).intersection(vendored_module_names)
40 40
 
41 41
         if already_loaded_vendored_modules:
42
-            warnings.warn('One or more Python packages bundled by this ansible-base distribution were already '
42
+            warnings.warn('One or more Python packages bundled by this ansible-core distribution were already '
43 43
                           'loaded ({0}). This may result in undefined behavior.'.format(', '.join(sorted(already_loaded_vendored_modules))))
44 44
 
45 45
 
... ...
@@ -352,7 +352,7 @@ class Display(with_metaclass(Singleton, object)):
352 352
             msg += '.'
353 353
 
354 354
         if collection_name == 'ansible.builtin':
355
-            collection_name = 'ansible-base'
355
+            collection_name = 'ansible-core'
356 356
 
357 357
         if removed:
358 358
             header = '[DEPRECATED]: {0}'.format(msg)
... ...
@@ -1,4 +1,4 @@
1
-ansible-base (%VERSION%-%RELEASE%~%DIST%) %DIST%; urgency=low
1
+ansible-core (%VERSION%-%RELEASE%~%DIST%) %DIST%; urgency=low
2 2
 
3 3
   * %VERSION% release
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-Source: ansible-base
1
+Source: ansible-core
2 2
 Section: admin
3 3
 Priority: optional
4 4
 Standards-Version: 3.9.3
... ...
@@ -6,7 +6,7 @@ Maintainer: Ansible, Inc. <info@ansible.com>
6 6
 Build-Depends: cdbs, debhelper (>= 5.0.0), python3-docutils, python3, dh-python | python-support, python3-setuptools, lsb-release, python3-straight.plugin, python3-packaging, python3-jinja2
7 7
 Homepage: https://github.com/ansible/ansible/
8 8
 
9
-Package: ansible-base
9
+Package: ansible-core
10 10
 Architecture: all
11 11
 Depends: python3-jinja2, python3-yaml, python3-paramiko, python3-cryptography, sshpass, ${misc:Depends}, ${python:Depends}
12 12
 Description: Ansible IT Automation
... ...
@@ -18,7 +18,7 @@ Description: Ansible IT Automation
18 18
 
19 19
 Package: ansible-test
20 20
 Architecture: all
21
-Depends: ansible-base (= ${binary:Version}), python3-venv, ${misc:Depends}
21
+Depends: ansible-core (= ${binary:Version}), python3-venv, ${misc:Depends}
22 22
 Description: Ansible IT Automation
23 23
  Ansible is a radically simple model-driven configuration management,
24 24
  multi-node deployment, and remote task execution system. Ansible works
... ...
@@ -1,7 +1,7 @@
1 1
 #!/usr/bin/make -f
2 2
 # -- makefile --
3 3
 
4
-DEB_PYTHON3_MODULE_PACKAGES=ansible-base ansible_test
4
+DEB_PYTHON3_MODULE_PACKAGES=ansible-core ansible_test
5 5
 #DEB_PYTHON_INSTALL_ARGS_ALL="--install-purelib=/usr/lib/python2.7/site-packages/"
6 6
 DEB_PYTHON_DISTUTILS_INSTALLDIR_SKEL = /usr/lib/python3/dist-packages/
7 7
 
... ...
@@ -50,9 +50,9 @@ def find_package_info(*file_paths):
50 50
     raise RuntimeError("Unable to find package info.")
51 51
 
52 52
 
53
-def _validate_install_ansible_base():
54
-    """Validate that we can install ansible-base. Currently this only
55
-    cares about upgrading to ansible-base from ansible<2.10
53
+def _validate_install_ansible_core():
54
+    """Validate that we can install ansible-core. This checks if
55
+    ansible<=2.9 or ansible-base>=2.10 are installed.
56 56
     """
57 57
     # Skip common commands we can ignore
58 58
     # Do NOT add bdist_wheel here, we don't ship wheels
... ...
@@ -80,31 +80,36 @@ def _validate_install_ansible_base():
80 80
         pass
81 81
     else:
82 82
         version_tuple = tuple(int(v) for v in __version__.split('.')[:2])
83
-        if version_tuple < (2, 10):
84
-            stars = '*' * 76
85
-            raise RuntimeError(
86
-                '''
83
+        if version_tuple >= (2, 11):
84
+            return
85
+        elif version_tuple == (2, 10):
86
+            ansible_name = 'ansible-base'
87
+        else:
88
+            ansible_name = 'ansible'
89
+
90
+        stars = '*' * 76
91
+        raise RuntimeError(
92
+            '''
87 93
 
88 94
     %s
89 95
 
90
-    Cannot install ansible-base with a pre-existing ansible==%s
96
+    Cannot install ansible-core with a pre-existing %s==%s
91 97
     installation.
92 98
 
93
-    Installing ansible-base with ansible-2.9 or older currently installed with
94
-    pip is known to cause problems. Please uninstall ansible and install the new
95
-    version:
99
+    Installing ansible-core with ansible-2.9 or older, or ansible-base-2.10
100
+    currently installed with pip is known to cause problems. Please uninstall
101
+    %s and install the new version:
96 102
 
97
-        pip uninstall ansible
98
-        pip install ansible-base
103
+        pip uninstall %s
104
+        pip install ansible-core
99 105
 
100 106
     If you want to skip the conflict checks and manually resolve any issues
101 107
     afterwards, set the ANSIBLE_SKIP_CONFLICT_CHECK environment variable:
102 108
 
103
-        ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install ansible-base
109
+        ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install ansible-core
104 110
 
105 111
     %s
106
-                ''' % (stars, __version__, stars)
107
-            )
112
+            ''' % (stars, ansible_name, __version__, ansible_name, ansible_name, stars))
108 113
     finally:
109 114
         sys.path[:] = sys_path
110 115
         for key in sys_modules_keys.symmetric_difference(sys.modules):
... ...
@@ -112,7 +117,7 @@ def _validate_install_ansible_base():
112 112
         sys.modules.update(sys_modules)
113 113
 
114 114
 
115
-_validate_install_ansible_base()
115
+_validate_install_ansible_core()
116 116
 
117 117
 
118 118
 SYMLINK_CACHE = 'SYMLINK_CACHE.json'
... ...
@@ -347,7 +352,7 @@ static_setup_params = dict(
347 347
         'install_scripts': InstallScriptsCommand,
348 348
         'sdist': SDistCommand,
349 349
     },
350
-    name='ansible-base',
350
+    name='ansible-core',
351 351
     version=__version__,
352 352
     description='Radically simple IT automation',
353 353
     author=__author__,
... ...
@@ -1,3 +1,3 @@
1 1
 # use a plugin redirected by core to a collection to ensure inventory redirection and redirected config names are working
2
-plugin: formerly_core_inventory  # this is defined in the ansible-base runtime.yml routing to point at testns.content_adj.statichost
2
+plugin: formerly_core_inventory  # this is defined in the ansible-core runtime.yml routing to point at testns.content_adj.statichost
3 3
 hostname: dynamic_host_redirected
... ...
@@ -30,7 +30,7 @@
30 30
     state: present
31 31
   when: ansible_facts.distribution not in ['Alpine', 'MacOSX']
32 32
 
33
-# apk isn't available on ansible-base so just call command
33
+# apk isn't available on ansible-core so just call command
34 34
 - name: Alpine - Install Kerberos system packages
35 35
   command: apk add {{ krb5_packages | join(' ') }}
36 36
   when: ansible_facts.distribution == 'Alpine'
... ...
@@ -87,7 +87,7 @@
87 87
   ignore_errors: yes
88 88
   register: misuse_of_changed
89 89
 
90
-# providing artificial task results since there are no modules in ansible-base that provide a 'results' list instead of 'changed'
90
+# providing artificial task results since there are no modules in ansible-core that provide a 'results' list instead of 'changed'
91 91
 - name: Prepare artificial task results
92 92
   set_fact:
93 93
     results_all_changed:
... ...
@@ -1,5 +1,5 @@
1 1
 default name=quay.io/ansible/default-test-container:2.9.0 python=3.6,2.6,2.7,3.5,3.7,3.8,3.9 seccomp=unconfined context=collection
2
-default name=quay.io/ansible/ansible-base-test-container:1.7.0 python=3.6,2.6,2.7,3.5,3.7,3.8,3.9 seccomp=unconfined context=ansible-base
2
+default name=quay.io/ansible/ansible-base-test-container:1.7.0 python=3.6,2.6,2.7,3.5,3.7,3.8,3.9 seccomp=unconfined context=ansible-core
3 3
 alpine3 name=quay.io/ansible/alpine3-test-container:1.19.0 python=3.8
4 4
 centos6 name=quay.io/ansible/centos6-test-container:1.17.0 python=2.6 seccomp=unconfined
5 5
 centos7 name=quay.io/ansible/centos7-test-container:1.17.0 python=2.7 seccomp=unconfined
... ...
@@ -1,2 +1,2 @@
1
-jinja2  # ansible-base requirement
2
-pyyaml  # ansible-base requirement
1
+jinja2  # ansible-core requirement
2
+pyyaml  # ansible-core requirement
... ...
@@ -1,3 +1,3 @@
1
-jinja2  # ansible-base requirement
1
+jinja2  # ansible-core requirement
2 2
 pyyaml  # needed for collection_detail.py
3 3
 voluptuous
... ...
@@ -1,5 +1,5 @@
1 1
 #!/usr/bin/env python
2
-"""Schema validation of ansible-base's ansible_builtin_runtime.yml and collection's meta/runtime.yml"""
2
+"""Schema validation of ansible-core's ansible_builtin_runtime.yml and collection's meta/runtime.yml"""
3 3
 from __future__ import (absolute_import, division, print_function)
4 4
 __metaclass__ = type
5 5
 
... ...
@@ -55,14 +55,14 @@ MSGS = {
55 55
               "ansible-deprecated-no-collection-name",
56 56
               "The current collection name in format `namespace.name` must "
57 57
               "be provided as collection_name when calling Display.deprecated "
58
-              "or AnsibleModule.deprecate (`ansible.builtin` for ansible-base)",
58
+              "or AnsibleModule.deprecate (`ansible.builtin` for ansible-core)",
59 59
               {'minversion': (2, 6)}),
60 60
     'E9507': ("Wrong collection name (%r) found in call to "
61 61
               "Display.deprecated or AnsibleModule.deprecate",
62 62
               "wrong-collection-deprecated",
63 63
               "The name of the current collection must be passed to the "
64 64
               "Display.deprecated resp. AnsibleModule.deprecate calls "
65
-              "(`ansible.builtin` for ansible-base)",
65
+              "(`ansible.builtin` for ansible-core)",
66 66
               {'minversion': (2, 6)}),
67 67
     'E9508': ("Expired date (%r) found in call to Display.deprecated "
68 68
               "or AnsibleModule.deprecate",
... ...
@@ -155,7 +155,7 @@ def check_removal_version(v, version_field, collection_name_field, error_code='i
155 155
             parsed_version.parse(version)
156 156
         except ValueError as exc:
157 157
             raise _add_ansible_error_code(
158
-                Invalid('%s (%r) is not a valid ansible-base version: %s' % (version_field, version, exc)),
158
+                Invalid('%s (%r) is not a valid ansible-core version: %s' % (version_field, version, exc)),
159 159
                 error_code=error_code)
160 160
         return v
161 161
     try:
... ...
@@ -283,7 +283,7 @@ def version_added(v, error_code='version-added-invalid', accept_historical=False
283 283
                     version.parse(version_added)
284 284
                 except ValueError as exc:
285 285
                     raise _add_ansible_error_code(
286
-                        Invalid('version_added (%r) is not a valid ansible-base version: '
286
+                        Invalid('version_added (%r) is not a valid ansible-core version: '
287 287
                                 '%s' % (version_added, exc)),
288 288
                         error_code=error_code)
289 289
             else:
... ...
@@ -153,7 +153,7 @@ def get_parameterized_completion(cache, name):
153 153
         if data_context().content.collection:
154 154
             context = 'collection'
155 155
         else:
156
-            context = 'ansible-base'
156
+            context = 'ansible-core'
157 157
 
158 158
         images = read_lines_without_comments(os.path.join(ANSIBLE_TEST_DATA_ROOT, 'completion', '%s.txt' % name), remove_blank_lines=True)
159 159
 
... ...
@@ -1,2 +1,2 @@
1
-jinja2  # ansible-base requirement
1
+jinja2  # ansible-core requirement
2 2
 pyyaml
... ...
@@ -1,7 +1,7 @@
1 1
 docutils
2 2
 jinja2
3 3
 packaging
4
-pyyaml  # ansible-base requirement
4
+pyyaml  # ansible-core requirement
5 5
 rstcheck
6 6
 setuptools > 39.2
7 7
 straight.plugin