summaryrefslogtreecommitdiff
path: root/django/utils/version.py
AgeCommit message (Collapse)Author
2026-04-08Removed PY38 and PY39 version constants.Jacob Walls
As the oldest supported version is Django 5.2, we only need constants for PY310+.
2025-11-20Fixed #36321 -- Defaulted suggest_on_error=True in management commands.kihuni
Python 3.15 defaults suggest_on_error=True, but the feature is available from 3.14, so this change opts in earlier. This change can be reverted when Python 3.15 is the minimum supported version.
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2024-10-25Refs #35844 -- Corrected expected error messages in commands tests on Python ↵Tainara Palmeira
3.14+. Updated CommandTests.test_subparser_invalid_option and CommandDBOptionChoiceTests.test_invalid_choice_db_option to address changes in Python 3.14+ error handling.
2024-05-16Removed PY36 and PY37 version constants.Sarah Boyce
As the oldest supported version is Django 4.2, we only need constants for PY38+. Thank you to Mariusz Felisiak for the review.
2024-02-20Refs #34900 -- Fixed ↵Mariusz Felisiak
CommandTypes.test_help_default_options_with_custom_arguments test on Python 3.13+. https://github.com/python/cpython/commit/c4a2e8a2c5188c3288d57b80852e92c83f46f6f3
2023-11-27Refs #34986 -- Added django.utils.version.PYPY.Nick Pope
2023-04-05Refs #34118 -- Fixed CustomChoicesTests.test_uuid_unsupported on Python 3.12+.Mariusz Felisiak
https://github.com/python/cpython/commit/2a4d8c0a9e88f45047da640ce5a92b304d2d39b1
2022-02-19Refs #33173 -- Fixed MailTests.test_backend_arg() on Windows and Python 3.11+.David Smith
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-09-27Refs #32355 -- Used @functools.lru_cache as a straight decorator.Mariusz Felisiak
2021-09-27Refs #32355 -- Modernized subprocess.run() calls.Adam Johnson
2021-05-12Fixed #32366 -- Updated datetime module usage to recommended approach.Nick Pope
- Replaced datetime.utcnow() with datetime.now(). - Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp(). - Replaced datetime.utctimetuple() with datetime.timetuple(). - Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
2021-04-09Refs #32074 -- Removed usage of Python's deprecated distutils.version package.Mariusz Felisiak
The distutils package was formally deprecated in Python 3.10 and will be removed in Python 3.12.
2021-04-01Fixed #32316 -- Deferred accessing __file__.William Schwartz
Deferred accessing the module-global variable __file__ because the Python import API does not guarantee it always exists—in particular, it does not exist in certain "frozen" environments. The following changes advanced this goal. Thanks to Carlton Gibson, Tom Forbes, Mariusz Felisiak, and Shreyas Ravi for review and feedback.
2021-04-01Fixed #32610 -- Fixed get_git_changeset() on Linux.Mariusz Felisiak
shell=True is required on Windows. Unfortunately passing a sequence to subprocess.run() behaves differently on Linux, i.e. the first item specifies the command string, and any additional items are treated as additional arguments to the shell itself. https://docs.python.org/3.9/library/subprocess.html#subprocess.Popen https://docs.python.org/3.9/library/subprocess.html#converting-an-argument-sequence-to-a-string-on-windows Regression in a44d80f88e22eda24dacef48e368895ebea96635.
2021-03-02Refs #21429 -- Added SimpleTestCase.assertNoLogs() on Python < 3.10.François Freitag
2021-02-10Refs #32355 -- Restored PY36 and PY37 version constants.Carlton Gibson
Partially reverts ec0ff406311de88f4e2a135d784363424fe602aa. PY36 should be removed when Django 2.2 is EOL. PY37 should be removed when Django 3.2 is EOL. Thanks to Tim Graham for the report.
2021-02-10Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak
2019-08-28Adjusted subprocess.run() calls to use arg list, rather than string. Jon Dufresne
The Python docs recommend passing a sequence to subprocess.run() when possible. Doing so allows for automatic escaping and quoting of arguments. https://docs.python.org/3/library/subprocess.html#frequently-used-arguments > args is required for all calls and should be a string, or a sequence > of program arguments. Providing a sequence of arguments is generally > preferred, as it allows the module to take care of any required > escaping and quoting of arguments (e.g. to permit spaces in file > names). Also removed `shell=True` where unnecessary.
2019-08-23Replaced subprocess commands by run() wherever possible.Claude Paroz
2017-10-13Fixed #28708 -- Added constants to detect the Python version.Tim Graham
2017-06-13Fixed #27830 -- Used distutils.version.LooseVersion for version parsing.chillaranand
2017-02-11Refs #27656 -- Updated django.utils docstring verbs according to PEP 257.Anton Samarchyan
2017-01-20Refs #23919 -- Removed unneeded str() callsClaude Paroz
2017-01-18Refs #23919 -- Stopped using django.utils.lru_cache().Aymeric Augustin
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-01-13Refs #25769 -- Updated docs to reflect get_version() uses PEP 0440.Tim Graham
2015-11-19Fixed #25769 -- Updated get_version() release candidate naming for PEP 0440.Tim Graham
2015-04-06Fixed #24562 -- Renamed get_major_version() to get_main_version()Tim Graham
This reflects the actual behavior of the method.
2014-12-25Fixed #23866 -- Harmonized refs to Django documentation from codeClaude Paroz
2014-08-23Fixed #22867 -- Memoized django.utils.version.get_git_changeset().Tim Graham
Restored original fix that had to be removed because the old djangoproject server was still using Python 2.6.
2014-08-04Fixed a typo in comment in django/utils/version.pySitesh Shrivastava
2014-06-23Fixed #22867 -- Memoized django.utils.version.get_git_changeset().Loic Bistuer
This follows commits 80f4487 and 01399fa; original patch had to be reverted because it wasn't Python 2.6 compatible and we need it to be in order to build docs on the djangoproject.com server. This fix should be replaced by @lru_cache as soon as we drop Python 2.6 compatibility. Thanks Florian Apolloner for the review and Alexander Schepanovski for the original patch.
2014-06-19Revert "Fixed #22867 -- Memoized django.utils.version.get_git_changeset()."Aymeric Augustin
This reverts commit 80f4487 temporarily, because that commit prevented the djangoproject.com server from building the docs, because it still uses Python 2.6.
2014-06-19Fixed #22867 -- Memoized django.utils.version.get_git_changeset().Alexander Schepanovski
This improves pickling speed in prelease versions of Django; refs #21430.
2014-06-11Fixed #21430 -- Added a RuntimeWarning when unpickling Models and QuerySets ↵Anubhav Joshi
from a different Django version. Thanks FunkyBob for the suggestion, prasoon2211 for the initial patch, and akaariai, loic, and charettes for helping in shaping the patch.
2013-11-02More attacking E302 violatorsAlex Gaynor
2012-10-25Ensured get_version returns a native string.Aymeric Augustin
Returning unicode triggers a bug in Python 2.7: http://bugs.python.org/issue11638 This problem was introduced in 4a103086 (unicode_literals).
2012-06-08Used git log instead of git show for last commit's timestampAnssi Kääriäinen
The reason for this was that git show included the whole changeset in the output, but only the UTC timestamp was needed. By using git log it is possible to get just the timestamp. The whole changeset can be large, and can cause unicode encoding errors.
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-04-29Moved version code out of __init__.py.Adrian Holovaty
Moved everything except VERSION and a get_version() stub out of the top-level __init__.py, so that we're not importing all that stuff all the time. And because it's cleaner.
2012-04-29Fixed #18224 -- Changed the dev version number.Aymeric Augustin
Following the move from SVN to git.
2011-07-13Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for ↵Jannis Leidel
the work on the patch and Alex for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-03Fixed #10372: made `get_svn_revision()` more robust. Thanks, mboersma.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10377 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-24Fixed #5237 -- Added an optional 'path' argument to get_svn_revision(). ↵Adrian Holovaty
Thanks, django@poelzi.org git-svn-id: http://code.djangoproject.com/svn/django/trunk@5995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-21Fixed #5215 -- Added Subversion revision number to Django version string. ↵Adrian Holovaty
Thanks for the patch, Deryck Hodge git-svn-id: http://code.djangoproject.com/svn/django/trunk@5990 bcc190cf-cafb-0310-a4f2-bffc1f526a37