Skip to content

Commit

Permalink
fix: exclude adding support for django 4.0 and 4.1 (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Jul 4, 2023
1 parent 153d3f5 commit 019ce9e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion edx_repo_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = '0.8.1'
__version__ = '0.8.2'
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import click
from edx_repo_tools.utils import YamlLoader

ALLOWED_DJANGO_VERSIONS = ['django32', 'django40', 'django41', 'django42']
ALLOWED_DJANGO_VERSIONS = ['django32', 'django42']


class GithubCIModernizer(YamlLoader):
Expand Down
10 changes: 2 additions & 8 deletions edx_repo_tools/codemods/django42/tox_moderniser_django42.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
TEST_ENV_SECTION = "testenv"
TEST_ENV_DEPS = "deps"
PYTHON_SUBSTITUTE = "py38"
DJANGO_SUBSTITUTE = "django{32,40, 41,42}"
DJANGO_SUBSTITUTE = "django{32, 42}"

DJANGO_40_DEPENDENCY = "django40: Django>=4.0,<4.1\n"
DJANGO_41_DEPENDENCY = "django41: Django>=4.1,<4.2\n"
DJANGO_42_DEPENDENCY = "django42: Django>=4.2,<4.3\n"
NEW_DJANGO_DEPENDENCIES = DJANGO_40_DEPENDENCY + DJANGO_42_DEPENDENCY
NEW_DJANGO_DEPENDENCIES = DJANGO_42_DEPENDENCY

SECTIONS = [TOX_SECTION, TEST_ENV_SECTION]

Expand Down Expand Up @@ -79,10 +77,6 @@ def _replace_matches(pattern, substitute, target, matches):
# checking if there is any dependency for django32 dont override it
if matches[0].startswith('django32:'):
substitute = matches[0]
if 'django40:' not in target:
substitute += DJANGO_40_DEPENDENCY
if 'django41:' not in target:
substitute += DJANGO_41_DEPENDENCY
if 'django42:' not in target:
substitute += DJANGO_42_DEPENDENCY
target = re.sub(pattern, substitute, target)
Expand Down

0 comments on commit 019ce9e

Please sign in to comment.