29
loading...
This website collects cookies to deliver better user experience
3.2.9
. In semantic versioning, the first number is the major version, the second is the minor version, and the third is a patch version: MAJOR.MINOR.PATCH
. MAJOR
version introduces backward incompatible features.MINOR
version adds functionality that is backward compatible.PATCH
version is for backward-compatible bug fixes.alpha
, beta
, release candidates rc1
, rc2
, etc., but we will not cover them in this post.myapp/__init__.py
file as __version__
variable, for example:__version__ = "0.2.4"
setup.py
, README.md
, CHANGELOG.md
, and probably some more files.CHANGELOG.md
:Changelog
=========
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
[Unreleased]
-----------------
<!--
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
-->
Unreleased
section while creating a new Unreleased
section above it. For example, this:[Unreleased]
-----------------
### Added
- Logging the cookie consent choices in the database because of the legal requirements.
### Fixed
- Disabling the buttons while saving the Cookie Choices so that they are not triggered more than once with slow Internet connections.
[Unreleased]
-----------------
[v0.2.0] - 2021-10-27
-----------------------
### Added
- Logging the cookie consent choices in the database because of the legal requirements.
### Fixed
- Disabling the buttons while saving the Cookie Choices so that they are not triggered more than once with slow Internet connections.
bump2version
.(env)$ pip install bump2version
__init__.py
file, set the version to 0.0.0
:__version__ = "0.0.0"
0.0.0
in all other files, where the version needs to be mentioned, for example, README.md
and setup.py
.setup.cfg
with the following content:[bumpversion]
current_version = 0.0.0
commit = True
tag = True
[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
[bumpversion:file:myapp/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"
[bumpversion:file:README.md]
search = django_myapp-{current_version}-py2.py3-none-any.whl
replace = django_myapp-{new_version}-py2.py3-none-any.whl
[bumpversion:file:CHANGELOG.md]
search =
[Unreleased]
------------
replace =
[Unreleased]
------------
[v{new_version}] - {utcnow:%%Y-%%m-%%d}
------------------
[bdist_wheel]
universal = 1
setup.cfg
.$ bump2version patch
$ bump2version minor
$ bump2version major
$ python3 setup.py sdist bdist_wheel
patch
is for the bug fixes, minor
is for backward-compatible changes, and major
is for backward-incompatible changes.bump2version
command will use the configuration at setup.cfg
and will do these things:setup.py
, myapp/__init__.py
, and README.md
.CHANGELOG.md
.vMAJOR.MINOR.PATCH
there.Changelog
=========
[Unreleased]
-----------------
# Changelog
## [Unreleased]
setup.cfg
treats lines with the #
symbol as comments, and escaping doesn't work either.[bumpversion:file:CHANGELOG.md]
search =
## [Unreleased]
replace =
## [Unreleased]
## [v{new_version}] - {utcnow:%%Y-%%m-%%d}
setup.cfg
, you can use .bumpversion.cfg
, but that file is hidden, so I recommend sticking with setup.cfg
.