diff --git a/.zuul.yaml b/.zuul.yaml index 913463c..61b7b3a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,7 +1,6 @@ - project: templates: - check-requirements - - openstack-python-jobs - - openstack-python3-train-jobs + - openstack-python3-ussuri-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 diff --git a/doc/requirements.txt b/doc/requirements.txt index af1aeb8..0e74ac4 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -3,5 +3,4 @@ # process, which may cause wedges in the gate later. openstackdocstheme>=1.18.1 # Apache-2.0 reno>=2.5.0 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 9370318..4c93957 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -31,9 +31,6 @@ repository_name = 'openstack/os-testr' bug_project = 'os-testr' bug_tag = '' -# Must set this variable to include year, month, day, hours, and minutes. -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. # execute "export SPHINX_DEBUG=1" in your terminal to disable diff --git a/os_testr/ostestr.py b/os_testr/ostestr.py index 514e32c..88621aa 100755 --- a/os_testr/ostestr.py +++ b/os_testr/ostestr.py @@ -279,5 +279,6 @@ def ostestr(args): def main(): exit(ostestr(sys.argv[1:])) + if __name__ == '__main__': main() diff --git a/os_testr/tests/test_ostestr.py b/os_testr/tests/test_ostestr.py index 618e84c..dcd8f40 100644 --- a/os_testr/tests/test_ostestr.py +++ b/os_testr/tests/test_ostestr.py @@ -209,7 +209,7 @@ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list -group_regex=([^\.]+\.)+ +group_regex=([^\\.]+\\.)+ """ with io.StringIO() as testrconf_data_file: testrconf_data_file.write(testrconf_data) @@ -221,7 +221,7 @@ group_regex=([^\.]+\.)+ # validate the discovery of the options from the legacy # .testr.conf self.assertEqual(parsed_values, ('mytestdir', None, - '([^\.]+\.)+')) + r'([^\.]+\.)+')) def test_parse_legacy_testrconf_topdir(self): '''Test parse_testrconf @@ -238,7 +238,7 @@ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list -group_regex=([^\.]+\.)+ +group_regex=([^\\.]+\\.)+ """ with io.StringIO() as testrconf_data_file: testrconf_data_file.write(testrconf_data) @@ -250,4 +250,4 @@ group_regex=([^\.]+\.)+ # validate the discovery of the options from the legacy # .testr.conf self.assertEqual(parsed_values, ('mytestdir', '..', - '([^\.]+\.)+')) + r'([^\.]+\.)+')) diff --git a/releasenotes/notes/drop-py-2-7-4a9c5b4ae0bbeb98.yaml b/releasenotes/notes/drop-py-2-7-4a9c5b4ae0bbeb98.yaml new file mode 100644 index 0000000..58ebc52 --- /dev/null +++ b/releasenotes/notes/drop-py-2-7-4a9c5b4ae0bbeb98.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Python 2.7 support has been dropped. Last release of os-testr + to support python 2.7 is 1.1.0. The minimum version of Python now + supported by os-testr is Python 3.6. diff --git a/setup.cfg b/setup.cfg index b1d5e69..cd2a81d 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/os-testr/latest/ +python-requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology @@ -13,11 +14,11 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: Implementation :: CPython [files] packages = @@ -30,11 +31,3 @@ console_scripts = subunit2html = os_testr.subunit2html:main generate-subunit = os_testr.generate_subunit:main -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 -warning-is-error = 1 - -[upload_sphinx] -upload-dir = doc/build/html diff --git a/setup.py b/setup.py index 566d844..f63cc23 100644 --- a/setup.py +++ b/setup.py @@ -16,14 +16,6 @@ # 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 01cca94..1ffe4a1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=2.0,<2.1 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 51cf78c..aca6e4b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,13 @@ [tox] -minversion = 2.0 -envlist = py27,py36,py37,pypy,pep8 -skipsdist = True +minversion = 3.1.1 +envlist = py36,py37,pypy,pep8 +# Need to set to False to have CHANGES generated +skipsdist = false +ignore_basepython_conflict = True [testenv] +basepython = python3 usedevelop = True -install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} OS_STDOUT_CAPTURE=1 @@ -21,15 +23,12 @@ commands = ostestr {posargs} [testenv:pep8] -basepython = python3 commands = flake8 [testenv:venv] -basepython = python3 commands = {posargs} [testenv:cover] -basepython = python3 setenv = VIRTUAL_ENV={envdir} PYTHON=coverage run --source os_testr --parallel-mode @@ -40,19 +39,17 @@ commands = coverage xml -o cover/coverage.xml [testenv:docs] -basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt -commands = python setup.py build_sphinx +commands = + sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html [testenv:debug] -basepython = python3 commands = oslo_debug_helper {posargs} [testenv:releasenotes] -basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt @@ -67,8 +64,9 @@ whitelist_externals = rm # E123, E125 skipped as they are invalid PEP-8. # E731 skipped as assign a lambda expression # H405 skipped as it wrongly recognizes a multiline string as docstring - +# W504 line break after binary operator (W503 and W504 are incompatible +# and we need to choose one of them. show-source = True -ignore = E123,E125,E731,H405 +ignore = E123,E125,E731,H405,W504 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build