Skip to content

Conversation

@mtyaka
Copy link
Member

@mtyaka mtyaka commented Sep 22, 2021

This updates the tests so that they run in an environment with Django 3.2.
It also fixes a few deprecation warnings.

Note: this also incorporates updates from #332.

Test instructions:

  1. Verify that the automated tests succeed on python3.8 / Django 3.2
  2. Verify that the XBlock works correctly in xblock-sdk with Django 3.2

@mtyaka mtyaka force-pushed the mtyaka/FAL-2198-django3.2 branch 4 times, most recently from edd359d to e8d4534 Compare September 28, 2021 07:16
@mtyaka mtyaka force-pushed the mtyaka/FAL-2198-django3.2 branch 4 times, most recently from eed95a0 to 400d465 Compare September 29, 2021 08:45
@mtyaka mtyaka force-pushed the mtyaka/FAL-2198-django3.2 branch from 400d465 to 91ca0ff Compare September 29, 2021 08:54
@mtyaka mtyaka force-pushed the mtyaka/FAL-2198-django3.2 branch from 8470f64 to f87eaa7 Compare September 29, 2021 09:59
@mtyaka mtyaka force-pushed the mtyaka/FAL-2198-django3.2 branch 5 times, most recently from 6775b9e to f422dfc Compare September 30, 2021 09:16
@mtyaka mtyaka force-pushed the mtyaka/FAL-2198-django3.2 branch from f422dfc to 59f5a18 Compare October 1, 2021 05:57
@mtyaka mtyaka changed the title WIP: Django 3.2 support Django 3.2 support Oct 1, 2021
@mtyaka mtyaka changed the title Django 3.2 support [FAL-2198] Django 3.2 support Oct 1, 2021
Copy link
Member

@xitij2000 xitij2000 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! just one minor issue I see.

I'm testing this right now.

Comment on lines -6 to 15
- ar # Arabic
- es_419 # Spanish
- pt_BR # Portuguese
- zh_CN # Chinese
- es-419 # Spanish
- pt-br # Portuguese
- zh-cn # Chinese
- fr # French
- fr_CA # French (Canada)
- de_DE # German
- ja_JP # Japanese
- pl_PL # Polish
- ko_KR #Korean
- fr-ca # French (Canada)
- de-de # German
- ja-jp # Japanese
- pl-pl # Polish
- ko-kr #Korean
# Add languages here as needed
Copy link
Member

Choose a reason for hiding this comment

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

I think the original names were what are used for edx-platform so we should stay consistent with that: https://github.com/edx/edx-platform/blob/0935b5c51fa4115caa6d6d98b0ef65fea4fcdec1/conf/locale/config.yaml#L9-L91

Copy link
Member Author

Choose a reason for hiding this comment

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

@xitij2000 Django3.2 refused to start with the original names. It would throw this error.

I looked at the LANGUAGES setting in edx-platform and they do use the django3.2 compatible names, so I thought it was ok to change this, but I don't really know how translations work with this XBlock.

I didn't test whether translations are working - I don't know if that's possible to do inside xblock-sdk.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's possible with xblock-sdk, but I've done it a lot, so I'll have a quick look with one of the affected languages.

Copy link
Member

Choose a reason for hiding this comment

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

es-419:
Screenshot 2021-10-01 at 09-40-54 Subsection Section Problem Builder Test edX

ja-jp:
Screenshot 2021-10-01 at 09-38-58 Subsection Section Problem Builder Test edX

Seems to be working :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Great, thanks a lot for checking :)

It's not used anywhere else and doesn't have to be configurable.
@mtyaka mtyaka force-pushed the mtyaka/FAL-2198-django3.2 branch from e46eb0c to b755331 Compare October 1, 2021 09:29
Copy link
Member

@xitij2000 xitij2000 left a comment

Choose a reason for hiding this comment

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

👍
Currently, PB_LANGUAGE_JS_DIRECTORY_MAP is imported from settings and it imports workbench.setting which isn't available on edx-platform. So we should move PB_LANGUAGE_JS_DIRECTORY_MAP to a place where it can be imported from both places, without importing settings.
Other than that, there is one more issue I see:

problem-builder-styling-issue.mp4

The styling is a bit off. However, since there have been a lot of changes in the platform recently, we can leave this to a separate task. It might also just be an issue with the master release and not the current release.

  • I tested this: (describe what you tested)
  • I read through the code
  • [na] I checked for accessibility issues (no changes)
  • Includes documentation
  • [na] I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@saksham115
Copy link

@mtyaka when I am running make requirements inside the xblock-sdk submodule, my django version is reverted back to 2.2

Am i missing something? My submodule version that is being shown is c1384a5b6e058a5f15b231013414f859e9924008

@mtyaka
Copy link
Member Author

mtyaka commented Oct 1, 2021

when I am running make requirements inside the xblock-sdk submodule, my django version is reverted back to 2.2

@saksham115 Yeah, that's a bit of a mess currently. While xblock-sdk does support Django3.2 via tox, it still defaults to 2.2. You can try manually force-installing Django3.2 in your virtualenv (replacing the 2.2 installation).

@saksham115
Copy link

when I am running make requirements inside the xblock-sdk submodule, my django version is reverted back to 2.2

@saksham115 Yeah, that's a bit of a mess currently. While xblock-sdk does support Django3.2 via tox, it still defaults to 2.2. You can try manually force-installing Django3.2 in your virtualenv (replacing the 2.2 installation).

Yeah, that's what I did later (manually installing Django3.2). Cool, glad to know that was the correct approach.

Copy link

@saksham115 saksham115 left a comment

Choose a reason for hiding this comment

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

👍🏻

Did the steps mentioned in the testing instructions, with force-installing Django3.2 after the sdk installation

  • I tested this, as per the testing methods and the steps defined in README
  • I read through the code
  • Includes documentation

One small suggestion (Don't know if it fits here or not):

  • Maybe include the, git submodule update --init step in the readme to fetch the xblock-sdk (Not a blocker for merge)

@mtyaka mtyaka merged commit 95aea4d into master Oct 1, 2021
@mtyaka mtyaka deleted the mtyaka/FAL-2198-django3.2 branch October 1, 2021 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants