From 00c875df81e09ec638519b3f3a880392543c0b33 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 15 Oct 2019 09:12:44 -0400 Subject: [PATCH 1/4] Add Python 3.8 support Now that python 3.8 has been released we should add support for running under it to stestr. This commit adds the required CI jobs to verify that everything runs on 3.8 and also updates the package metadata to indicate we support running on 3.8. --- .travis.yml | 3 +++ azure-pipelines.yml | 6 +++++- setup.cfg | 1 + tox.ini | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e6ae0db4..b0da764c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ matrix: env: TOXENV=py35 - python: "3.6" env: TOXENV=py36 + - os: linux + python: 3.8 + env: TOXENV=py38 - os: linux dist: xenial python: 3.7 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5bb51160..d8ead408 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,6 +19,8 @@ jobs: python.version: '3.6' Python37: python.version: '3.7' + Python38: + python.version: '3.8' steps: - task: UsePythonVersion@0 inputs: @@ -48,6 +50,8 @@ jobs: python.version: '3.6' Python37: python.version: '3.7' + Python38: + python.version: '3.8' steps: - task: UsePythonVersion@0 inputs: @@ -59,4 +63,4 @@ jobs: pip install -U tox displayName: 'Install dependencies' - script: tox -e py - displayName: 'Run Tox' \ No newline at end of file + displayName: 'Run Tox' diff --git a/setup.cfg b/setup.cfg index cc0025d9..5802826b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,6 +20,7 @@ classifier = Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Topic :: Software Development :: Testing Topic :: Software Development :: Quality Assurance project_urls = diff --git a/tox.ini b/tox.ini index 3af11eee..d4cdf3a9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = py37,py36,py35,py34,py27,pep8 +envlist = py38,py37,py36,py35,py34,py27,pep8 skipsdist = True [testenv] From 92f9b714e18da311ff683eaf6f63102c8f29adf0 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 18 Oct 2019 09:26:01 +0200 Subject: [PATCH 2/4] Update to recent hacking version This pulls in a newer pycodestyle/flake8 version which is a bit more strict, so some fallout needs to be fixed. --- stestr/repository/memory.py | 7 ++++--- stestr/scheduler.py | 5 ++++- test-requirements.txt | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/stestr/repository/memory.py b/stestr/repository/memory.py index 5bc31d83..2d60f00a 100644 --- a/stestr/repository/memory.py +++ b/stestr/repository/memory.py @@ -14,7 +14,6 @@ from extras import try_import -OrderedDict = try_import('collections.OrderedDict', dict) from io import BytesIO from operator import methodcaller @@ -23,6 +22,8 @@ from stestr.repository import abstract as repository +OrderedDict = try_import('collections.OrderedDict', dict) + class RepositoryFactory(repository.AbstractRepositoryFactory): """A factory that can initialise and open memory repositories. @@ -152,8 +153,8 @@ def _handle_test(self, test_dict): duration_delta = stop - start duration_seconds = ( (duration_delta.microseconds + ( - duration_delta.seconds + duration_delta.days - * 24 * 3600) * 10 ** 6) / 10.0 ** 6) + duration_delta.seconds + + duration_delta.days * 24 * 3600) * 10 ** 6) / 10.0 ** 6) self._repository._times[test_dict['id']] = duration_seconds def stopTestRun(self): diff --git a/stestr/scheduler.py b/stestr/scheduler.py index b7c5631f..e64419fe 100644 --- a/stestr/scheduler.py +++ b/stestr/scheduler.py @@ -46,6 +46,9 @@ def partition_tests(test_ids, concurrency, repository, group_callback, :return: A list where each element is a distinct subset of test_ids, and the union of all the elements is equal to set(test_ids). """ + def noop(): + return None + _group_callback = group_callback partitions = [list() for i in range(concurrency)] timed_partitions = [[0.0, partition] for partition in partitions] @@ -60,7 +63,7 @@ def partition_tests(test_ids, concurrency, repository, group_callback, # Group tests: generate group_id -> test_ids. group_ids = collections.defaultdict(list) if _group_callback is None: - group_callback = lambda _: None + group_callback = noop else: group_callback = _group_callback for test_id in test_ids: diff --git a/test-requirements.txt b/test-requirements.txt index 4f6c1147..88b398e5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,11 +2,11 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking<0.12,>=0.11.0 # Apache-2.0 +hacking<1.2.0,>=1.1.0 sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD mock>=2.0 # BSD subunit2sql>=1.8.0 coverage>=4.0 # Apache-2.0 ddt>=1.0.1 # MIT -doc8>=0.8.0 # Apache-2.0 \ No newline at end of file +doc8>=0.8.0 # Apache-2.0 From cc263bec8c13b1bc27a9f2e8860595a9f837ac01 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 20 Oct 2019 00:26:47 +0200 Subject: [PATCH 3/4] Update stestr/scheduler.py Co-Authored-By: Matthew Treinish --- stestr/scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stestr/scheduler.py b/stestr/scheduler.py index e64419fe..a7216e18 100644 --- a/stestr/scheduler.py +++ b/stestr/scheduler.py @@ -46,7 +46,7 @@ def partition_tests(test_ids, concurrency, repository, group_callback, :return: A list where each element is a distinct subset of test_ids, and the union of all the elements is equal to set(test_ids). """ - def noop(): + def noop(_): return None _group_callback = group_callback From adee4d5cec2d403c637a4e0ba46d7c156a45e635 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 29 Oct 2019 13:53:13 -0400 Subject: [PATCH 4/4] Remove 3.8 azure pipelines jobs The azure pipelines environments do not have python 3.8 yet. Instead of continuously waiting for this to show up lets just rely on travis for 3.8 testing for now and add windows and macOS coverage when it's available. --- azure-pipelines.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d8ead408..66902a4a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,8 +19,6 @@ jobs: python.version: '3.6' Python37: python.version: '3.7' - Python38: - python.version: '3.8' steps: - task: UsePythonVersion@0 inputs: @@ -50,8 +48,6 @@ jobs: python.version: '3.6' Python37: python.version: '3.7' - Python38: - python.version: '3.8' steps: - task: UsePythonVersion@0 inputs: