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

Django4 Compatibility #253

Closed
wants to merge 13 commits into from
Closed

Django4 Compatibility #253

wants to merge 13 commits into from

Conversation

fleur
Copy link

@fleur fleur commented Aug 17, 2022

This PR:

  • fixes most of the flake8 errors & ignores line too long & line break before and after binary operator
  • expands tox.ini to handle django up to 4.1 & python up to 3.10
  • 3 commits to make django-mailbox compatible with django4
  • revamps tox.ini to add github ci
  • fixes first 3 badges and test status link at bottom (please note the build badge will not work until a github ci run has completed)
  • fixed a couple deprecation messages seen in tox output

Since the build badge didn't link to anything current, I assumed the travis-ci integration was defunct. I realized after I did the github integration work that there was a PR in 2020 to fix it. Please let me know if you feel I should take out the github ci integration.

And from the list in #249:

  • updates classifiers in setup.py
  • updates CI to tests on Django 4.0, as mentioned above
  • updates docs to mark Django 4.0 compatibility
  • verifies if there is any pending migrations (answer: no)
  • please note does NOT update release note to mark Django 4.0
  • fixes any failing tests after CI update, as mentioned above

Also updated docs to remove travis-ci mentions.

…type-of-auto-created-primary-keys:

When defining a model, if no field in a model is defined with primary_key=True an implicit primary key is added. The type of this implicit primary key can now be controlled via the DEFAULT_AUTO_FIELD setting and AppConfig.default_auto_field attribute. No more needing to override primary keys in all models.

Maintaining the historical behavior, the default value for DEFAULT_AUTO_FIELD is AutoField.
* The purely documentational providing_args argument for Signal is deprecated. If you rely on this argument as documentation, you can move the text to a code comment or docstring.
…-encoding-force-text-and-smart-text:

The smart_text() and force_text() aliases (since Django 2.0) of smart_str() and force_str() are deprecated. Ignore this deprecation if your code supports Python 2 as the behavior of smart_str() and force_str() is different there.
@t-book
Copy link

t-book commented Nov 28, 2022

@coddingtonbear Why not merge for django 4 compatibility?

@coddingtonbear
Copy link
Owner

Could you, @t-book , and at least one other person, take the time to review this PR for errors and manually test that these changes do functionally work? A few things to check would include, but not be limited to:

  • Interactions in the admin.
  • Testing handling for different kinds of incoming mail handlers via the management command.

Copy link
Collaborator

@pfouque pfouque left a comment

Choose a reason for hiding this comment

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

@coddingtonbear , it LGTM!
Since the PR is one year old, it requires an update but apart from that everything looks fine!

Thanks @fleur

runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update based on the list of officially supported python versions:

Suggested change
python: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]

Comment on lines 48 to +54
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',

'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',

Comment on lines +3 to +8
3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

Comment on lines +13 to +17
py35-django{111,20,21,22}
py36-django{111,20,21,22,30,31,32}
py37-django{21,22,30,31,32}
py38-django{30,31,32,40,41}
py39-django{30,31,32,40,41}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
py35-django{111,20,21,22}
py36-django{111,20,21,22,30,31,32}
py37-django{21,22,30,31,32}
py38-django{30,31,32,40,41}
py39-django{30,31,32,40,41}
py38-django{30,31,32,40,41, 42}
py39-django{30,31,32,40,41, 42}
py310-django{30,31,32,40,41, 42}
py311-django{30,31,32,40,41, 42}
py312-django{30,31,32,40,41, 42}

django31: django==3.1.*
django32: django==3.2.*
django40: django==4.0.7
django41: django==4.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to keep deprecated django versions here?

Suggested change
django41: django==4.1
django41: django==4.1
django42: django==4.2

@@ -1,2 +1,2 @@
django>=3.1.1,<3.2
django>=3.1.1,<4.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
django>=3.1.1,<4.2
django>=3.1.1,<5.0

@Pietro395
Copy link
Collaborator

@coddingtonbear Could you merge this PR into a development branch so as to also have the recent changes regarding Office365?
We are ready to test it but we also need Office365 implementation

Thank you

Copy link

@ptav ptav left a comment

Choose a reason for hiding this comment

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

Tested this pull after merging with master (for o365 support). all seems to be working fine after resolving a single trivial conflict in .gitignore

Please incorporate into the master branch as a matter of urgency. Thank you

Copy link

@ptav ptav left a comment

Choose a reason for hiding this comment

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

Have tested successfully, including o365 functionality.

@Pietro395
Copy link
Collaborator

Pietro395 commented Dec 10, 2023

Have tested successfully, including o365 functionality.

Hi ptav, se have released the 4.9.0 version with django 4 and O365 support

Copy link

@ptav ptav left a comment

Choose a reason for hiding this comment

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

have tested after merging with master. Code is being use in production on our intranet webapp

@Pietro395 Pietro395 closed this Dec 10, 2023
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.

6 participants