summaryrefslogtreecommitdiffstats
path: root/collections-debian-merged/setup.py
blob: ccfa9173b4b462b1126557d1b1b03701bff48a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/python -tt

import os
import sys
from setuptools import setup


def detect_bad_upgrade():
    # prevent direct upgrade from 2.9.x or earlier to 2.10 due to pip limitations
    try:
        import ansible
    except ImportError:
        # ansible is not installed
        return False

    try:
        current_version = ansible.__version__.split('.')
        current_filename = ansible.__file__
    except AttributeError:
        # ansible is installed but already broken.  We're probably being reinstalled.
        return False

    try:
        current_version = (int(current_version[0]), int(current_version[1]))
    except Exception as e:
        print("""\n
            ### ERROR ###

            The currently installed ansible found at:

            {0}

            is of an unknown version.  Since upgrading directly from ansible-2.9 or less to
            ansible-2.10 with pip is known to cause problems, please uninstall the old version and
            install the new version:

                pip uninstall ansible
                pip install ansible

            If you have a broken installation, perhaps because ansible-base was installed before
            ansible was upgraded, try this to resolve it:

                pip install --force-reinstall ansible ansible-base

            If ansible is installed in a different location than you will be installing it now
            (for example, if the old version is installed by a system package manager to
            /usr/lib/python3.8/site-packages/ansible but you are installing the new version into
            ~/.local/lib/python3.8/site-packages/ansible with `pip install --user ansible`)
            or you want to install anyways and cleanup any breakage afterwards, then you may set
            the ANSIBLE_SKIP_CONFLICT_CHECK environment variable to ignore this check:

                ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install --user ansible

            ### END ERROR ###

            """.format(current_filename))
    else:
        if current_version >= (2, 10):
            return False

        print("""\n
            ### ERROR ###

            Upgrading directly from ansible-2.9 or less to ansible-2.10 or greater with pip is
            known to cause problems.  Please uninstall the old version found at:

            {0}

            and install the new version:

                pip uninstall ansible
                pip install ansible

            If you have a broken installation, perhaps because ansible-base was installed before
            ansible was upgraded, try this to resolve it:

                pip install --force-reinstall ansible ansible-base

            If ansible is installed in a different location than you will be installing it now
            (for example, if the old version is installed by a system package manager to
            /usr/lib/python3.8/site-packages/ansible but you are installing the new version into
            ~/.local/lib/python3.8/site-packages/ansible with `pip install --user ansible`)
            or you want to install anyways and cleanup any breakage afterwards, then you may set
            the ANSIBLE_SKIP_CONFLICT_CHECK environment variable to ignore this check:

                ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install --user ansible

            ### END ERROR ###

            """.format(current_filename))

    return True


if not os.environ.get('ANSIBLE_SKIP_CONFLICT_CHECK'):
    if detect_bad_upgrade():
        sys.exit(1)


__version__ = '2.10.7'
__author__ = 'Ansible, Inc.'


with open('README.rst', 'r') as f:
    long_desc = f.read()

setup(
    name='ansible',
    version=__version__,
    description='Radically simple IT automation',
    long_description=long_desc,
    author=__author__,
    author_email='info@ansible.com',
    url='https://ansible.com/',
    project_urls={
        'Bug Tracker': 'https://github.com/ansible/ansible/issues',
        'CI: Shippable': 'https://app.shippable.com/github/ansible/ansible',
        'Code of Conduct': 'https://docs.ansible.com/ansible/latest/community/code_of_conduct.html',
        'Documentation': 'https://docs.ansible.com/ansible/',
        'Mailing lists': 'https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information',
        'Source Code': 'https://github.com/ansible/ansible',
    },
    license='GPLv3+',
    python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
    packages=['ansible_collections'],
    include_package_data=True,
    install_requires=[
        'ansible-base>=2.10.5,<2.11',
    ],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
        'Natural Language :: English',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Topic :: System :: Installation/Setup',
        'Topic :: System :: Systems Administration',
        'Topic :: Utilities',
    ],
    data_files=[],
    # Installing as zip files would break due to references to __file__
    zip_safe=False
)