From ee807825049a75e1dd99f8e7609390800cd4c263 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Thu, 17 Feb 2022 14:33:49 +0900 Subject: [PATCH] Drop py36 and py37 support Python runtimes for Zed are 3.8, 3.9 and optionally 3.10 [1][2], so tox envs in tox.ini are updated accordingly. Declare python_requires >=3.8 in setup.cfg python_requires are declared in many projects during dropping python 2.7 support. It is good to follow the convention and it also clarifies our python interpreter requirement. This commit also cleans up python2.7 related stuffs in setup.py. Both are related to the supported versions of python, so I made both changes in a single commit. [1] https://governance.openstack.org/tc/reference/runtimes/zed.html [2] https://opendev.org/openstack/openstack-zuul-jobs/src/commit/b740b42fb199d4d695391aaaddf46ca55eab79ac/zuul.d/project-templates.yaml#L542 Change-Id: I4161816fd1fec19a3834cc7d994b3f761e1ab2ce Closes-Bug: #1960887 --- .zuul.d/xstatic-master.yaml | 2 +- setup.cfg | 3 +-- setup.py | 8 -------- tox.ini | 5 +++-- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.zuul.d/xstatic-master.yaml b/.zuul.d/xstatic-master.yaml index 0482fe88c0..b638ab6f06 100644 --- a/.zuul.d/xstatic-master.yaml +++ b/.zuul.d/xstatic-master.yaml @@ -27,7 +27,7 @@ - job: name: horizon-tox-py36-xstatic-master - parent: openstack-tox-py36 + parent: openstack-tox-py39 required-projects: *xstatic-projects - job: diff --git a/setup.cfg b/setup.cfg index 0c7a5578aa..76ead952f3 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/horizon/latest/ +python_requires = >=3.8 classifier = Development Status :: 5 - Production/Stable Environment :: OpenStack @@ -19,8 +20,6 @@ classifier = Programming Language :: Python Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Topic :: Internet :: WWW/HTTP diff --git a/setup.py b/setup.py index 566d84432e..0fa6510d88 100644 --- a/setup.py +++ b/setup.py @@ -13,16 +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'], diff --git a/tox.ini b/tox.ini index 9765f3449d..c40992e504 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.18.0 -envlist = pep8,py36,py39,releasenotes,npm,py3-dj32 +envlist = pep8,py39,releasenotes,npm,py3-dj32 skipsdist = True # Automatic envs (pyXX) will only use the python version appropriate to that # env and ignore basepython inherited from [testenv] if we set @@ -13,8 +13,9 @@ usedevelop = True setenv = VIRTUAL_ENV = {envdir} PYTHONDONTWRITEBYTECODE = 1 + # TODO(amotoki): There are three variants of PYTHONWARNINGS. They should be merged. PYTHONWARNINGS = once,ignore::PendingDeprecationWarning - py{3,36,37}:PYTHONWARNINGS = once,ignore::PendingDeprecationWarning,ignore::ImportWarning:backports + py{3,39}:PYTHONWARNINGS = once,ignore::PendingDeprecationWarning,ignore::ImportWarning:backports # DeprecationWarning is disabled in dj32 tox env as Django 3.2 # deprecated Django 2.2 features. This workaround is just to reduce # the number of warnings due to this change.