ebump 0.1.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.
ebump-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jorge Morgado Vega
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ebump-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.4
2
+ Name: ebump
3
+ Version: 0.1.0
4
+ Summary: Easy version bumping
5
+ Author-email: Jorge Morgado Vega <jorge.morgadov@gmail.com>
6
+ License: MIT
7
+ Requires-Python: >=3.13
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: bumpver>=2025.1131
11
+ Requires-Dist: click>=8.3.1
12
+ Dynamic: license-file
13
+
14
+ # ebump
15
+
16
+ Easy version bumping CLI for python projects.
17
+
18
+ `ebump` is a simple (opinionated) wrapper around the
19
+ [`bumpver`](https://github.com/mbarkhau/bumpver) library that provides an
20
+ easy-to-use CLI for version bumping in Python projects. It focuses on simplicity
21
+ and ease of use, making it ideal for developers and CI/CD pipelines and scripts.
22
+
23
+ ## Quick showcase
24
+
25
+ ```bash
26
+ # Bump patch/minor/major versions
27
+ ebump patch # Example: 1.0.0 -> 1.0.1
28
+ ebump minor # Example: 1.0.1 -> 1.1.0
29
+ ebump major # Example: 1.5.4 -> 2.0.0
30
+
31
+ # Bumping (major/minor/patch) resets pre-release tag to final
32
+ ebump minor # Example: 1.0.0-beta2 -> 1.1.0
33
+
34
+ # Bump pre-release tags
35
+ ebump alpha # Example: 1.0.0-alpha4 -> 1.0.0-alpha5
36
+ ebump beta # Example: 1.0.0-alpha5 -> 1.0.0-beta0
37
+ ebump rc # Example: 1.0.0-beta3 -> 1.0.0-rc2
38
+
39
+ # Combined bump
40
+ ebump minor beta # Example: 1.0.0 -> 1.1.0-beta0
41
+
42
+ # Bump the current pre-release tag number
43
+ ebump tag # Example: 1.0.0-beta0 -> 1.0.0-beta1
44
+
45
+ # Make/ensure final version
46
+ ebump final # Example: 1.0.0-rc2 -> 1.0.0
47
+
48
+ # Running in dry mode (no file changes)
49
+ ebump patch --dry
50
+ ```
51
+
52
+ ## Instalation / Usage
53
+
54
+ You can use `ebump` directly via `uvx` (recommended):
55
+
56
+ ```bash
57
+ uvx ebump [PARAMS ...]
58
+ ```
59
+
60
+ Or install it via `pip`:
61
+
62
+ ```bash
63
+ pip install ebump
64
+ ```
65
+
66
+ ## Why `ebump`?
67
+
68
+ Design differences with `bumpver` CLI:
69
+
70
+ - Bumping `final` tag doesn't throw errors if the version is already final.
71
+
72
+ > Useful for CI/CD pipelines where you want to ensure the version is final without worrying about its current state.
73
+
74
+ - Bumping one of the main version parts (`patch`, `minor`, `major`) automatically resets any pre-release tag to `final`.
75
+
76
+ > If you bump the `minor` version from `1.0.0-beta2`, it will become `1.1.0` instead of `1.1.0-final`.
77
+ You can still set a pre-release tag in the same command (e.g., `ebump minor beta` to get `1.1.0-beta0`).
78
+
79
+ - `show` action to print the raw current version without any other text (useful for scripts).
80
+ - Simplified CLI with fewer options, focusing on the most common use cases.
81
+
82
+ ## What `ebump` is NOT
83
+
84
+ - It is not a replacement for `bumpver` library. It is a wrapper around it.
85
+ You can still use `bumpver` library directly for more complex use cases.
86
+ - It does not aim to cover all use cases. It focuses on simplicity and ease of use.
87
+
88
+ ## 🤝 Contributing
89
+
90
+ Contributions are welcome!
91
+ Please ensure all QA checks and tests pass before opening a pull request.
92
+
93
+ ---
94
+
95
+ <sub>🚀 Project starter provided by [Cookie Pyrate](https://github.com/gvieralopez/cookie-pyrate)</sub>
ebump-0.1.0/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # ebump
2
+
3
+ Easy version bumping CLI for python projects.
4
+
5
+ `ebump` is a simple (opinionated) wrapper around the
6
+ [`bumpver`](https://github.com/mbarkhau/bumpver) library that provides an
7
+ easy-to-use CLI for version bumping in Python projects. It focuses on simplicity
8
+ and ease of use, making it ideal for developers and CI/CD pipelines and scripts.
9
+
10
+ ## Quick showcase
11
+
12
+ ```bash
13
+ # Bump patch/minor/major versions
14
+ ebump patch # Example: 1.0.0 -> 1.0.1
15
+ ebump minor # Example: 1.0.1 -> 1.1.0
16
+ ebump major # Example: 1.5.4 -> 2.0.0
17
+
18
+ # Bumping (major/minor/patch) resets pre-release tag to final
19
+ ebump minor # Example: 1.0.0-beta2 -> 1.1.0
20
+
21
+ # Bump pre-release tags
22
+ ebump alpha # Example: 1.0.0-alpha4 -> 1.0.0-alpha5
23
+ ebump beta # Example: 1.0.0-alpha5 -> 1.0.0-beta0
24
+ ebump rc # Example: 1.0.0-beta3 -> 1.0.0-rc2
25
+
26
+ # Combined bump
27
+ ebump minor beta # Example: 1.0.0 -> 1.1.0-beta0
28
+
29
+ # Bump the current pre-release tag number
30
+ ebump tag # Example: 1.0.0-beta0 -> 1.0.0-beta1
31
+
32
+ # Make/ensure final version
33
+ ebump final # Example: 1.0.0-rc2 -> 1.0.0
34
+
35
+ # Running in dry mode (no file changes)
36
+ ebump patch --dry
37
+ ```
38
+
39
+ ## Instalation / Usage
40
+
41
+ You can use `ebump` directly via `uvx` (recommended):
42
+
43
+ ```bash
44
+ uvx ebump [PARAMS ...]
45
+ ```
46
+
47
+ Or install it via `pip`:
48
+
49
+ ```bash
50
+ pip install ebump
51
+ ```
52
+
53
+ ## Why `ebump`?
54
+
55
+ Design differences with `bumpver` CLI:
56
+
57
+ - Bumping `final` tag doesn't throw errors if the version is already final.
58
+
59
+ > Useful for CI/CD pipelines where you want to ensure the version is final without worrying about its current state.
60
+
61
+ - Bumping one of the main version parts (`patch`, `minor`, `major`) automatically resets any pre-release tag to `final`.
62
+
63
+ > If you bump the `minor` version from `1.0.0-beta2`, it will become `1.1.0` instead of `1.1.0-final`.
64
+ You can still set a pre-release tag in the same command (e.g., `ebump minor beta` to get `1.1.0-beta0`).
65
+
66
+ - `show` action to print the raw current version without any other text (useful for scripts).
67
+ - Simplified CLI with fewer options, focusing on the most common use cases.
68
+
69
+ ## What `ebump` is NOT
70
+
71
+ - It is not a replacement for `bumpver` library. It is a wrapper around it.
72
+ You can still use `bumpver` library directly for more complex use cases.
73
+ - It does not aim to cover all use cases. It focuses on simplicity and ease of use.
74
+
75
+ ## 🤝 Contributing
76
+
77
+ Contributions are welcome!
78
+ Please ensure all QA checks and tests pass before opening a pull request.
79
+
80
+ ---
81
+
82
+ <sub>🚀 Project starter provided by [Cookie Pyrate](https://github.com/gvieralopez/cookie-pyrate)</sub>
@@ -0,0 +1,113 @@
1
+ [project]
2
+ name = "ebump"
3
+ version = "0.1.0"
4
+ description = "Easy version bumping"
5
+ readme = "README.md"
6
+ requires-python = ">= 3.13"
7
+ authors = [{ name = "Jorge Morgado Vega", email = "jorge.morgadov@gmail.com" }]
8
+ license = { text = "MIT" }
9
+
10
+ dependencies = ["bumpver>=2025.1131", "click>=8.3.1"]
11
+
12
+ [dependency-groups]
13
+ dev = [
14
+ "bumpver",
15
+ "mypy",
16
+
17
+ "pytest",
18
+ "pytest-cov",
19
+ "pytest-dotenv",
20
+ "pytest-mock",
21
+ "ruff",
22
+ ]
23
+
24
+ docs = ["mkdocs", "mkdocs-material", "pygments"]
25
+
26
+ build = ["build"]
27
+
28
+ [build-system]
29
+ requires = ["setuptools>=61.0", "wheel"]
30
+ build-backend = "setuptools.build_meta"
31
+
32
+ [tool.setuptools]
33
+ package-dir = { "" = "src" }
34
+
35
+ [project.scripts]
36
+ ebump = "ebump.main:main"
37
+
38
+ [tool.ruff]
39
+ line-length = 88
40
+ indent-width = 4
41
+ target-version = "py313"
42
+
43
+ [tool.ruff.format]
44
+ quote-style = "double"
45
+ indent-style = "space"
46
+ skip-magic-trailing-comma = false
47
+ docstring-code-format = true
48
+ docstring-code-line-length = "dynamic"
49
+
50
+ [tool.ruff.lint]
51
+ select = [
52
+ "A", # flake8-builtins: Check variables shadowing
53
+ "B", # flake8-bugbear: Finds likely bugs and design problems
54
+ "C", # McCabe: Complexity checker to ensure maintainable code
55
+ "DJ", # flake8-django: Checks on Django code
56
+ "E4", # Pycodestyle: Line length, indentation, etc.
57
+ "E7", # Pycodestyle: Miscellaneous checks
58
+ "E9", # Pycodestyle: Syntax errors
59
+ "F", # Pyflakes: Unused imports, undefined variables, etc.
60
+ "FIX", # Avoid lines containing TODO tags
61
+ "G", # flake8-logging-format: Ensure logging messages follow best practices.
62
+ "I", # Isort: Import sorting
63
+ "LOG", # flake8-logging: Use the logging module correctly
64
+ "N", # pep8-naming: Enforce naming conventions
65
+ "PGH004", # Enforce specify the rule to avoid on noqa tags
66
+ "PTH", # flake8-use-pathlib: Enforces pathlib usage
67
+ "RUF", # Ruff-specific rules: Mostly for handling noqa tags and general stuff
68
+ "S", # flake8-bandit: Identifies common security issues in code
69
+ "T20", # flake8-print: Avoids print in the code
70
+ ]
71
+ ignore = [
72
+ "S101", # Use of assert function
73
+ ]
74
+ fixable = ["ALL"]
75
+ unfixable = []
76
+
77
+ [tool.ruff.lint.per-file-ignores]
78
+ "scripts/**" = ["T20"] # Allow print statements on the scripts
79
+
80
+
81
+ [tool.mypy]
82
+ python_version = "3.13"
83
+ files = ["src", "scripts", "tests"]
84
+ warn_unused_configs = true
85
+ warn_redundant_casts = true
86
+ warn_unused_ignores = true
87
+ strict_equality = true
88
+ check_untyped_defs = true
89
+ disallow_subclassing_any = true
90
+ disallow_untyped_decorators = true
91
+ disallow_any_generics = true
92
+ disallow_untyped_calls = true
93
+ disallow_incomplete_defs = true
94
+ disallow_untyped_defs = true
95
+ no_implicit_reexport = true
96
+ warn_return_any = true
97
+ extra_checks = true
98
+
99
+ [tool.pytest.ini_options]
100
+ minversion = "6.0"
101
+ addopts = "-ra -q --cov=src --cov-report=term-missing --cov-fail-under=80"
102
+ python_files = "tests.py test_*.py *_test.py"
103
+ pythonpath = "./src"
104
+ env_override_existing_values = 1
105
+ env_files = [".env.test"]
106
+
107
+ [tool.bumpver]
108
+ current_version = "0.1.0"
109
+ version_pattern = "MAJOR.MINOR.PATCH[-TAGNUM]"
110
+
111
+ [tool.bumpver.file_patterns]
112
+ "pyproject.toml" = ['^version = "{version}"', '^current_version = "{version}"']
113
+ "src/ebump/__init__.py" = ['^__version__ = "{version}"$']
ebump-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,163 @@
1
+ """
2
+ ebump - Easy version bumping CLI tool
3
+ """
4
+
5
+ import argparse
6
+ import logging
7
+ import os
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ import bumpver
12
+ import bumpver.cli
13
+ import bumpver.config
14
+ import bumpver.v1patterns
15
+ import bumpver.v1version
16
+ import bumpver.v2version
17
+ import click
18
+ import click.testing
19
+ from bumpver.cli import cli
20
+
21
+ logger = logging.getLogger(__name__)
22
+
23
+
24
+ ROOT_IDENTIFIERS = ["pyproject.toml", ".git"]
25
+
26
+
27
+ def project_root() -> Path:
28
+ """
29
+ Get the project root directory
30
+ """
31
+
32
+ current_dir = Path.cwd()
33
+ while current_dir != current_dir.parent:
34
+ if any((current_dir / identifier).exists() for identifier in ROOT_IDENTIFIERS):
35
+ return current_dir
36
+ current_dir = current_dir.parent
37
+ return Path.cwd()
38
+
39
+
40
+ def run(version: str) -> None:
41
+ """
42
+ Write the new version to your version file/config
43
+ """
44
+ bumpver.cli.update(set_version=version, project_path=".")
45
+
46
+
47
+ def main() -> None:
48
+ """
49
+ Main entry point for the ebump CLI tool
50
+ """
51
+ parser = argparse.ArgumentParser(
52
+ prog="ebump",
53
+ description="Easy version bumping tool",
54
+ epilog="""
55
+ Basic:
56
+
57
+ > ebump show # Show current version
58
+ > ebump --help # Show help message
59
+
60
+ Bump version parts:
61
+
62
+ > ebump patch # 1.0.0 -> 1.0.1
63
+ > ebump minor # 1.0.1 -> 1.1.0
64
+ > ebump major # 1.5.4 -> 2.0.0
65
+
66
+ Bump part with tag:
67
+
68
+ > ebump minor beta # 1.0.0 -> 1.1.0-beta0
69
+
70
+ Bump tags:
71
+
72
+ > ebump alpha # 1.0.0-alpha4 -> 1.0.0-alpha5
73
+ > ebump beta # 1.0.0-alpha5 -> 1.0.0-beta0
74
+
75
+ Bump current tag number:
76
+
77
+ > ebump tag # 1.0.0-beta0 -> 1.0.0-beta1
78
+
79
+ Make/ensure final release (no pre-release tag):
80
+
81
+ > ebump final # 1.0.0-rc2 -> 1.0.0
82
+ """,
83
+ formatter_class=argparse.RawDescriptionHelpFormatter,
84
+ )
85
+
86
+ parser.add_argument(
87
+ "action",
88
+ nargs="?",
89
+ default=None,
90
+ help="Version part to bump (patch/minor/major/tag), or specific pre-release tag (alpha/beta/dev/rc/final)",
91
+ )
92
+
93
+ parser.add_argument(
94
+ "tag",
95
+ nargs="?",
96
+ default=None,
97
+ help="Optional pre-release tag when bumping version parts",
98
+ )
99
+
100
+ parser.add_argument(
101
+ "--dry",
102
+ default=False,
103
+ action="store_true",
104
+ help="Perform a dry run without modifying any files",
105
+ )
106
+
107
+ args = parser.parse_args()
108
+ os.chdir(project_root())
109
+
110
+ _, cfg = bumpver.config.init(project_path=".")
111
+ raw_pattern = cfg.version_pattern
112
+ v1_parts = list(bumpver.v1patterns.PART_PATTERNS) + list(
113
+ bumpver.v1patterns.FULL_PART_FORMATS
114
+ )
115
+ has_v1_part = any("{" + part + "}" in raw_pattern for part in v1_parts)
116
+ vinfo: bumpver.v1version.VersionInfo | bumpver.v2version.VersionInfo
117
+ current_version = cfg.current_version
118
+ if has_v1_part:
119
+ vinfo = bumpver.v1version.parse_version_info(current_version, raw_pattern)
120
+ else:
121
+ vinfo = bumpver.v2version.parse_version_info(current_version, raw_pattern)
122
+
123
+ if not args.action:
124
+ parser.print_help()
125
+ sys.exit(1)
126
+
127
+ if args.action.lower() == "show":
128
+ sys.stdout.write(f"{current_version}\n")
129
+ return
130
+
131
+ action = args.action.lower()
132
+ tag = args.tag.lower() if args.tag else None
133
+ dry = args.dry
134
+
135
+ cmd = ["update"]
136
+ if action in {"patch", "minor", "major"}:
137
+ cmd += ["--" + action, "--tag", tag or "final"]
138
+ elif action == "tag":
139
+ if not cfg.tag:
140
+ sys.stderr.write("No pre-release tag found to bump.\n")
141
+ sys.exit(1)
142
+ cmd += ["--tag-num", "-n"]
143
+ elif action in {"alpha", "beta", "dev", "rc", "post", "final"}:
144
+ if action == "final" and not vinfo.tag:
145
+ sys.stdout.write("Already at final version.\n")
146
+ return
147
+ if action == vinfo.tag:
148
+ cmd += ["--tag-num", "-n"]
149
+ else:
150
+ cmd += ["--tag", action]
151
+
152
+ if dry:
153
+ cmd.append("--dry")
154
+ runner = click.testing.CliRunner(catch_exceptions=False)
155
+ result = runner.invoke(cli, cmd, color=True, catch_exceptions=False)
156
+
157
+ sys.stdout.write(result.output)
158
+ if result.exit_code != 0:
159
+ sys.exit(1)
160
+
161
+
162
+ if __name__ == "__main__":
163
+ main()
File without changes
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.4
2
+ Name: ebump
3
+ Version: 0.1.0
4
+ Summary: Easy version bumping
5
+ Author-email: Jorge Morgado Vega <jorge.morgadov@gmail.com>
6
+ License: MIT
7
+ Requires-Python: >=3.13
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: bumpver>=2025.1131
11
+ Requires-Dist: click>=8.3.1
12
+ Dynamic: license-file
13
+
14
+ # ebump
15
+
16
+ Easy version bumping CLI for python projects.
17
+
18
+ `ebump` is a simple (opinionated) wrapper around the
19
+ [`bumpver`](https://github.com/mbarkhau/bumpver) library that provides an
20
+ easy-to-use CLI for version bumping in Python projects. It focuses on simplicity
21
+ and ease of use, making it ideal for developers and CI/CD pipelines and scripts.
22
+
23
+ ## Quick showcase
24
+
25
+ ```bash
26
+ # Bump patch/minor/major versions
27
+ ebump patch # Example: 1.0.0 -> 1.0.1
28
+ ebump minor # Example: 1.0.1 -> 1.1.0
29
+ ebump major # Example: 1.5.4 -> 2.0.0
30
+
31
+ # Bumping (major/minor/patch) resets pre-release tag to final
32
+ ebump minor # Example: 1.0.0-beta2 -> 1.1.0
33
+
34
+ # Bump pre-release tags
35
+ ebump alpha # Example: 1.0.0-alpha4 -> 1.0.0-alpha5
36
+ ebump beta # Example: 1.0.0-alpha5 -> 1.0.0-beta0
37
+ ebump rc # Example: 1.0.0-beta3 -> 1.0.0-rc2
38
+
39
+ # Combined bump
40
+ ebump minor beta # Example: 1.0.0 -> 1.1.0-beta0
41
+
42
+ # Bump the current pre-release tag number
43
+ ebump tag # Example: 1.0.0-beta0 -> 1.0.0-beta1
44
+
45
+ # Make/ensure final version
46
+ ebump final # Example: 1.0.0-rc2 -> 1.0.0
47
+
48
+ # Running in dry mode (no file changes)
49
+ ebump patch --dry
50
+ ```
51
+
52
+ ## Instalation / Usage
53
+
54
+ You can use `ebump` directly via `uvx` (recommended):
55
+
56
+ ```bash
57
+ uvx ebump [PARAMS ...]
58
+ ```
59
+
60
+ Or install it via `pip`:
61
+
62
+ ```bash
63
+ pip install ebump
64
+ ```
65
+
66
+ ## Why `ebump`?
67
+
68
+ Design differences with `bumpver` CLI:
69
+
70
+ - Bumping `final` tag doesn't throw errors if the version is already final.
71
+
72
+ > Useful for CI/CD pipelines where you want to ensure the version is final without worrying about its current state.
73
+
74
+ - Bumping one of the main version parts (`patch`, `minor`, `major`) automatically resets any pre-release tag to `final`.
75
+
76
+ > If you bump the `minor` version from `1.0.0-beta2`, it will become `1.1.0` instead of `1.1.0-final`.
77
+ You can still set a pre-release tag in the same command (e.g., `ebump minor beta` to get `1.1.0-beta0`).
78
+
79
+ - `show` action to print the raw current version without any other text (useful for scripts).
80
+ - Simplified CLI with fewer options, focusing on the most common use cases.
81
+
82
+ ## What `ebump` is NOT
83
+
84
+ - It is not a replacement for `bumpver` library. It is a wrapper around it.
85
+ You can still use `bumpver` library directly for more complex use cases.
86
+ - It does not aim to cover all use cases. It focuses on simplicity and ease of use.
87
+
88
+ ## 🤝 Contributing
89
+
90
+ Contributions are welcome!
91
+ Please ensure all QA checks and tests pass before opening a pull request.
92
+
93
+ ---
94
+
95
+ <sub>🚀 Project starter provided by [Cookie Pyrate](https://github.com/gvieralopez/cookie-pyrate)</sub>
@@ -0,0 +1,13 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/ebump/__init__.py
5
+ src/ebump/main.py
6
+ src/ebump/py.typed
7
+ src/ebump.egg-info/PKG-INFO
8
+ src/ebump.egg-info/SOURCES.txt
9
+ src/ebump.egg-info/dependency_links.txt
10
+ src/ebump.egg-info/entry_points.txt
11
+ src/ebump.egg-info/requires.txt
12
+ src/ebump.egg-info/top_level.txt
13
+ tests/test_main.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ ebump = ebump.main:main
@@ -0,0 +1,2 @@
1
+ bumpver>=2025.1131
2
+ click>=8.3.1
@@ -0,0 +1 @@
1
+ ebump
File without changes