@@ -11,12 +11,12 @@ We welcome pull requests from cmd2 users and seasoned Python developers alike! F
11
11
12
12
Remember to feel free to ask for help by leaving a comment within the Issue.
13
13
14
- Working on your first pull request? You can learn how from the
14
+ Working on your first pull request? You can learn how from the
15
15
[ GitHub Docs] ( https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request ) .
16
16
17
17
###### If you've found a bug that is not on the board, [ follow these steps] ( ../README.md#found-a-bug ) .
18
18
19
- --------------------------------------------------------------------------------
19
+ ---
20
20
21
21
## Contribution guidelines
22
22
@@ -46,39 +46,38 @@ The tables below list all prerequisites along with the minimum required version
46
46
47
47
#### Prerequisites to run cmd2 applications
48
48
49
- | Prerequisite | Minimum Version |
50
- | ------------------------------------------------------ | ----------------- |
51
- | [ python] ( https://www.python.org/downloads/ ) | ` 3.8 ` |
52
- | [ pyperclip] ( https://github.com/asweigart/pyperclip ) | ` 1.8.2 ` |
53
- | [ wcwidth] ( https://pypi.python.org/pypi/wcwidth ) | ` 0.2.12 ` |
49
+ | Prerequisite | Minimum Version |
50
+ | --------------------------------------------------- | --------------- |
51
+ | [ python] ( https://www.python.org/downloads/ ) | ` 3.8 ` |
52
+ | [ pyperclip] ( https://github.com/asweigart/pyperclip ) | ` 1.8.2 ` |
53
+ | [ wcwidth] ( https://pypi.python.org/pypi/wcwidth ) | ` 0.2.12 ` |
54
54
55
55
#### Additional prerequisites to build and publish cmd2
56
56
57
57
| Prerequisite | Minimum Version |
58
- | ---------------------------------------------------------- | ----------------- |
58
+ | -------------------------------------------------------- | --------------- |
59
59
| [ build] ( https://pypi.org/project/build/ ) | ` 1.2.2 ` |
60
60
| [ setuptools] ( https://pypi.org/project/setuptools/ ) | ` 72.1.0 ` |
61
61
| [ setuptools-scm] ( https://github.com/pypa/setuptools-scm ) | ` 8.0.4 ` |
62
62
| [ twine] ( https://github.com/pypa/twine ) | ` 5.1.1 ` |
63
63
64
64
#### Additional prerequisites for developing cmd2
65
65
66
- | Prerequisite | Minimum Version | Purpose |
67
- | ----------------------------------------------------------------------| -----------------| ----------------------------|
68
- | [ codecov] ( http://doc.pytest.org/en/latest/ ) | ` 2.1.13 ` | Cover coverage reporting |
69
- | [ doc8] ( https://github.com/PyCQA/doc8 ) | ` 1.1.2 ` | Sphinx style checker |
70
- | [ invoke] ( https://www.pyinvoke.org/ ) | ` 2.2.0 ` | Command automation |
71
- | [ mypy] ( https://mypy-lang.org/ ) | ` 1.13.0 ` | Static type checker |
72
- | [ pytest] ( https://docs.pytest.org/en/stable/ ) | ` 3.0.6 ` | Unit and integration tests |
73
- | [ pytest-cov] ( http://doc.pytest.org/en/latest/ ) | ` 6.0.0 ` | Pytest code coverage |
74
- | [ pytest-mock] ( https://pypi.org/project/pytest-mock/ ) | ` 3.14.0 ` | Pytest mocker fixture |
75
- | [ sphinx] ( https://www.sphinx-doc.org/en/master/ ) | ` 8.1.3 ` | Documentation |
76
- | [ sphinx-autobuild] ( hhttps://pypi.org/project/sphinx-autobuild/ ) | ` 2024.10.3 ` | Rebuild docs on changes |
77
- | [ sphinx-rtd-theme] ( https://github.com/readthedocs/sphinx_rtd_theme ) | ` 3.0.1 ` | Sphinx theme for RTD |
78
- | [ ruff] ( https://github.com/astral-sh/ruff ) | ` 0.7.3 ` | Fast linter and formatter |
79
- | [ uv] ( https://github.com/astral-sh/uv ) | ` 0.5.1 ` | Python package management |
80
-
81
-
66
+ | Prerequisite | Minimum Version | Purpose |
67
+ | ------------------------------------------------------------------------------------------ | --------------- | --------------------------------- |
68
+ | [ codecov] ( http://doc.pytest.org/en/latest/ ) | ` 2.1.13 ` | Cover coverage reporting |
69
+ | [ invoke] ( https://www.pyinvoke.org/ ) | ` 2.2.0 ` | Command automation |
70
+ | [ griffe_typingdoc] ( https://github.com/mkdocstrings/griffe-typingdoc ) | ` 0.2.7 ` | mkdocstrings extension for typing |
71
+ | [ mypy] ( https://mypy-lang.org/ ) | ` 1.13.0 ` | Static type checker |
72
+ | [ pytest] ( https://docs.pytest.org/en/stable/ ) | ` 3.0.6 ` | Unit and integration tests |
73
+ | [ pytest-cov] ( http://doc.pytest.org/en/latest/ ) | ` 6.0.0 ` | Pytest code coverage |
74
+ | [ pytest-mock] ( https://pypi.org/project/pytest-mock/ ) | ` 3.14.0 ` | Pytest mocker fixture |
75
+ | [ mkdocs-include-markdown-plugin] ( https://pypi.org/project/mkdocs-include-markdown-plugin/ ) | ` 7.1.2 ` | MkDocs Plugin include MkDn |
76
+ | [ mkdocs-macros-plugin] ( https://mkdocs-macros-plugin.readthedocs.io/ ) | ` 1.3.7 ` | MkDocs Plugin for macros |
77
+ | [ mkdocs-material] ( https://squidfunk.github.io/mkdocs-material/ ) | ` 9.5.49 ` | Documentation |
78
+ | [ mkdocstrings[ python]] ( https://mkdocstrings.github.io/ ) | ` 0.27.0 ` | MkDocs Plugin for Python AutoDoc |
79
+ | [ ruff] ( https://github.com/astral-sh/ruff ) | ` 0.7.3 ` | Fast linter and formatter |
80
+ | [ uv] ( https://github.com/astral-sh/uv ) | ` 0.5.1 ` | Python package management |
82
81
83
82
If Python is already installed in your machine, run the following commands to validate the versions:
84
83
@@ -89,11 +88,12 @@ $ pip freeze | grep pyperclip
89
88
90
89
If your versions are lower than the prerequisite versions, you should update.
91
90
92
- If you do not already have Python installed on your machine, we recommend using [ uv] ( https://github.com/astral-sh/uv )
91
+ If you do not already have Python installed on your machine, we recommend using [ uv] ( https://github.com/astral-sh/uv )
93
92
for all of your Python needs because it is extremely fast, meets all Python installation and packaging needs, and works
94
- on all platforms (Windows, Mac, and Linux). You can install ` uv ` using instructions at the link above.
93
+ on all platforms (Windows, Mac, and Linux). You can install ` uv ` using instructions at the link above.
95
94
96
95
You can then install multiple versions of Python using ` uv ` like so:
96
+
97
97
``` sh
98
98
uv python install 3.10 3.11 3.12 3.13
99
99
```
@@ -147,31 +147,31 @@ Do this prior to every time you create a branch for a PR:
147
147
1 . Make sure you are on the ` master ` branch
148
148
149
149
> ``` sh
150
- > $ git status
151
- > On branch master
152
- > Your branch is up-to-date with ' origin/master' .
153
- > ` ` `
150
+ > $ git status
151
+ > On branch master
152
+ > Your branch is up-to-date with ' origin/master' .
153
+ > ` ` `
154
154
155
155
> If your aren' t on `master`, resolve outstanding files and commits and checkout the `master` branch
156
156
157
157
> ```sh
158
- > $ git checkout master
159
- > ```
158
+ > $ git checkout master
159
+ > ```
160
160
161
161
2. Do a pull with rebase against `upstream`
162
162
163
163
> ```sh
164
- > $ git pull --rebase upstream master
165
- > ```
164
+ > $ git pull --rebase upstream master
165
+ > ```
166
166
167
167
> This will pull down all of the changes to the official master branch, without making an additional commit in your
168
168
> local repo.
169
169
170
170
3. (_Optional_) Force push your updated master branch to your GitHub fork
171
171
172
172
> ```sh
173
- > $ git push origin master --force
174
- > ```
173
+ > $ git push origin master --force
174
+ > ```
175
175
176
176
> This will overwrite the master branch of your fork.
177
177
@@ -213,8 +213,8 @@ package from the source.
213
213
214
214
` cmd2 ` has support for using [ uv] ( https://github.com/astral-sh/uv ) for development.
215
215
216
- ` uv ` is single tool to replace ` pip ` , ` pip-tools ` , ` pipx ` , ` poetry ` , ` pyenv ` , ` twine ` , ` virtualenv ` , and more. ` cmd2 `
217
- contains configuration for using ` uv ` in it's ` pyproject.toml ` file which makes it extremely easy to setup a ` cmd2 `
216
+ ` uv ` is single tool to replace ` pip ` , ` pip-tools ` , ` pipx ` , ` poetry ` , ` pyenv ` , ` twine ` , ` virtualenv ` , and more. ` cmd2 `
217
+ contains configuration for using ` uv ` in it's ` pyproject.toml ` file which makes it extremely easy to setup a ` cmd2 `
218
218
development environment using ` uv ` .
219
219
220
220
To create a virtual environment and install everything needed for ` cmd2 ` development using ` uv ` , do the following
@@ -238,6 +238,7 @@ uv run examples/basic.py
238
238
```
239
239
240
240
Alternatively you can activate the virtual environment using the OS-specific command such as this on Linux or macOS:
241
+
241
242
``` sh
242
243
source .venv/bin/activate
243
244
```
@@ -316,7 +317,7 @@ primarily related to continuous integration and release deployment.
316
317
#### Changes to the documentation files
317
318
318
319
If you made changes to any file in the ` /docs ` directory, you need to build the
319
- Sphinx documentation and make sure your changes look good:
320
+ MkDocs documentation and make sure your changes look good:
320
321
321
322
``` sh
322
323
$ uv inv docs
@@ -337,7 +338,7 @@ served (usually [http://localhost:8000](http://localhost:8000)).
337
338
### Code Quality Checks
338
339
339
340
You should have some sort of [ PEP 8] ( https://www.python.org/dev/peps/pep-0008/ ) -based linting running in your editor or
340
- IDE or at the command line before you commit code. ` cmd2 ` uses [ ruff] ( https://github.com/astral-sh/ruff ) as part of
341
+ IDE or at the command line before you commit code. ` cmd2 ` uses [ ruff] ( https://github.com/astral-sh/ruff ) as part of
341
342
its continuous integration (CI) process for both linting and auto-formatting.
342
343
343
344
> Please do not ignore any linting errors in code you write or modify, as they are meant to ** help** you and to ensure a
@@ -440,7 +441,7 @@ nothing to commit, working directory clean
440
441
any outstanding files/commits and checkout master ` git checkout master `
441
442
442
443
2 . Create a branch off of ` master ` with git: `git checkout -B
443
- branch/name-here` ** Note:** Branch naming is important. Use a name like
444
+ branch/name-here` ** Note:** Branch naming is important. Use a name like
444
445
` fix/short-fix-description ` or ` feature/short-feature-description ` . Review
445
446
the [ Contribution Guidelines] ( #contribution-guidelines ) for more detail.
446
447
@@ -449,7 +450,7 @@ nothing to commit, working directory clean
449
450
4 . Check your ` git status ` to see unstaged files
450
451
451
452
5 . Add your edited files: ` git add path/to/filename.ext ` You can also do: `git
452
- add .` to add all unstaged files. Take care, though, because you can
453
+ add .` to add all unstaged files. Take care, though, because you can
453
454
accidentally add files you don't want added. Review your ` git status ` first.
454
455
455
456
6 . Commit your edits: ` git commit -m "Brief description of commit" ` . Do not add the issue number in the commit message.
@@ -482,17 +483,17 @@ how to do it.
482
483
4 . The title (also called the subject) of your PR should be descriptive of your
483
484
changes and succinctly indicate what is being fixed
484
485
485
- - ** Do not add the issue number in the PR title or commit message**
486
+ - ** Do not add the issue number in the PR title or commit message**
486
487
487
- - Examples: ` Add test cases for Unicode support ` ; ` Correct typo in overview documentation `
488
+ - Examples: ` Add test cases for Unicode support ` ; ` Correct typo in overview documentation `
488
489
489
490
5 . In the body of your PR include a more detailed summary of the changes you
490
491
made and why
491
492
492
- - If the PR is meant to fix an existing bug/issue, then, at the end of
493
- your PR's description, append the keyword ` closes ` and #xxxx (where xxxx
494
- is the issue number). Example: ` closes #1337 ` . This tells GitHub to
495
- close the existing issue if the PR is merged.
493
+ - If the PR is meant to fix an existing bug/issue, then, at the end of
494
+ your PR's description, append the keyword ` closes ` and #xxxx (where xxxx
495
+ is the issue number). Example: ` closes #1337 ` . This tells GitHub to
496
+ close the existing issue if the PR is merged.
496
497
497
498
6 . Indicate what local testing you have done (e.g. what OS and version(s) of Python did you run the
498
499
unit test suite with)
@@ -632,8 +633,8 @@ mostly automated. The manual steps are all git operations. Here's the checklist:
632
633
1 . Make sure all the unit tests pass with ` invoke pytest ` or ` py.test `
633
634
1 . Make sure latest year in ` LICENSE ` matches current year
634
635
1 . Make sure ` CHANGELOG.md ` describes the version and has the correct release date
635
- 1 . Add a git tag representing the version number using `` invoke tag x.y.z ` `
636
- * Where x, y, and z are all small non-negative integers
636
+ 1 . Add a git tag representing the version number using ` invoke tag x.y.z `
637
+ - Where x, y, and z are all small non-negative integers
637
638
1 . (Optional) Run ` invoke pypi-test ` to clean, build, and upload a new release to [ Test PyPi] ( https://test.pypi.org )
638
639
1 . Run ` invoke pypi ` to clean, build, and upload a new release to [ PyPi] ( https://pypi.org/ )
639
640
0 commit comments