#24562: django.utils.version.get_major_version() does not return the major
version
---------------------------+-------------------------------------
Reporter: shaib | Owner: timgraham
Type: Bug | Status: assigned
Component: Utilities | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------+-------------------------------------
Changes (by shaib):
* severity: Release blocker => Normal
Old description:
> Following the version bump to 1.8.1, we have failures on
> `test_unsupported_unpickle (queryset_pickle.tests.PickleabilityTestCase)`
> and `test_unsupported_unpickle
> (model_regress.test_pickle.ModelPickleTestCase)`. The problem is arguably
> in the test code: Both tests assume that
> `django.utils.version.get_major_version()` returns a `x.y` string, but
> that is only true for .0 minor versions -- and so the tests broke on the
> version bump to 1.8.1.
>
> I'm not quite sure about the fix --
> `django.utils.version.get_major_version()` looks like a public interface
> but it is not documented as far as I could see; it hasn't changed in a
> long time, but its return value is unintuitive, and I would expect the
> same as the author(s) of these tests.
New description:
`django.utils.version.get_major_version()` should returns a `x.y` string,
that is what we call a major version. It does that only for the ".0"
versions -- It returns "1.8" for 1.8, and "1.8.1" for 1.8.1.
I'm not quite sure about the fix --
`django.utils.version.get_major_version()` looks like a public interface
but it is not documented. Now that the tests have been fixed, its only use
in the Django code base is in the same file (from `get_version()`).
Should we just make it private?
--
Comment:
I see that the PR is already merged, so there are no longer test failures
and what's left is not a release blocker.
I updated the summary and description to focus on the issues left.
--
Ticket URL: <https://code.djangoproject.com/ticket/24562#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.83675bc79b504ffea0193b89d8543d1c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.