Skip to content

Commit 8045036

Browse files
committed
Improve documentation
1 parent df64d4c commit 8045036

File tree

9 files changed

+57
-21
lines changed

9 files changed

+57
-21
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.4.0
44
hooks:
55
- id: check-ast
66
- id: check-case-conflict
@@ -20,7 +20,7 @@ repos:
2020
- id: trailing-whitespace
2121
- id: detect-private-key
2222
- repo: https://github.com/Lucas-C/pre-commit-hooks
23-
rev: v1.3.1
23+
rev: v1.4.2
2424
hooks:
2525
- id: remove-tabs
2626
- repo: https://github.com/codespell-project/codespell
@@ -29,42 +29,42 @@ repos:
2929
- id: codespell
3030
args: [-w]
3131
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
32-
rev: v2.4.0
32+
rev: v2.7.0
3333
hooks:
3434
- id: pretty-format-yaml
3535
args: [--autofix, --indent, '2']
3636
- repo: https://github.com/pycqa/isort
37-
rev: 5.10.1
37+
rev: 5.12.0
3838
hooks:
3939
- id: isort
4040
files: setuptools_git_versioning.py
4141
- repo: https://github.com/pre-commit/pygrep-hooks
42-
rev: v1.9.0
42+
rev: v1.10.0
4343
hooks:
4444
- id: python-no-log-warn
4545
- id: python-no-eval
4646
- id: text-unicode-replacement-char
4747
- repo: https://github.com/asottile/pyupgrade
48-
rev: v3.2.2
48+
rev: v3.3.1
4949
hooks:
5050
- id: pyupgrade
5151
args: [--py37-plus]
5252
- repo: https://github.com/psf/black
53-
rev: 22.10.0
53+
rev: 23.1.0
5454
hooks:
5555
- id: black
5656
language_version: python3
5757
- repo: https://github.com/asottile/blacken-docs
58-
rev: v1.12.1
58+
rev: 1.13.0
5959
hooks:
6060
- id: blacken-docs
6161
- repo: https://github.com/pre-commit/mirrors-mypy
62-
rev: v0.990
62+
rev: v1.0.1
6363
hooks:
6464
- id: mypy
6565
additional_dependencies: [types-six, types-toml]
6666
- repo: https://github.com/pycqa/flake8
67-
rev: 5.0.4
67+
rev: 6.0.0
6868
hooks:
6969
- id: flake8
7070
- repo: https://github.com/PyCQA/bandit

CHANGELOG.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ Changelog
44
1.13
55
----
66

7+
.. changelog::
8+
:version: 1.13.2
9+
10+
.. change::
11+
:tags: docs, feature
12+
:tickets: 77, 77
13+
14+
Recommend users to use file-based schema instead of tag-based due some cases.
15+
16+
.. change::
17+
:tags: docs, feature
18+
:tickets: 17
19+
20+
Add small example of ``.gitignore`` file to common issues section
21+
722
.. changelog::
823
:version: 1.13.1
924
:released: 13.11.2022

docs/common_issues/all_dirty.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ as ``dirty``.
1313

1414
You should such files to the ``.gitignore`` file. See `current repo .gitignore <https://github.com/dolfinus/setuptools-git-versioning/blob/master/.gitignore>`__
1515
as an example.
16+
17+
In most the cases adding these lines solves the issue:
18+
19+
.. code:: gitignore
20+
21+
eggs/
22+
*.egg*

docs/conf.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from packaging.version import Version
1818

1919
try:
20-
2120
from setuptools_git_versioning import version_from_git
2221

2322
ver = Version(version_from_git())
@@ -80,7 +79,11 @@
8079
# html_static_path = ['_static']
8180

8281

83-
extlinks = {"github-user": ("https://github.com/%s", "@%s")}
82+
extlinks = {
83+
"github-user": ("https://github.com/%s", "@%s"),
84+
"issue": ("https://github.com/dolfinus/setuptools-git-versioning/issues/%s", "#%s"),
85+
"pr": ("https://github.com/dolfinus/setuptools-git-versioning/pull/%s", "#%s"),
86+
}
8487

8588
changelog_sections = [
8689
"general",
@@ -96,7 +99,7 @@
9699
changelog_caption_class = ""
97100

98101
changelog_inner_tag_sort = ["breaking", "deprecated", "feature", "bug", "refactor"]
99-
changelog_hive_secgions_from_tags = True
102+
changelog_hide_sections_from_tags = True
100103

101104
changelog_render_ticket = "https://github.com/dolfinus/setuptools-git-versioning/issues/%s"
102105
changelog_render_pullreq = {"default": "https://github.com/dolfinus/setuptools-git-versioning/pull/%s"}

docs/schemas/callback/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _callback-based-release:
22

3-
Callback-based release
4-
~~~~~~~~~~~~~~~~~~~~~~~
3+
Callback-based release (advanced)
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55

66
.. toctree::
77
:maxdepth: 1

docs/schemas/file/index.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
.. _file-based-release:
22

3-
File-based release
4-
~~~~~~~~~~~~~~~~~~~~~~~
3+
File-based release (recommended)
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
6+
.. note::
7+
8+
Prefer this schema because it allows to get a version number in the following cases:
9+
* Downloading source tarball without ``.git`` folder (:issue:`77`).
10+
* Shallow repo clone without tags (:issue:`75`).
11+
* Getting version number from a branch which does not contain any tags (`Git-flow <https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow>`__ and its derivatives)
512

613
.. toctree::
714
:maxdepth: 1

docs/schemas/file/version_file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _version-file:
22

33
Read some file content as current version
4-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55

66
For example, current repo state is:
77

docs/schemas/tag/index.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
.. _tag-based-release:
22

3-
Tag-based release
4-
~~~~~~~~~~~~~~~~~
3+
Tag-based release (not recommended)
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
6+
.. note::
7+
8+
This schema has several drawbacks. Use :ref:`file-based schema <file-based-release>` instead.
59

610
.. toctree::
711
:maxdepth: 1

docs/schemas/tag/tag_release.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _tag-release:
22

33
Release is a git tag
4-
^^^^^^^^^^^^^^^^^^^^^
4+
^^^^^^^^^^^^^^^^^^^^
55

66
For example, current repo state is:
77

0 commit comments

Comments
 (0)