Opened 10 years ago
Closed 10 years ago
#24562 closed Cleanup/optimization (fixed)
django.utils.version.get_major_version() does not return the major version
Reported by: | Shai Berger | Owned by: | Tim Graham |
---|---|---|---|
Component: | Utilities | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
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?
Change History (6)
comment:1 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 10 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 10 years ago
Description: | modified (diff) |
---|---|
Severity: | Release blocker → Normal |
Summary: | Test failure: Pickleability → django.utils.version.get_major_version() does not return the major version |
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.
comment:4 by , 10 years ago
Has patch: | unset |
---|
Sorry, you created the ticket after I submitted the PR and I forgot to update the commit message. Anyway, yes, I think we could just revert the addition of the get_major_version()
method as it was added in the same commit as the tests that used it (42736ac8e8c31137131714013951249a09e6e7d4).
comment:5 by , 10 years ago
Has patch: | set |
---|---|
Type: | Bug → Cleanup/optimization |
Well, it might be useful to leave the method but rename it to reflect its behavior: PR.
PR