gitversion-simple 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitversion_simple-1.0.0/LICENSE +19 -0
- gitversion_simple-1.0.0/PKG-INFO +76 -0
- gitversion_simple-1.0.0/pyproject.toml +48 -0
- gitversion_simple-1.0.0/readme.md +37 -0
- gitversion_simple-1.0.0/setup.cfg +4 -0
- gitversion_simple-1.0.0/src/gitversion_simple/__init__.py +2 -0
- gitversion_simple-1.0.0/src/gitversion_simple/format_.py +7 -0
- gitversion_simple-1.0.0/src/gitversion_simple/next_version.py +53 -0
- gitversion_simple-1.0.0/src/gitversion_simple/py.typed +0 -0
- gitversion_simple-1.0.0/src/gitversion_simple.egg-info/PKG-INFO +76 -0
- gitversion_simple-1.0.0/src/gitversion_simple.egg-info/SOURCES.txt +12 -0
- gitversion_simple-1.0.0/src/gitversion_simple.egg-info/dependency_links.txt +1 -0
- gitversion_simple-1.0.0/src/gitversion_simple.egg-info/requires.txt +9 -0
- gitversion_simple-1.0.0/src/gitversion_simple.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
The zlib/libpng License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ярыкин Евгений
|
|
4
|
+
|
|
5
|
+
This software is provided 'as-is', without any express or implied
|
|
6
|
+
warranty. In no event will the authors be held liable for any damages
|
|
7
|
+
arising from the use of this software.
|
|
8
|
+
|
|
9
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
10
|
+
including commercial applications, and to alter it and redistribute it
|
|
11
|
+
freely, subject to the following restrictions:
|
|
12
|
+
|
|
13
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
14
|
+
claim that you wrote the original software. If you use this software
|
|
15
|
+
in a product, an acknowledgement in the product documentation would be
|
|
16
|
+
appreciated but is not required.
|
|
17
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
18
|
+
misrepresented as being the original software.
|
|
19
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitversion_simple
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A simple version based on git for setuptools.
|
|
5
|
+
Author-email: Ярыкин Евгений <pypi@zedzhen.ru>
|
|
6
|
+
License: The zlib/libpng License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Ярыкин Евгений
|
|
9
|
+
|
|
10
|
+
This software is provided 'as-is', without any express or implied
|
|
11
|
+
warranty. In no event will the authors be held liable for any damages
|
|
12
|
+
arising from the use of this software.
|
|
13
|
+
|
|
14
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
15
|
+
including commercial applications, and to alter it and redistribute it
|
|
16
|
+
freely, subject to the following restrictions:
|
|
17
|
+
|
|
18
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
19
|
+
claim that you wrote the original software. If you use this software
|
|
20
|
+
in a product, an acknowledgement in the product documentation would be
|
|
21
|
+
appreciated but is not required.
|
|
22
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
23
|
+
misrepresented as being the original software.
|
|
24
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
25
|
+
|
|
26
|
+
Project-URL: source, https://github.com/zedzhen/gitversion_simple
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: versioningit~=3.2
|
|
31
|
+
Requires-Dist: typing-extensions~=4.14
|
|
32
|
+
Requires-Dist: packaging~=26.1
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: black~=26.5; extra == "dev"
|
|
35
|
+
Requires-Dist: isort~=8.0; extra == "dev"
|
|
36
|
+
Requires-Dist: build==1.5.*; extra == "dev"
|
|
37
|
+
Requires-Dist: pre-commit~=4.6; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
A simple version based on git for setuptools.
|
|
41
|
+
|
|
42
|
+
If there have been no commits or uncommitted changes since the most recent tag,
|
|
43
|
+
the version from the tag is used as the project version.
|
|
44
|
+
|
|
45
|
+
If the latest tag is final release, then the last part is incremented by 1 and alpha 0 is added.
|
|
46
|
+
|
|
47
|
+
If the latest tag is pre-release, the pre-release number is incremented by 1.
|
|
48
|
+
|
|
49
|
+
used:
|
|
50
|
+
1. add "gitversion_simple" in build-system.requires (in pyproject.toml)
|
|
51
|
+
```toml
|
|
52
|
+
[build-system]
|
|
53
|
+
requires = [
|
|
54
|
+
"setuptools>=81.0.0",
|
|
55
|
+
"gitversion_simple~=1.0",
|
|
56
|
+
]
|
|
57
|
+
```
|
|
58
|
+
2. add in pyproject.toml
|
|
59
|
+
```toml
|
|
60
|
+
[tool.versioningit.next-version]
|
|
61
|
+
method = "simple"
|
|
62
|
+
|
|
63
|
+
[tool.versioningit.format]
|
|
64
|
+
method = "simple"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
examples:
|
|
68
|
+
|
|
69
|
+
| last tag | version |
|
|
70
|
+
|----------|---------|
|
|
71
|
+
| v1.0.0 | 1.0.1 |
|
|
72
|
+
| v1.0.0a1 | 1.0.0a2 |
|
|
73
|
+
| v1.0.0b2 | 1.0.0b3 |
|
|
74
|
+
| v1.0 | 1.1 |
|
|
75
|
+
| v1.2.3.4 | 1.2.3.5 |
|
|
76
|
+
| v26.1 | 26.2 |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"setuptools>=81.0.0",
|
|
4
|
+
"versioningit~=3.2",
|
|
5
|
+
"typing-extensions~=4.14",
|
|
6
|
+
"packaging~=26.1",
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
[project]
|
|
10
|
+
name = "gitversion_simple"
|
|
11
|
+
description = "A simple version based on git for setuptools."
|
|
12
|
+
readme = "readme.md"
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
license = { file = "LICENSE" }
|
|
15
|
+
authors = [
|
|
16
|
+
{ name = "Ярыкин Евгений", email = "pypi@zedzhen.ru" }
|
|
17
|
+
]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"versioningit~=3.2",
|
|
20
|
+
"typing-extensions~=4.14",
|
|
21
|
+
"packaging~=26.1",
|
|
22
|
+
]
|
|
23
|
+
dynamic = ["version"]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
source = "https://github.com/zedzhen/gitversion_simple"
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
dev = [
|
|
30
|
+
'black~=26.5',
|
|
31
|
+
'isort~=8.0',
|
|
32
|
+
"build==1.5.*",
|
|
33
|
+
"pre-commit~=4.6",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[tool.black]
|
|
37
|
+
line-length = 120
|
|
38
|
+
|
|
39
|
+
[tool.isort]
|
|
40
|
+
profile = "black"
|
|
41
|
+
line_length = 120
|
|
42
|
+
combine_as_imports = true
|
|
43
|
+
|
|
44
|
+
[tool.versioningit.next-version]
|
|
45
|
+
method = { module = "gitversion_simple", value = "next_version", module-dir = "src" }
|
|
46
|
+
|
|
47
|
+
[tool.versioningit.format]
|
|
48
|
+
method = { module = "gitversion_simple", value = "format_", module-dir = "src" }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
A simple version based on git for setuptools.
|
|
2
|
+
|
|
3
|
+
If there have been no commits or uncommitted changes since the most recent tag,
|
|
4
|
+
the version from the tag is used as the project version.
|
|
5
|
+
|
|
6
|
+
If the latest tag is final release, then the last part is incremented by 1 and alpha 0 is added.
|
|
7
|
+
|
|
8
|
+
If the latest tag is pre-release, the pre-release number is incremented by 1.
|
|
9
|
+
|
|
10
|
+
used:
|
|
11
|
+
1. add "gitversion_simple" in build-system.requires (in pyproject.toml)
|
|
12
|
+
```toml
|
|
13
|
+
[build-system]
|
|
14
|
+
requires = [
|
|
15
|
+
"setuptools>=81.0.0",
|
|
16
|
+
"gitversion_simple~=1.0",
|
|
17
|
+
]
|
|
18
|
+
```
|
|
19
|
+
2. add in pyproject.toml
|
|
20
|
+
```toml
|
|
21
|
+
[tool.versioningit.next-version]
|
|
22
|
+
method = "simple"
|
|
23
|
+
|
|
24
|
+
[tool.versioningit.format]
|
|
25
|
+
method = "simple"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
examples:
|
|
29
|
+
|
|
30
|
+
| last tag | version |
|
|
31
|
+
|----------|---------|
|
|
32
|
+
| v1.0.0 | 1.0.1 |
|
|
33
|
+
| v1.0.0a1 | 1.0.0a2 |
|
|
34
|
+
| v1.0.0b2 | 1.0.0b3 |
|
|
35
|
+
| v1.0 | 1.1 |
|
|
36
|
+
| v1.2.3.4 | 1.2.3.5 |
|
|
37
|
+
| v26.1 | 26.2 |
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from packaging.version import Version
|
|
2
|
+
from typing_extensions import Any
|
|
3
|
+
from versioningit import InvalidVersionError, VCSDescription
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def format_(*, description: VCSDescription, base_version: str, next_version: str, params: dict[str, Any]) -> str:
|
|
7
|
+
return next_version
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from packaging.version import Version
|
|
2
|
+
from typing_extensions import Any
|
|
3
|
+
from versioningit import InvalidVersionError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def from_parts(
|
|
7
|
+
epoch: int = 0,
|
|
8
|
+
release: tuple[int, ...] = (),
|
|
9
|
+
pre: tuple[str, int] | None = None,
|
|
10
|
+
post: int | None = None,
|
|
11
|
+
dev: int | None = None,
|
|
12
|
+
local: str | None = None,
|
|
13
|
+
) -> str:
|
|
14
|
+
return str(Version.from_parts(epoch=epoch, release=release, pre=pre, post=post, dev=dev, local=local))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def update_parts(
|
|
18
|
+
version: Version,
|
|
19
|
+
*,
|
|
20
|
+
epoch: int | None = None,
|
|
21
|
+
release: tuple[int, ...] | None = None,
|
|
22
|
+
pre: tuple[str, int] | None = None,
|
|
23
|
+
post: int | None = None,
|
|
24
|
+
dev: int | None = None,
|
|
25
|
+
local: str | None = None,
|
|
26
|
+
) -> str:
|
|
27
|
+
if epoch is None:
|
|
28
|
+
epoch = version.epoch
|
|
29
|
+
if release is None:
|
|
30
|
+
release = version.release
|
|
31
|
+
if pre is None:
|
|
32
|
+
pre = version.pre
|
|
33
|
+
if post is None:
|
|
34
|
+
post = version.post
|
|
35
|
+
if dev is None:
|
|
36
|
+
dev = version.dev
|
|
37
|
+
if local is None:
|
|
38
|
+
local = version.local
|
|
39
|
+
return from_parts(epoch, release, pre, post, dev, local)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def next_version(*, version: str, branch: str | None = None, params: dict[str, Any]) -> str:
|
|
43
|
+
try:
|
|
44
|
+
v = Version(version)
|
|
45
|
+
except ValueError:
|
|
46
|
+
raise InvalidVersionError(f"Cannot parse version {version!r}")
|
|
47
|
+
if v.pre is not None:
|
|
48
|
+
type_, i = v.pre
|
|
49
|
+
i += 1
|
|
50
|
+
return update_parts(v, pre=(type_, i))
|
|
51
|
+
vs = list(v.release)
|
|
52
|
+
vs[-1] += 1
|
|
53
|
+
return update_parts(v, release=tuple(vs), pre=("a", 0))
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitversion_simple
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A simple version based on git for setuptools.
|
|
5
|
+
Author-email: Ярыкин Евгений <pypi@zedzhen.ru>
|
|
6
|
+
License: The zlib/libpng License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Ярыкин Евгений
|
|
9
|
+
|
|
10
|
+
This software is provided 'as-is', without any express or implied
|
|
11
|
+
warranty. In no event will the authors be held liable for any damages
|
|
12
|
+
arising from the use of this software.
|
|
13
|
+
|
|
14
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
15
|
+
including commercial applications, and to alter it and redistribute it
|
|
16
|
+
freely, subject to the following restrictions:
|
|
17
|
+
|
|
18
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
19
|
+
claim that you wrote the original software. If you use this software
|
|
20
|
+
in a product, an acknowledgement in the product documentation would be
|
|
21
|
+
appreciated but is not required.
|
|
22
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
23
|
+
misrepresented as being the original software.
|
|
24
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
25
|
+
|
|
26
|
+
Project-URL: source, https://github.com/zedzhen/gitversion_simple
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: versioningit~=3.2
|
|
31
|
+
Requires-Dist: typing-extensions~=4.14
|
|
32
|
+
Requires-Dist: packaging~=26.1
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: black~=26.5; extra == "dev"
|
|
35
|
+
Requires-Dist: isort~=8.0; extra == "dev"
|
|
36
|
+
Requires-Dist: build==1.5.*; extra == "dev"
|
|
37
|
+
Requires-Dist: pre-commit~=4.6; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
A simple version based on git for setuptools.
|
|
41
|
+
|
|
42
|
+
If there have been no commits or uncommitted changes since the most recent tag,
|
|
43
|
+
the version from the tag is used as the project version.
|
|
44
|
+
|
|
45
|
+
If the latest tag is final release, then the last part is incremented by 1 and alpha 0 is added.
|
|
46
|
+
|
|
47
|
+
If the latest tag is pre-release, the pre-release number is incremented by 1.
|
|
48
|
+
|
|
49
|
+
used:
|
|
50
|
+
1. add "gitversion_simple" in build-system.requires (in pyproject.toml)
|
|
51
|
+
```toml
|
|
52
|
+
[build-system]
|
|
53
|
+
requires = [
|
|
54
|
+
"setuptools>=81.0.0",
|
|
55
|
+
"gitversion_simple~=1.0",
|
|
56
|
+
]
|
|
57
|
+
```
|
|
58
|
+
2. add in pyproject.toml
|
|
59
|
+
```toml
|
|
60
|
+
[tool.versioningit.next-version]
|
|
61
|
+
method = "simple"
|
|
62
|
+
|
|
63
|
+
[tool.versioningit.format]
|
|
64
|
+
method = "simple"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
examples:
|
|
68
|
+
|
|
69
|
+
| last tag | version |
|
|
70
|
+
|----------|---------|
|
|
71
|
+
| v1.0.0 | 1.0.1 |
|
|
72
|
+
| v1.0.0a1 | 1.0.0a2 |
|
|
73
|
+
| v1.0.0b2 | 1.0.0b3 |
|
|
74
|
+
| v1.0 | 1.1 |
|
|
75
|
+
| v1.2.3.4 | 1.2.3.5 |
|
|
76
|
+
| v26.1 | 26.2 |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
pyproject.toml
|
|
3
|
+
readme.md
|
|
4
|
+
src/gitversion_simple/__init__.py
|
|
5
|
+
src/gitversion_simple/format_.py
|
|
6
|
+
src/gitversion_simple/next_version.py
|
|
7
|
+
src/gitversion_simple/py.typed
|
|
8
|
+
src/gitversion_simple.egg-info/PKG-INFO
|
|
9
|
+
src/gitversion_simple.egg-info/SOURCES.txt
|
|
10
|
+
src/gitversion_simple.egg-info/dependency_links.txt
|
|
11
|
+
src/gitversion_simple.egg-info/requires.txt
|
|
12
|
+
src/gitversion_simple.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gitversion_simple
|