aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadosław Piliszek <radoslaw.piliszek@gmail.com>2020-04-17 17:30:28 +0200
committerRadosław Piliszek <radoslaw.piliszek@gmail.com>2020-04-26 12:16:44 +0200
commit234272eb646ce877043ec486bbcf6fe2dcb7e3b4 (patch)
treedbfe6c885c80c23c5ee248be34969bf334ded0f4
parentb1db4f5c3bc14d4e9a501c32fb73a2bf2aa2a37e (diff)
downloadkolla-ansible-234272eb646ce877043ec486bbcf6fe2dcb7e3b4.tar.gz
kolla-ansible-234272eb646ce877043ec486bbcf6fe2dcb7e3b4.zip
Cleanup py27 support
Removes and/or replaces all mentions of py27. Cleans up obsolete requirements and their lower-constraints. Separates test-requirements. Makes lower-constraints pass outside of CI (MarkupSafe). Adds FIXMEs about some hacky Mocks that may misbehave. Change-Id: Ifc090bf3c1db17d8542ee591c91e8225a597bfe2
-rw-r--r--doc/source/contributor/running-tests.rst14
-rw-r--r--lower-constraints.txt3
-rw-r--r--requirements.txt20
-rw-r--r--setup.cfg8
-rw-r--r--setup.py9
-rw-r--r--test-requirements.txt19
-rw-r--r--tests/test_kolla_docker.py2
-rw-r--r--tests/test_merge_config.py2
-rw-r--r--tox.ini1
9 files changed, 34 insertions, 44 deletions
diff --git a/doc/source/contributor/running-tests.rst b/doc/source/contributor/running-tests.rst
index bf9481a2f..16c55a3cb 100644
--- a/doc/source/contributor/running-tests.rst
+++ b/doc/source/contributor/running-tests.rst
@@ -28,11 +28,11 @@ so the only package you install is ``tox`` itself:
For more information, see `the unit testing section of the Testing wiki page
<https://wiki.openstack.org/wiki/Testing#Unit_Tests>`_. For example:
-To run the Python 2.7 tests:
+To run the Python 3.7 tests:
.. code-block:: console
- tox -e py27
+ tox -e py37
To run the style tests:
@@ -44,7 +44,7 @@ To run multiple tests separate items by commas:
.. code-block:: console
- tox -e py27,py37,pep8
+ tox -e py37,pep8
Running a subset of tests
-------------------------
@@ -58,28 +58,28 @@ directory use:
.. code-block:: console
- tox -e py27 kolla-ansible.tests
+ tox -e py37 kolla-ansible.tests
To run the tests of a specific file
``kolla-ansible/tests/test_kolla_docker.py``:
.. code-block:: console
- tox -e py27 test_kolla_docker
+ tox -e py37 test_kolla_docker
To run the tests in the ``ModuleArgsTest`` class in
the ``kolla-ansible/tests/test_kolla_docker.py`` file:
.. code-block:: console
- tox -e py27 test_kolla_docker.ModuleArgsTest
+ tox -e py37 test_kolla_docker.ModuleArgsTest
To run the ``ModuleArgsTest.test_module_args`` test method in
the ``kolla-ansible/tests/test_kolla_docker.py`` file:
.. code-block:: console
- tox -e py27 test_kolla_docker.ModuleArgsTest.test_module_args
+ tox -e py37 test_kolla_docker.ModuleArgsTest.test_module_args
Debugging unit tests
--------------------
diff --git a/lower-constraints.txt b/lower-constraints.txt
index 13855e307..de4283fca 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -35,7 +35,7 @@ jsonpointer==2.0
jsonschema==2.6.0
keystoneauth1==3.4.0
linecache2==1.0.0
-MarkupSafe==1.0
+MarkupSafe==1.1.0
monotonic==1.4
mox3==0.25.0
msgpack==0.5.6
@@ -73,7 +73,6 @@ requests==2.18.4
requestsexceptions==1.4.0
restructuredtext-lint==1.1.3
rfc3986==1.2.0
-setuptools==21.0.0
simplejson==3.13.2
six==1.10.0
smmap2==2.0.3
diff --git a/requirements.txt b/requirements.txt
index 66c6cd386..d38c44e6f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,13 +1,17 @@
-# The order of packages is significant, because pip processes them in the order
-# of appearance. Changing the order has an impact on the overall integration
-# process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
-docker>=2.4.2 # Apache-2.0
-Jinja2>=2.10 # BSD License (3 clause)
+
+# ini parsing
oslo.config>=5.2.0 # Apache-2.0
-oslo.utils>=3.33.0 # Apache-2.0
-setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,>=21.0.0 # PSF/ZPL
+
+# YAML parsing
PyYAML>=3.12 # MIT
-netaddr>=0.7.18 # BSD
+
+# password generation
cryptography>=2.1 # BSD/Apache-2.0
+oslo.utils>=3.33.0 # Apache-2.0
+
+# templating
+Jinja2>=2.10 # BSD License (3 clause)
+
+# Ansible's json_query
jmespath>=0.9.3 # MIT
diff --git a/setup.cfg b/setup.cfg
index 825cca778..e8f2f40c5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -6,6 +6,7 @@ description-file =
author = OpenStack
author-email = openstack-discuss@lists.openstack.org
home-page = https://docs.openstack.org/kolla-ansible/latest/
+python-requires = >=3.6
license = Apache License, Version 2.0
classifier =
Environment :: OpenStack
@@ -14,6 +15,8 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
+ Programming Language :: Python :: Implementation :: CPython
+ Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
@@ -41,8 +44,3 @@ scripts =
console_scripts =
kolla-genpwd = kolla_ansible.cmd.genpwd:main
kolla-mergepwd = kolla_ansible.cmd.mergepwd:main
-
-[build_releasenotes]
-all_files = 1
-build-dir = releasenotes/build
-source-dir = releasenotes/source
diff --git a/setup.py b/setup.py
index 566d84432..cd35c3c35 100644
--- a/setup.py
+++ b/setup.py
@@ -13,17 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
-# In python < 2.7.4, a lazy loading of package `pbr` will break
-# setuptools if some other modules registered functions in `atexit`.
-# solution from: http://bugs.python.org/issue15881#msg170215
-try:
- import multiprocessing # noqa
-except ImportError:
- pass
-
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
pbr=True)
diff --git a/test-requirements.txt b/test-requirements.txt
index 9e9aeb5c2..d1e5b433f 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,18 +1,13 @@
-# The order of packages is significant, because pip processes them in the order
-# of appearance. Changing the order has an impact on the overall integration
-# process, which may cause wedges in the gate later.
+# linting
bandit>=1.1.0 # Apache-2.0
bashate>=0.5.1 # Apache-2.0
-beautifulsoup4>=4.6.0 # MIT
-coverage!=4.4,>=4.0 # Apache-2.0
doc8>=0.6.0 # Apache-2.0
-extras>=1.0.0 # MIT
hacking>=3.0,<3.1.0 # Apache-2.0
-oslo.log>=3.36.0 # Apache-2.0
+
+# coverage testing
+coverage!=4.4,>=4.0 # Apache-2.0
+
+# unit testing
+docker>=2.4.2 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
-PrettyTable<0.8,>=0.7.1 # BSD
-PyYAML>=3.12 # MIT
-pytz>=2013.6 # MIT
stestr>=2.0.0 # Apache-2.0
-testscenarios>=0.4 # Apache-2.0/BSD
-testtools>=2.2.0 # MIT
diff --git a/tests/test_kolla_docker.py b/tests/test_kolla_docker.py
index b2b9cca3d..27ef9d4a2 100644
--- a/tests/test_kolla_docker.py
+++ b/tests/test_kolla_docker.py
@@ -26,6 +26,8 @@ from docker.types import Ulimit
from oslotest import base
this_dir = os.path.dirname(sys.modules[__name__].__file__)
+# FIXME(yoctozepto): this modifies global interpreter state and affects tests
+# from other files
sys.modules['ansible'] = mock.MagicMock()
sys.modules['ansible.module_utils'] = mock.MagicMock()
sys.modules['ansible.module_utils.basic'] = mock.MagicMock()
diff --git a/tests/test_merge_config.py b/tests/test_merge_config.py
index ccc702947..1638186f5 100644
--- a/tests/test_merge_config.py
+++ b/tests/test_merge_config.py
@@ -26,6 +26,8 @@ PROJECT_DIR = os.path.abspath(os.path.join(os. path.dirname(__file__), '../'))
MERGE_CONFIG_FILE = os.path.join(PROJECT_DIR,
'ansible/action_plugins/merge_configs.py')
+# FIXME(yoctozepto): this modifies global interpreter state and affects tests
+# from other files
sys.modules['ansible.plugins'] = mock.MagicMock()
merge_configs = imp.load_source('merge_configs', MERGE_CONFIG_FILE)
diff --git a/tox.ini b/tox.ini
index d0f327fb0..9f1b6c296 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,7 +9,6 @@ basepython = python3
usedevelop=True
whitelist_externals = find
rm
-install_command = pip install {opts} {packages}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt