Процесс выпуска Django¶
Официальные релизы¶
Начиная с версии 1.0, версии Django нумеруются следующим образом:
Номер версии выглядит как
A.BилиA.B.C.B- минорный номер версии, который увеличивается при большом объёме изменений, совместимых с предыдущими релизами. Код для Django 1.6 будет продолжать работать и под Django 1.7; исключения описаны в замечаниях к релизам.C- микро номер версии, который увеличивается по мере выпусков баг-фиксов. Он на 100% совместим с предыдущим выпуском, за исключением тех случаев, когда исправление безопасности невозможно без ёё нарушения. В любом случае это указано в замечании к релизу, в котором также приводятся рекомендации для обновления.Перед выпуском минорного релиза мы готовим альфа, бета и RC версии. Они обозначаются как
A.B alpha/beta/rc N, гдеNth- alpha/beta/rc версияA.B.
В git каждый релиз Django имеет свой тег, определяющий его номер, подписанный ключом. Также в репозитории каждый релиз находится в отдельной ветке под названием stable/A.B.x, а багфиксы выпускаются на основании уже этой ветки.
Дополнительную информацию о том, как проект Django выпускает новые выпуски в целях безопасности, см. в нашей политике безопасности.
- Официальные релизы¶
Минорные релизы (1.5, 1.6…) выходят каждые 9 месяцев согласно release process. В них добавляются новые возможности, всяческие улучшения и пр.
- Официальные релизы¶
Минорные релизы (1.5.1, 1.6.2, 1.6.1…) будут выпускаться по мере надобности, зачастую исправляя ошибки в безопасности.
Эти релизы на 100% совместимы с минорными версиями, если это не противоречит вопросам безопасности. Так что вы всегда можете обновляться без сомнений.
- Long-term support release¶
Certain feature releases will be designated as long-term support (LTS) releases. These releases will get security and data loss fixes applied for a guaranteed period of time, typically three years.
See the download page for the releases that have been designated for long-term support.
Цикл релиза¶
Starting with Django 2.0, version numbers will use a loose form of semantic versioning such that each version following an LTS will bump to the next «dot zero» version. For example: 2.0, 2.1, 2.2 (LTS), 3.0, 3.1, 3.2 (LTS), etc.
SemVer makes it easier to see at a glance how compatible releases are with each other. It also helps to anticipate when compatibility shims будет удален. It’s not a pure form of SemVer as each feature release will continue to have a few documented backwards incompatibilities where a deprecation path isn’t possible or not worth the cost. Also, deprecations started in an LTS release (X.2) will be dropped in a non-dot-zero release (Y.1) to accommodate our policy of keeping deprecation shims for at least two feature releases. Read on to the next section for an example.
Deprecation policy¶
В минорных релизах некоторые функции могут быть объявлены устаревшими. Если какая-то функциональность объявлена устаревшей в A.B, она будет работать в A.B, в A.B+1 вызывать исключение, а в A.B+2 уже удалена.
Так, например, если мы объявили функциональность устаревшей в Django 1.5:
В Django 1.5 будет добавлена обратная совместимость, вызывающая
PendingDeprecationWarning. Исключения этого типа по умолчанию не отображаются, но вы можете их включить, запустив Python с опцией-Wd.В Django 1.6 будет добавлена обратная совместимость, вызывающая полноправное исключение
DeprecationWarning. Это предупреждение достаточно громкое, чтобы начать вас раздражать.В Django 1.7 функциональность будет удалена.
The warnings are silent by default. You can turn on display of these warnings
with the python -Wd option.
A more generic example:
X.0
X.1
X.2 LTS
Y.0: Drop deprecation shims added in X.0 and X.1.
Y.1: Drop deprecation shims added in X.2.
Y.2 LTS: No deprecation shims dropped (while Y.0 is no longer supported, third-party apps need to maintain compatibility back to X.2 LTS to ease LTS to LTS upgrades).
Z.0: Drop deprecation shims added in Y.0 and Y.1.
See also the Депрекация функции guide.
Поддерживаемые версии¶
At any moment in time, Django’s developer team will support a set of releases to varying levels. See the supported versions section of the download page for the current state of поддержка each version.
The current development branch
mainwill get new features and bug fixes requiring non-trivial refactoring.Patches applied to the main branch must also be applied to the last feature release branch, to be released in the next patch release of that feature series, when they fix critical problems:
Вопросы безопасности.
Ошибки, ведущие к потере данных.
Падения приложения.
Опасные ошибки в новой функциональности.
Regressions from older versions of Django introduced in the current release series.
Согласно правилам, исправления будут портированы в последний минорный релиз, если ошибка является блокирующей дальнейшую разработку.
Security fixes and data loss bugs will be applied to the current main branch, the last two feature release branches, and any other supported long-term support release branches.
Исправления документации очень часто переносятся в ветку последнего релиза. Происходит это потому что выгодно иметь свежую и правильную документацию последнего выпуска, а риск проявления регрессии ничтожно мал.
Рассмотрим конкретный пример, когда мы находимся на полпути от Django 1.6 к Django 1.7:
Features will be added to the development main branch, to be released as Django 5.2.
Исправление критических ошибок будет применено к ветке
stable/1.6.xи выпущено под версиями 1.6.1, 1.6.2…Security fixes and bug fixes for data loss issues will be applied to
mainand to thestable/5.1.x,stable/5.0.x, andstable/4.2.x(LTS) branches. They will trigger the release of5.1.1,5.0.5,4.2.8, etc.Documentation fixes will be applied to main, and, if easily backported, to the latest stable branch,
5.1.x.
Процесс выпуска¶
У Django есть расписание выпуска минорных (1.6, 1.7…) релизов, согласно которому это происходит каждые 9 месяцев или больше в зависимости от новой функциональности.
After each feature release, the release manager will publish a timeline for the next feature release. The timeline for an upcoming feature release can be found in the corresponding wiki roadmap page, e.g. https://code.djangoproject.com/wiki/Version6.0Roadmap.
Feature release schedule and stages¶
Active development / Pre-feature freeze¶
Work begins on the feature release A.B after the feature freeze of the
previous release, i.e. when the stable/A.B-1.x branch is forked.
You can find the current branch under active development in the Django release process on Trac.
Feature freeze / Alpha release¶
All major and minor features, including deprecations and breaking changes, must be merged by the feature freeze. Any features not done by this point will be deferred to the next feature release.
At this point, the stable/A.B.x branch will be forked from main.
Non-release blocking bug fix freeze / Beta release¶
After the alpha, all bug fixes merged in main are also backported to
stable/A.B.x. Refactors are backported at the discretion of the merger.
Mergers will be more and more conservative with backports, to avoid introducing
regressions.
In parallel to this phase, main can continue to receive new features, to be
released in the A.B+1 cycle.
Translation string freeze / Release candidate release¶
If there is still a consistent stream of release blockers coming in at the planned release candidate date, a beta 2 will be released to encourage further testing and the release candidate date will be pushed out ~1 month.
The release candidate marks the string freeze, and it happens at least two weeks before the final release. Translators can then submit updated translations for inclusion in the final release. After this point, new translatable strings must not be added.
After the release candidate, only release blockers and documentation fixes are backported.
Final release¶
Ideally, the final release will ship two weeks after the last release candidate.
If there are major bugs still being found 2 weeks after the release candidate, there will be a decision on how to proceed (likely another release candidate would be issued and the final release date will be pushed out).
Релизы исправлений¶
После выпуска нового минорного релиза (например, 1.6), предыдущий переводится в состояние принятия исправлений.
The branch for the previous feature release (e.g. stable/A.B-1.x) will
include bugfixes. Critical bugs fixed on main must also be fixed on the
bugfix branch; this means that commits need to cleanly separate bug fixes from
feature additions. The developer who commits a fix to main will be
responsible for also applying the fix to the current bugfix branch.