Skip to content

Commit 3a80023

Browse files
committed
Update docs and changelog
1 parent 9784266 commit 3a80023

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Changelog
22
==========
33

4+
1.10
5+
----
6+
7+
.. changelog::
8+
:version: 1.10.0
9+
10+
.. change::
11+
:tags: core, breaking
12+
13+
``version_callback`` option is used even if there are some tags in the current branch
14+
415
1.9
516
----
617

docs/options/branch_formatter.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
Callback to be used for formatting a branch name before template substitution
77

8+
.. note::
9+
10+
This option is used only with :ref:`tag-release` or :ref:`version-file` versioning schemas.
11+
812
Type
913
^^^^^^^^^^^^^^
1014

docs/options/count_commits.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Enables feature of tracking commits history for file passed to :ref:`version-fil
99

1010
.. note::
1111

12-
This option used only if :ref:`version-file-option` option is set.
12+
This option used only with :ref:`version-file-option`
1313

1414
Type
1515
^^^^^

docs/options/starting_version.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ You can change this version by setting up ``starting_version`` option in your co
3131
[tool.setuptools-git-versioning]
3232
starting_version = "1.0.0"
3333
34+
.. note::
35+
36+
This option is completely ignored if :ref:`version-callback` schema is used.
37+
3438
Type
3539
^^^^^^^^^^^^^^
3640

docs/options/version_callback.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ Callback to be used for getting a version number.
77

88
Used by :ref:`version-callback` versioning schema.
99

10-
.. note::
11-
12-
This option is completely ignored if :ref:`version-file` or :ref:`tag-release` schemas are used.
13-
1410
Type
1511
^^^^^^^^^^^^^^
1612

docs/schemas/callback/version_callback.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ For example, current repo state is:
1919
|
2020
...
2121
22-
**And there are no tags in the current branch** (``dev``), **all
23-
of them are placed in the** ``master`` **branch.**
24-
2522
By default, when you try to get current version, you'll receive some
26-
initial value (see :ref:`starting-version-option` option).
23+
initial value (see :ref:`starting-version-option` option),
24+
because there are no tags in the ``dev`` branch.
2725

28-
If you want to get synchronized version numbers in both on the branches,
26+
If you want to get synchronized version numbers in both ``master`` and ``dev`` branches,
2927
you can create a function in some file (for example, in the
3028
``mypkg/version.py`` file):
3129

@@ -59,7 +57,7 @@ Then place it in both the branches and update your ``setup.py`` or ``pyproject.t
5957
enabled = true
6058
version_callback = "mypkg.version:get_version"
6159
62-
When you'll try to get current version in non-master branch, the result
60+
When you'll try to get current version in **any** branch, the result
6361
of executing this function will be returned instead of latest tag
6462
number.
6563

@@ -96,8 +94,9 @@ If a value of this option is not a function but just str, it also could be used:
9694
enabled = true
9795
version_callback = "mypkg:__version__"
9896
99-
**Please take into account that version_callback is ignored if tag
100-
is present**
97+
**Please take into account that any tag in the branch is completely ignored if version_callback
98+
is set**.
99+
You should explicitly call ``setuptools_git_versioning.version_from_git`` function in the callback.
101100

102101

103102
See also

0 commit comments

Comments
 (0)