Skip to content

Commit 9b78cf4

Browse files
committed
Added info on semantic versioning and branching strategy to CONTRIBUTING.md
Also: - Added isort to Pipenv dev - Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke - Ran isort to sort includes
1 parent 9c7bbfa commit 9b78cf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+143
-63
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The tables below list all prerequisites along with the minimum required version
6565
#### Additional prerequisites to build cmd2 documentation
6666
| Prerequisite | Minimum Version |
6767
| ------------------------------------------- | --------------- |
68-
| [sphinx](http://www.sphinx-doc.org) | `1.4.9` |
68+
| [sphinx](http://www.sphinx-doc.org) | `2.0.0` |
6969
| [sphinx-rtd-theme](https://github.com/snide/sphinx_rtd_theme) | `0.1.9` |
7070

7171
#### Optional prerequisites for enhanced unit test features
@@ -211,7 +211,7 @@ pipenv install --dev
211211
To create a new virtualenv, using a specific version of Python you have installed (and on your PATH), use the
212212
--python VERSION flag, like so:
213213
```sh
214-
pipenv install --dev --python 3.7
214+
pipenv install --dev --python 3.8
215215
```
216216

217217
Then you can enter that virtual environment with:
@@ -221,8 +221,8 @@ pipenv shell
221221

222222
#### Create a new environment for cmd2 using Conda
223223
```sh
224-
$ conda create -n cmd2_py36 python=3.6
225-
$ conda activate cmd2_py36
224+
$ conda create -n cmd2_py37 python=3.7
225+
$ conda activate cmd2_py37
226226
```
227227

228228
#### Create a new environment for cmd using Virtualenv
@@ -233,13 +233,13 @@ We recommend that you use [pyenv](https://github.com/pyenv/pyenv) to manage your
233233
pyenv versions
234234

235235
# Install python version defined
236-
pyenv install 3.6.3
236+
pyenv install 3.8.2
237237
```
238238
With the Python version installed, you can set the virtualenv properly.
239239

240240
```sh
241241
$ cd ~/src/cmd2
242-
$ virtualenv -p $(pyenv root)/versions/3.6.3/ cmd_py36
242+
$ virtualenv -p $(pyenv root)/versions/3.8.2/ cmd_py38
243243
$ source ~/src/cmd2/bin/activate
244244
```
245245

@@ -544,6 +544,33 @@ excellent support for debugging console applications.
544544

545545
[PyCharm](https://www.jetbrains.com/pycharm/) is also quite good and has very nice [code inspection](https://www.jetbrains.com/help/pycharm/code-inspection.html) capabilities.
546546

547+
## Branching Strategy and Semantic Versioning
548+
549+
Starting with version 1.0.0, `cmd2` has adopted [Semantic Versioning](https://semver.org).
550+
551+
### Semantic Versioning Summary
552+
Given a version number `MAJOR`.`MINOR`.`PATCH`, increment the:
553+
554+
- `MAJOR` version when you make incompatible API changes,
555+
- `MINOR` version when you add functionality in a backwards compatible manner, and
556+
- `PATCH` version when you make backwards compatible bug fixes.
557+
558+
### Branching Strategy
559+
560+
We use the **master** branch for the upcoming `PATCH` release - i.e. if the current version
561+
of `cmd2` is 1.0.2, then the **master** branch contains code which is planned for release
562+
in 1.0.3.
563+
564+
If work needs to be done for a `MAJOR` or `MINOR` release when we anticipate there will be
565+
a `PATCH` release in-between, then a branch should be created named for the appropriate version
566+
number for the work, e.g. if the current release of `cmd2` is 1.0.2 and a backwards-incompatible
567+
change needs to be committed for an upcoming `MAJOR` release, then this work should be committed
568+
to a **2.0.0** branch until such a time as we are ready to release version 2.0.0.
569+
570+
Following this strategy, releases are always done from the **master** branch and `MAJOR` or `MINOR`
571+
branches are merged to **master** immediately prior to doing a release. Once merged to **master**, the
572+
other branches can be deleted. All releases are tagged so that they can be reproduced if necessary.
573+
547574
## Publishing a new release
548575

549576
Since 0.9.2, the process of publishing a new release of `cmd2` to [PyPi](https://pypi.org/) has been

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ flake8 = "*"
1818
gnureadline = {version = "*",sys_platform = "== 'darwin'"}
1919
invoke = "*"
2020
ipython = "*"
21+
isort = "*"
2122
mock = {version = "*",markers = "python_version < '3.6'"}
2223
plumbum = "*"
2324
pyreadline = {version = "*",sys_platform = "== 'win32'"}

cmd2/ansi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import functools
77
import re
88
from enum import Enum
9-
from typing import Any, IO, List, Union
9+
from typing import IO, Any, List, Union
1010

1111
import colorama
12-
from colorama import Fore, Back, Style
12+
from colorama import Back, Fore, Style
1313
from wcwidth import wcswidth
1414

1515
# On Windows, filter ANSI escape codes out of text sent to stdout/stderr, and replace them with equivalent Win32 calls

cmd2/argparse_completer.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414
from typing import Dict, List, Optional, Union
1515

1616
from . import ansi, cmd2, constants
17-
from .argparse_custom import ATTR_CHOICES_CALLABLE, generate_range_error
18-
from .argparse_custom import ATTR_SUPPRESS_TAB_HINT, ATTR_DESCRIPTIVE_COMPLETION_HEADER, ATTR_NARGS_RANGE
19-
from .argparse_custom import ChoicesCallable, CompletionItem
20-
from .utils import basic_complete, CompletionError
17+
from .argparse_custom import (
18+
ATTR_CHOICES_CALLABLE,
19+
ATTR_DESCRIPTIVE_COMPLETION_HEADER,
20+
ATTR_NARGS_RANGE,
21+
ATTR_SUPPRESS_TAB_HINT,
22+
ChoicesCallable,
23+
CompletionItem,
24+
generate_range_error,
25+
)
26+
from .utils import CompletionError, basic_complete
2127

2228
# If no descriptive header is supplied, then this will be used instead
2329
DEFAULT_DESCRIPTIVE_HEADER = 'Description'

cmd2/argparse_custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def my_completer_method(self, text, line, begidx, endidx, arg_tokens)
203203
import re
204204
import sys
205205
# noinspection PyUnresolvedReferences,PyProtectedMember
206-
from argparse import ZERO_OR_MORE, ONE_OR_MORE, ArgumentError, _
206+
from argparse import ONE_OR_MORE, ZERO_OR_MORE, ArgumentError, _
207207
from typing import Callable, Optional, Tuple, Type, Union
208208

209209
from . import ansi, constants

cmd2/cmd2.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,14 @@
4242
from contextlib import redirect_stdout
4343
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Tuple, Type, Union
4444

45-
from . import ansi
46-
from . import constants
47-
from . import plugin
48-
from . import utils
49-
from .argparse_custom import CompletionItem, DEFAULT_ARGUMENT_PARSER
45+
from . import ansi, constants, plugin, utils
46+
from .argparse_custom import DEFAULT_ARGUMENT_PARSER, CompletionItem
5047
from .clipboard import can_clip, get_paste_buffer, write_to_paste_buffer
5148
from .decorators import with_argparser
5249
from .exceptions import Cmd2ArgparseError, Cmd2ShlexError, EmbeddedConsoleExit, EmptyStatement, RedirectionError
5350
from .history import History, HistoryItem
54-
from .parsing import StatementParser, Statement, Macro, MacroArg, shlex_split
55-
from .rl_utils import rl_type, RlType, rl_get_point, rl_set_prompt, vt100_support, rl_make_safe_prompt, rl_warning
51+
from .parsing import Macro, MacroArg, Statement, StatementParser, shlex_split
52+
from .rl_utils import RlType, rl_get_point, rl_make_safe_prompt, rl_set_prompt, rl_type, rl_warning, vt100_support
5653
from .utils import CompletionError, Settable
5754

5855
# Set up readline

cmd2/history.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import re
7-
87
from typing import List, Union
98

109
import attr

cmd2/parsing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
import attr
1010

11-
from . import constants
12-
from . import utils
11+
from . import constants, utils
1312
from .exceptions import Cmd2ShlexError
1413

1514

cmd2/py_bridge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"""
66

77
import sys
8-
from contextlib import redirect_stdout, redirect_stderr
8+
from contextlib import redirect_stderr, redirect_stdout
99
from typing import Optional
1010

11-
from .utils import namedtuple_with_defaults, StdSim
11+
from .utils import StdSim, namedtuple_with_defaults
1212

1313

1414
class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr', 'stop', 'data'])):

cmd2/rl_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"""
33
Imports the proper readline for the platform and provides utility functions for it
44
"""
5-
from enum import Enum
65
import sys
6+
from enum import Enum
77

88
# Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit)
99
try:

0 commit comments

Comments
 (0)