Skip to content

Commit e0cebb3

Browse files
committed
Updated README and other documentation
1 parent 80fe7ef commit e0cebb3

9 files changed

+921
-32
lines changed

README.md

+129-25
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,157 @@
11
# Bump My Version
22

3-
Version bump your Python project
3+
[![image](https://img.shields.io/pypi/v/bump-my-version.svg)](https://pypi.org/project/bump-my-version/)
4+
[![image](https://img.shields.io/pypi/l/bump-my-version.svg)](https://pypi.org/project/bump-my-version/)
5+
[![image](https://img.shields.io/pypi/pyversions/bump-my-version.svg)](https://pypi.org/project/bump-my-version/)
6+
[![GitHub Actions](https://github.com/callowayproject/bump-my-version/workflows/CI/badge.svg)](https://github.com/callowayproject/bump-my-version/actions)
47

5-
*Put a meaningful, short, plain-language description of:*
8+
> **NOTE**
9+
>
10+
> This is a maintained refactor of the [bump2version fork of](https://github.com/c4urself/bump2version) the excellent [bumpversion project](https://github.com/peritus/bumpversion). The main goals of this refactor were:
11+
>
12+
> - Add support for `pyproject.toml` configuration files.
13+
> - Convert to [click](https://click.palletsprojects.com/en/8.1.x/) for and [rich](https://rich.readthedocs.io/en/stable/index.html) for the CLI interface
14+
> - Add better configuration validation using [Pydantic](https://docs.pydantic.dev)
15+
> - Make the code and tests easier to read and maintain
616
7-
- *what this project is trying to accomplish.*
8-
- *why it matters.*
9-
- *the problem(s) this project solves.*
10-
- *how this software can improve the lives of its audience.*
11-
- *what sets this apart from related-projects. Linking to another doc or page is OK if this can't be expressed in a sentence or two.*
1217

13-
**Technology stack:** *Indicate the technological nature of the software, including primary programming language(s) and whether the software is intended as standalone or as a module in a framework or other ecosystem.*
18+
## Overview
1419

15-
**Status:** *Alpha, Beta, 1.1, etc. It's OK to write a sentence, too. The goal is to let interested people know where this project is at. This is also a good place to link to the CHANGELOG.md.*
20+
Version-bump your software with a single command!
1621

17-
**Links:** to production or demo instances
22+
A small command line tool to simplify releasing software by updating all
23+
version strings in your source code by the correct increment. Also creates
24+
commits and tags:
1825

26+
* version formats are highly configurable
27+
* works without any source code manager, but happily reads tag information from and writes
28+
commits and tags to Git and Mercurial if available
29+
* just handles text files, so it's not specific to any programming language
30+
* supports Python 3 and PyPy3
1931

20-
## Dependencies
2132

22-
*Describe any dependencies that must be installed for this software to work. This includes programming languages, databases or other storage mechanisms, build tools, frameworks, and so forth. If specific versions of other software are required, or known not to work, call that out.*
33+
## Alternatives
34+
35+
If bump-my-version does not fully suit your needs, you could take a look
36+
at other tools doing similar or related tasks:
37+
[ALTERNATIVES.md](https://github.com/c4urself/bump-my-version/blob/master/RELATED.md).
2338

2439
## Installation
2540

26-
_Detailed instructions on how to install, configure, and get the project running. This should be frequently tested to ensure reliability. Alternatively, link to a separate INSTALL document._
41+
You can download and install the latest version of this software from the Python package index (PyPI) as follows:
42+
43+
```console
44+
pip install --upgrade bump-my-version
45+
```
2746

28-
## Configuration
47+
## Changelog
2948

30-
_If the software is configurable, describe it in detail, either here or in other documentation to which you link._
49+
Please find the changelog here: [CHANGELOG.md](CHANGELOG.md)
3150

3251
## Usage
3352

34-
_Show users how to use the software. Be specific. Use appropriate formatting when showing code snippets._
53+
> **NOTE:**
54+
>
55+
> Throughout this document, you can use `bumpversion` or `bump-my-version` interchangeably.
56+
57+
There are two modes of operation: On the command line for single-file operation and using a configuration file for more complex multi-file operations.
58+
59+
bump-my-version [options] part [file]
60+
61+
### `part`
62+
63+
_**required**_
64+
65+
The part of the version to increase, e.g. `minor`.
66+
67+
Valid values include the named groups defined in the `parse` configuration.
68+
69+
Example bumping 0.5.1 to 0.6.0:
70+
71+
bump-my-version --current-version 0.5.1 minor
72+
73+
### `file`
74+
75+
_**[optional]**_<br />
76+
**default**: none
77+
78+
Additional files to modify.
79+
80+
These files are added to the list of files specified in your configuration file. If you want to rewrite only files specified on the command line, also use `--no-configured-files`.
81+
82+
Example bumping 1.1.9 to 2.0.0:
83+
84+
bump-my-version --current-version 1.1.9 major setup.py
85+
86+
## Configuration file
87+
88+
`bump-my-version` looks in four places for the configuration file to parse (in order of precedence):
89+
90+
1. `--config-file <FILE>` _(command line argument)_
91+
2. `BUMPVERSION_CONFIG_FILE=file` _(environment variable)_
92+
3. `.bumpversion.cfg` _(legacy)_
93+
4. `.bumpversion.toml`
94+
5. `setup.cfg` _(legacy)_
95+
6. `pyproject.toml`
96+
97+
`.toml` files are recommended due to their type handling. We will likely drop support for `ini`-style formats in the future due to issues with formatting and parsing. You should add your configuration file to your source code management system.
98+
99+
By using a configuration file, you no longer need to specify those options on the command line. The configuration file also allows greater flexibility in specifying how files are modified.
100+
101+
## Command-line Options
102+
103+
Most of the configuration values above can also be given as an option on the command line.
104+
Additionally, the following options are available:
105+
106+
`--dry-run, -n`
107+
Don't touch any files, just pretend. Best used with `--verbose`.
108+
109+
`--no-configured-files`
110+
Will not update/check files specified in the configuration file.
111+
112+
Similar to dry-run, but will also avoid checking the files. Also useful when you want to update just one file with e.g., `bump-my-version --no-configured-files major my-file.txt`
113+
114+
`--verbose, -v`
115+
Print useful information to stderr. If specified more than once, it will output more information.
116+
117+
`--list`
118+
List machine-readable information to stdout for consumption by other programs.
119+
120+
Example output:
121+
122+
current_version=0.0.18
123+
new_version=0.0.19
124+
125+
`-h, --help`
126+
Print help and exit
127+
128+
## Using bumpversion in a script
129+
130+
If you need to use the version generated by bumpversion in a script you can make use of the `--list` option, combined with `grep` and `sed`.
131+
132+
Say for example that you are using git-flow to manage your project and want to automatically create a release. When you issue `git flow release start` you already need to know the new version, before applying the change.
133+
134+
The standard way to get it in a bash script is
35135

36-
## How to test the software
136+
bump-my-version --dry-run --list <part> | grep <field name> | sed -r s,"^.*=",,
37137

38-
_If the software includes automated tests, detail how to run those tests._
138+
where `part` is as usual the part of the version number you are updating. You need to specify `--dry-run` to avoid bumpversion acting.
39139

40-
## Known issues
140+
For example, if you are updating the minor number and looking for the new version number this becomes
41141

42-
_Document any known significant shortcomings with the software._
142+
bump-my-version --dry-run --list minor | grep new_version | sed -r s,"^.*=",,
43143

44-
## Getting help
144+
## Development & Contributing
45145

46-
_Instruct users how to get help with this software; this might include links to an issue tracker, wiki, mailing list, etc._
146+
Thank you, contributors! You can find a full list here: https://github.com/callowayproject/bump-my-version/graphs/contributors
47147

148+
See also our [CONTRIBUTING.md](CONTRIBUTING.md)
48149

49-
## Getting involved
150+
Development of this happens on GitHub, patches including tests, and documentation
151+
are very welcome, as well as bug reports! Also please open an issue if this
152+
tool does not support every aspect of bumping versions in your development
153+
workflow, as it is intended to be very versatile.
50154

51-
_This section should detail why people should get involved and describe key areas you are currently focusing on; e.g., trying to get feedback on features, fixing certain bugs, building important pieces, etc._
155+
## License
52156

53-
_General instructions on how to contribute should be stated with a link to CONTRIBUTING.md._
157+
bump-my-version is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

docsrc/_static/css/custom.css

+26
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,37 @@
11
.class .sig-prename.descclassname {
22
display: none;
33
}
4+
45
.subheading {
56
line-height: 1.25;
67
margin-bottom: 0;
78
color: #646776;
89
}
10+
911
.subheading + section > h1 {
1012
margin-top: 0;
1113
}
14+
15+
.field-list p {
16+
margin: 0;
17+
}
18+
19+
dl.field-list {
20+
display: grid;
21+
grid-template-columns: fit-content(30%) auto;
22+
margin-bottom: 1rem;
23+
}
24+
25+
dl.field-list > dt {
26+
font-weight: bold;
27+
word-break: break-word;
28+
padding-left: 0.5em;
29+
padding-right: 5px;
30+
}
31+
32+
dl.field-list > dd {
33+
padding-left: 0.5em;
34+
margin-top: 0;
35+
margin-left: 0;
36+
margin-bottom: 0;
37+
}

docsrc/cli.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Command-line Interface
22
======================
33

4-
.. click:: bump_version.cli:cli
5-
:prog: bump_version
4+
.. click:: bumpversion.cli:cli
5+
:prog: bumpversion
66
:nested: full

docsrc/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import bumpversion
1212

1313
project = "bump-my-version"
14-
copyright = f"{date.today():%Y}, C H Robinson"
15-
author = "Data Science Team"
14+
copyright = f"{date.today():%Y} Calloway Project"
15+
author = "Contributors"
1616

1717
version = bumpversion.__version__
1818
release = bumpversion.__version__
@@ -64,6 +64,7 @@
6464
"smartquotes",
6565
"substitution",
6666
"tasklist",
67+
"fieldlist",
6768
]
6869
intersphinx_mapping = {
6970
"python": ("https://docs.python.org/3", None),

0 commit comments

Comments
 (0)