Skip to content

Conversation

pedro-psb
Copy link
Member

@pedro-psb pedro-psb commented Sep 9, 2025

Compatibility findings

@mdellweg
Copy link
Member

shell auto-import new behavior:

* https://docs.djangoproject.com/en/5.2/howto/custom-shell/

* Now a `pulpcore-manaer shell` call auto-imports models and other stuff (like shell_plus). The problem is that it prints a message to stdout which breaks our trick of using it to get values from the database in the tests.

* An alternative is to globally disable, which is shown in the link.

We may be using that "trick" in more places... Can't they make the imports silent?

@pedro-psb
Copy link
Member Author

The docs show how to disable it globally. I'll see how that goes

@pedro-psb pedro-psb changed the title Bump django to django==5.2 [PULP-807] Bump django to django==5.2 Sep 12, 2025
pyproject.toml Outdated
"django-filter>=23.1,<=25.1", # Looks like CalVer.
"django-guid>=3.3.0,<3.6", # Looks like only bugfixes in z-Stream.
"Django~=5.2.0", # LTS version, switch only if we have a compelling reason to".
"django-filter>=25.1,<26", # Looks like CalVer.
Copy link
Member

Choose a reason for hiding this comment

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

Please don't change the version requirements as if they were following semver. They are not...

@pedro-psb pedro-psb marked this pull request as ready for review September 15, 2025 16:39
@pedro-psb pedro-psb changed the title [PULP-807] Bump django to django==5.2 [PULP-807] Add changes required for Django 5 Sep 15, 2025
@pedro-psb pedro-psb force-pushed the django5-bump branch 3 times, most recently from 7d88870 to 501ba23 Compare September 15, 2025 17:03
pyproject.toml Outdated
"Django~=4.2.0", # LTS version, switch only if we have a compelling reason to".
"django-filter>=23.1,<=25.1", # Looks like CalVer.
"django-guid>=3.3.0,<3.6", # Looks like only bugfixes in z-Stream.
"django-filter~=25.1", # Self claimed stable CalVer https://github.com/carltongibson/django-filter
Copy link
Member

Choose a reason for hiding this comment

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

"Other breaking changes are rare." What I hear is: "We make no guarantees about changes tied to specific types of version changes." But also "You can probably expect 1 or 2 releases per year." (not like we need to touch this line every other week.)

I would argue we are better off to keep the "<=" upper bound.

Having said that, i think what we agreed to try now is: Not touching any LB here, and still allowing to up the django version UB to 5.2.

And now a very wild idea: Given that these changes are really minimal, how do you feel about backporting this version bump?

Copy link
Member Author

Choose a reason for hiding this comment

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

Having said that, i think what we agreed to try now is: Not touching any LB here, and still allowing to up the django version UB to 5.2.

I see, that was not clear to me, but it sounds fine.

And now a very wild idea: Given that these changes are really minimal, how do you feel about backporting this version bump?

We can try and see what happens. You mean all of it? The django 5 upperbound, the shell command override, and the other bumps?

Copy link
Member

Choose a reason for hiding this comment

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

Basically if we can make upgrading Django less of a hassle for everybody, we all win...
For that I'd say this PR should only bump upper bounds of requirements (Probably really only Django) and contain this other two small adjustments you made (that seem to be compatible with Django4 anyway.)

And then we can think about backporting it.

@pedro-psb pedro-psb force-pushed the django5-bump branch 2 times, most recently from 4ca6a89 to 56922a0 Compare September 16, 2025 17:10
Comment on lines 35 to 36
"Django~=4.2.0", # LTS version, switch only if we have a compelling reason to".
"django-filter>=23.1,<=25.1", # Looks like CalVer.
"Django>=4.2.0,<=5.2.0", # LTS version, switch only if we have a compelling reason to".
"django-filter>=23.1,<=25.1", # Uses CalVer, not released often https://github.com/carltongibson/django-filter
Copy link
Member

Choose a reason for hiding this comment

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

That's perfect. Thank you!
It reminds me that we still haven't looked up all dependencies versioning philosophies.

@pedro-psb
Copy link
Member Author

Lowerbound fails under its set of dependencies. I'm trying to isolate what exactly locally.
And just a note, probably its known already: our unit tests are a bit fragile in terms of leaking. If we use pytest-random-order we'll get different set of failures at each run.

The changes were tested against Django 5 but are compatible
with Django 4:

* bump django-guid
* bump django-filter
* shell.Command override

Co-authored-by: Matthias Dellweg <[email protected]>

 Please enter the commit message for your changes. Lines starting
@pedro-psb
Copy link
Member Author

That was intriguing... Thanks for the suggestion!

@pedro-psb pedro-psb merged commit 70c670b into pulp:main Sep 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants