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: do not define django_app_config #259

Merged

Conversation

DanielVZ96
Copy link
Contributor

@DanielVZ96 DanielVZ96 commented Oct 25, 2023

Description:

Newer django versions throw the following warning: RemovedInDjango41Warning: 'completion' defines default_app_config = 'completion.apps.CompletionAppConfig'. Django now detects this configuration automatically. You can remove default_app_config., and it clutters edx-platform logs. This PR avoids defining it when django.VERSION < 3.2

Related issue: openedx/edx-platform#33572

Installation instructions: List any non-trivial installation
instructions.

Testing instructions:

  • create and activate a virtual environment using python 3.8.17
  • run make install
  • run pytest -k "DefaultAppConfig" --no-cov -vand make sure test_not_defined passes

Reviewers:

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

Post merge:

  • Create a tag
  • Check new version is pushed to PyPi after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 25, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 25, 2023

Thanks for the pull request, @DanielVZ96! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@mphilbrick211
Copy link

Hi @DanielVZ96! Thank you for this contribution! Please let me know if you have any questions regarding submitting a CLA form.

Note, if you are not contributing as an individual, and are contributing on behalf of an organization, please let me know as the CLA process is a bit different in that case.

Comment on lines 9 to 10
if django.VERSION < (3, 2):
default_app_config = 'completion.apps.CompletionAppConfig' # pylint: disable=invalid-name
Copy link
Member

Choose a reason for hiding this comment

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

We no longer need to support Django versions older than 3.2.

@e0d
Copy link

e0d commented Oct 26, 2023

@DanielVZ96
Hi, we need to have a valid Contributor License Agreement (CLA) in place for all contributions. See the welcome message above for the details about how to enroll. The process is different depending upon whether you are making this contribution as an individual or on behalf of your employer.

It also looks like there are some test failures that need attention.

@DanielVZ96
Copy link
Contributor Author

DanielVZ96 commented Oct 26, 2023

Hi @e0d, i'm already in the process to sign it. Had some linting issues and an issue with the format of the pytest.ini file. should be better now. i'm using https://github.com/nektos/act to run CI locally for now

@DanielVZ96 DanielVZ96 changed the title fix: define django_app_config if django version < 3.2 fix: do not define django_app_config Oct 26, 2023
@DanielVZ96 DanielVZ96 force-pushed the dvz/fix-django-app-config-deprecation branch from 1ac827c to 814319b Compare October 26, 2023 22:47
completion/__init__.py Outdated Show resolved Hide resolved
completion/__init__.py Outdated Show resolved Hide resolved
completion/tests/test_compatibility.py Outdated Show resolved Hide resolved
@mphilbrick211 mphilbrick211 removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Oct 27, 2023
@DanielVZ96 DanielVZ96 force-pushed the dvz/fix-django-app-config-deprecation branch from 814319b to 7d30f4e Compare October 28, 2023 02:54
@DanielVZ96 DanielVZ96 force-pushed the dvz/fix-django-app-config-deprecation branch from 7d30f4e to 1222a4b Compare October 28, 2023 02:57
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: checked that the warning is gone
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a

@Agrendalath
Copy link
Member

@pkulkark, would you like to review this as the CC? The only thing needed for testing this is checking that the RemovedInDjango41Warning warning is not present in the Tests CI logs (e.g., "django32-drf314").

Copy link

@pkulkark pkulkark left a comment

Choose a reason for hiding this comment

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

@DanielVZ96 @Agrendalath LGTM 👍. I verified that there were no RemovedInDjango41Warning in any of the CI tests. I did notice a couple of RemovedInDjango51Warning like this:

/home/runner/work/completion/completion/.tox/django42-drf314/lib/python3.8/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'completion.BlockCompletion' instead.

But I suppose that'll be tackled when we upgrade to django 5.

@pkulkark pkulkark merged commit 8546b13 into openedx:master Nov 3, 2023
9 checks passed
@openedx-webhooks
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants