Skip to content

Commit 52a6704

Browse files
committed
Add content for how to integrate cmd2 into your project
1 parent a19f527 commit 52a6704

2 files changed

Lines changed: 31 additions & 21 deletions

File tree

docs/overview/integrating.rst

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
Integrate cmd2 into your project
2-
--------------------------------
1+
Integrate cmd2 Into Your Project
2+
================================
33

4-
[TODO - show how to use semantic versions to add the correct version string to setup.py ]
4+
Once installed, you will want to ensure that your project's dependencies
5+
include ``cmd2``. Make sure your ``setup.py`` includes the following::
56

6-
[TODO - this is probably outdated advice]
7+
install_requires=[
8+
'cmd2>=1,<2',
9+
]
710

8-
``cmd2`` is contained in a small number of Python files, which can be easily
9-
copied into your project. *The copyright and license notice must be retained*.
11+
The ``cmd2`` project uses `Semantic Versioning <https://semver.org>`_, which
12+
means that any incompatible API changes will be release with a new major version
13+
number. We recommend that you follow the advice given by the Python Packaging
14+
User Guide related to `install_requires
15+
<https://packaging.python.org/discussions/install-requires-vs-requirements/>`_.
16+
By setting an upper bound on the allowed version, you can ensure that your
17+
project does not inadvertently get installed with an incompatible future version
18+
of ``cmd2``.
1019

11-
This is an option suitable for advanced Python users. You can simply include
12-
the files within your project's hierarchy. If you want to modify ``cmd2``, this
13-
may be a reasonable option. Though, we encourage you to use stock ``cmd2`` and
14-
either composition or inheritance to achieve the same goal.
1520

16-
This approach will obviously NOT automatically install the required 3rd-party
17-
dependencies, so you need to make sure the following Python packages are
18-
installed:
21+
macOS Considerations
22+
--------------------
1923

20-
* attrs
21-
* colorama
22-
* pyperclip
23-
* wcwidth
24+
TODO need a section about how to get the right readline installed on macos
2425

25-
On Windows, there is an additional dependency:
2626

27-
* pyreadline
27+
Windows Considerations
28+
-------------------------------
29+
30+
If you would like to use :ref:`features/completion:Completion`, and you want
31+
your application to run on Windows, you will need to ensure you install the
32+
``pyreadline`` package. Make sure to include the following in your ``setup.py``::
33+
34+
install_requires=[
35+
'cmd2>=1,<2',
36+
":sys_platform=='win32'": ['pyreadline'],
37+
]

docs/overview/summary.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ application?
88
Already built an application that uses cmd_ from the python standard library and
99
want to add more functionality with very little work?
1010

11-
``cmd2`` is a powerful python library for built command line applications. Start
12-
here to find out if this library is a good fit for your needs.
11+
``cmd2`` is a powerful python library for building command line applications.
12+
Start here to find out if this library is a good fit for your needs.
1313

1414
* :ref:`overview/featuretour:Feature Highlights` - a quick tour of a few of the
1515
features in ``cmd2``, for both developers and users

0 commit comments

Comments
 (0)