Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exclude adding support for django 4.0 and 4.1 #409

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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