From bced896d378239092f1a2dbaa204ed30d3da6682 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 28 Jan 2024 03:07:06 +0900 Subject: [PATCH] Remove workaround for old django-pyscss This reverts the change[1] made earlier to workaround the issue caused by usage of vendored version of six library in the django-pyscss library. The django-pyscss library no longer imports the vendored version of six, since 2.0.3[2]. [1] 39f28ad5edacc31575d1de4971de56d765567b58 [2] https://github.com/fusionbox/django-pyscss/commit/1499332e1dc702eb8eb586208de9d48228135381 Change-Id: I22802b75d6a8d8f35930709e89d64dd65982cef0 --- .pylintrc | 2 +- horizon/test/django_pyscss_fix/__init__.py | 24 ------------------- horizon/test/settings.py | 1 - .../django_pyscss_fix/__init__.py | 11 --------- requirements.txt | 3 +-- 5 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 horizon/test/django_pyscss_fix/__init__.py diff --git a/.pylintrc b/.pylintrc index 7ae204787b..a49f1d94ad 100644 --- a/.pylintrc +++ b/.pylintrc @@ -101,7 +101,7 @@ additional-builtins=_ [typecheck] # List of module names for which member attributes should not be checked -ignored-modules=six.moves,_MovedItems +ignored-modules= [reports] # Tells whether to display a full report or only the messages diff --git a/horizon/test/django_pyscss_fix/__init__.py b/horizon/test/django_pyscss_fix/__init__.py deleted file mode 100644 index 52ef028586..0000000000 --- a/horizon/test/django_pyscss_fix/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import sys - -import django -import six -import six.moves - -# Temporary workaround for a situation that django-pyscss depends on -# a vendored version of six, django.utils.six which was dropped in Django 3.0. -# TODO(amotoki): Drop the workaround once django-pyscss supports Django 3.0+. -if django.VERSION[0] >= 3: - sys.modules['django.utils.six'] = six - sys.modules['django.utils.six.moves'] = six.moves diff --git a/horizon/test/settings.py b/horizon/test/settings.py index 291fc65dbc..17031debba 100644 --- a/horizon/test/settings.py +++ b/horizon/test/settings.py @@ -51,7 +51,6 @@ INSTALLED_APPS = ( 'django.contrib.humanize', 'django.contrib.auth', 'django.contrib.contenttypes', - 'horizon.test.django_pyscss_fix', 'django_pyscss', 'compressor', 'horizon', diff --git a/openstack_dashboard/django_pyscss_fix/__init__.py b/openstack_dashboard/django_pyscss_fix/__init__.py index 6e8ba723de..4965e56d53 100644 --- a/openstack_dashboard/django_pyscss_fix/__init__.py +++ b/openstack_dashboard/django_pyscss_fix/__init__.py @@ -12,21 +12,10 @@ import logging import os -import sys - -import django -import six -import six.moves from django.conf import settings from scss.grammar.expression import SassExpressionScanner -# Temporary workaround for a situation that django-pyscss depends on -# a vendored version of six, django.utils.six which was dropped in Django 3.0. -# TODO(amotoki): Drop the workaround once django-pyscss supports Django 3.0+. -if django.VERSION[0] >= 3: - sys.modules['django.utils.six'] = six - sys.modules['django.utils.six.moves'] = six.moves scss_asset_root = os.path.join(settings.STATIC_ROOT, 'scss', 'assets') LOG = logging.getLogger(__name__) diff --git a/requirements.txt b/requirements.txt index a0ffcd19d9..aa8b4b55d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ debtcollector>=1.2.0 # Apache-2.0 Django>=4.2,<4.3 # BSD django-compressor>=2.4.1 # MIT django-debreach>=1.4.2 # BSD License (2 clause) -django-pyscss>=2.0.2 # BSD License (2 clause) +django-pyscss>=2.0.3 # BSD License (2 clause) futurist>=1.2.0 # Apache-2.0 iso8601>=0.1.11 # MIT keystoneauth1>=4.3.1 # Apache-2.0 @@ -43,7 +43,6 @@ python-swiftclient>=3.2.0 # Apache-2.0 pytz>=2013.6 # MIT PyYAML>=6.0 # MIT requests>=2.25.1 # Apache-2.0 -six>=1.16.0 # MIT semantic-version>=2.3.1 # BSD XStatic>=1.0.3 # MIT License XStatic-Angular>=1.8.2.2 # MIT License