Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Update Django to 3.2, remove or update package constraints#128

Merged
bradenmacdonald merged 6 commits intomasterfrom
symbolist/update-versions
Oct 8, 2021
Merged

Update Django to 3.2, remove or update package constraints#128
bradenmacdonald merged 6 commits intomasterfrom
symbolist/update-versions

Conversation

@symbolist
Copy link
Contributor

@symbolist symbolist commented Sep 29, 2021

Description

  • Upgrades to the latest LTS version of Django
  • Some other unneeded constraints (which had been set a while ago) have also been removed.
  • Removes the corheaders app + set up.

Ticket

Author Comments, Concerns, and Open Questions

None.

Test Instructions

  • Test you are able to create, update and delete atomic and composite XBlocks via the LX devstack.
  • Test file uploads to bundles work as well.

@openedx-webhooks
Copy link

Thanks for the pull request, @symbolist! I've created OSPR-6082 to keep track of it in JIRA.

As a core committer in this repo, you can merge this once the pull request is approved per the core committer reviewer requirements and according to the agreement with your edX Champion.

@openedx-webhooks openedx-webhooks added core committer open-source-contribution PR author is not from Axim or 2U waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Sep 29, 2021
@natabene
Copy link

@symbolist Thank you for your contribution. Would @bradenmacdonald be interested in reviewing?

@bradenmacdonald
Copy link
Contributor

@natabene @symbolist Sure, I can review - just let me know when it's ready.

@symbolist symbolist mentioned this pull request Sep 30, 2021
@symbolist symbolist force-pushed the symbolist/update-versions branch 7 times, most recently from 06bb859 to 0da0788 Compare October 5, 2021 12:19
@symbolist symbolist force-pushed the symbolist/update-versions branch from 0da0788 to 18d15d7 Compare October 5, 2021 13:53
@symbolist symbolist force-pushed the symbolist/update-versions branch from 18d15d7 to a62a33e Compare October 5, 2021 18:00
@symbolist
Copy link
Contributor Author

I tried running this on the LX CI and there were a few test failures. They did seem unrelated but still investigating them.

@symbolist symbolist changed the title Remove or update package constraints Update Django to 3.2, remove or update package constraints Oct 6, 2021
Copy link
Contributor Author

@symbolist symbolist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradenmacdonald This is ready for review (see also comment on ticket).

CC @natabene

python3-pip \
python3-venv
python3-venv \
wget
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for the make upgrade command.

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
sed 's/Django<2.3//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove this line to update to Django 3.2 which is specified in constraints.txt.

) for (lookup_url_kwarg, lookup_value_regex) in zip(lookup_url_kwargs, lookup_value_regexes)
f'(?P<{lookup_prefix}{lookup_url_kwarg}>{lookup_value_regex})' for (
lookup_url_kwarg, lookup_value_regex
) in zip(lookup_url_kwargs, lookup_value_regexes)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few conversions to f-strings because of quality issues raised by pylint version upgrade.

def get_alternative_name(self, name):
return default_storage.get_alternative_name(name)
def get_alternative_name(self, file_root, file_ext):
return default_storage.get_alternative_name(file_root, file_ext)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A parameter was added in Django 3. Though this method does not seem to be in use in this package.

from django.db import migrations, models


class Migration(migrations.Migration):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added by upgrade to Django 3.2. The only change seems to be the change in max_length.

django
django-cors-headers
django-environ-2
django-environ
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched back to django-environ.

This was earlier changed in #121.

# Not yet using Django 3.X. Using the 2.X LTS to mirror the LMS.
django>2.2,<2.3

django-cors-headers>=2.2.0,<2.3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed so has been removed.

django-environ-2==2.1.0

django-filter==2.1.0
django>3.2,<3.3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There don't seem to be any backwards incompatible changes relevant to this repo:

https://docs.djangoproject.com/en/3.2/releases/3.0/#backwards-incompatible-changes-in-3-0

# via
# -c requirements/constraints.txt
# -r requirements/base.in
django-environ==0.7.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally pinned to v.0.4.5

There don't seem to be any backwards incompatible changes between 0.4.5 and 0.7.0: https://github.com/joke2k/django-environ/blob/main/CHANGELOG.rst

# -r requirements/base.in
django-environ==0.7.0
# via -r requirements/base.in
django-filter==21.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constraint on this has been removed. Though there do not seem to be any backwards incompatible changes since 2.1.0: https://github.com/carltongibson/django-filter/blob/main/CHANGES.rst

@symbolist
Copy link
Contributor Author

CC @kdmccormick Just a heads up that this will be coming your way for a deploy. 🙂

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me. Thanks!

I did encounter one issue with make easyserver, but it seems unrelated to this PR: the default docker-compose project name is now blockstore3.8 but docker sometimes interprets it as blockstore3 (ignoring parts after the .) which causes enough consistency errors to stop everything from working. I could only get the server running by using BLOCKSTORE_PROJECT_NAME=blockstore38 make easyserver

  • I tested this: some basic read+write tests using frontend-app-library-authoring, also confirmed LX test suite is passing
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation

@bradenmacdonald bradenmacdonald merged commit 95de3d2 into master Oct 8, 2021
@bradenmacdonald bradenmacdonald deleted the symbolist/update-versions branch October 8, 2021 00:41
@openedx-webhooks openedx-webhooks removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Oct 8, 2021
@openedx-webhooks
Copy link

@ormsbee, @kdmccormick: thought you might like to know that symbolist merged this pull request.

@openedx-webhooks
Copy link

@symbolist 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

samuelallan72 added a commit to open-craft/blockstore that referenced this pull request Oct 29, 2021
Using a period in the docker-compose project name has been observed to cause issues.
For example: openedx-unsupported#128 (review)
So, normalize all references to 3.8 to 38.
This fixes the issue, and still retains the filenaming linked with the python version used.
samuelallan72 added a commit to open-craft/blockstore that referenced this pull request Oct 29, 2021
Using a period in the docker-compose project name has been observed to cause issues.
For example: openedx-unsupported#128 (review)
So, normalize all references to 3.8 to 38.
This fixes the issue, and still retains the filenaming linked with the python version used.
samuelallan72 added a commit to open-craft/blockstore that referenced this pull request Oct 29, 2021
Using a period in the docker-compose project name has been observed to cause issues
when using docker-compose 2.0.
For example: openedx-unsupported#128 (review)
So, normalize all references to 3.8 to 38.
This fixes the issue, and still retains the filenaming linked with the python version used.
samuelallan72 added a commit to open-craft/blockstore that referenced this pull request Nov 1, 2021
Using a period in the docker-compose project name has been observed to cause issues
when using docker-compose 2.0.
For example: openedx-unsupported#128 (review)
So, normalize all references to 3.8 to 38.
This fixes the issue, and still retains the filenaming linked with the python version used.
girish946 pushed a commit to open-craft/blockstore that referenced this pull request Dec 23, 2021
Using a period in the docker-compose project name has been observed to cause issues
when using docker-compose 2.0.
For example: openedx-unsupported#128 (review)
So, normalize all references to 3.8 to 38.
This fixes the issue, and still retains the filenaming linked with the python version used.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants