Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ install:
build: off

test_script:
- python -m tox -e py27-win,py35-win,py36-win
- python -m tox -e py35-win,py36-win
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ sudo: false # false enables container-based build for fast boot times on Linux

matrix:
include:
- os: linux
python: 2.7
env: TOXENV=py27
- os: linux
python: 3.4
env: TOXENV=py34
Expand All @@ -21,15 +18,8 @@ matrix:
env: TOXENV=py37
# # Warning: Don't try to use code coverage analysis with pypy as it is insanely slow
# - os: linux
# python: pypy
# env: TOXENV=pypy
# - os: linux
# python: pypy3
# env: TOXENV=pypy3
# Stock OSX Python
# - os: osx
# language: generic
# env: TOXENV=py27
# # Latest Python 3.x from Homebrew
# - os: osx
# language: generic
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 0.9.0 (TBD, 2018)
* Enhancements
* ``cmd2`` no longer depends on the ``six`` module
* Deletions (potentially breaking changes)
* Deleted all ``optparse`` code which had previously been deprecated in release 0.8.0
* The ``options`` decorator no longer exists
Expand Down
18 changes: 11 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,15 @@ The tables below list all prerequisites along with the minimum required version

| Prerequisite | Minimum Version |
| --------------------------------------------------- | --------------- |
| [Python](https://www.python.org/downloads/) | `3.4 or 2.7` |
| [six](https://pypi.python.org/pypi/six) | `1.8` |
| [pyparsing](http://pyparsing.wikispaces.com) | `2.0.3` |
| [Python](https://www.python.org/downloads/) | `3.4` |
| [pyparsing](http://pyparsing.wikispaces.com) | `2.1` |
| [pyperclip](https://github.com/asweigart/pyperclip) | `1.6` |

#### Additional prerequisites to run cmd2 unit tests

| Prerequisite | Minimum Version |
| ------------------------------------------- | --------------- |
| [pytest](http://doc.pytest.org/en/latest/) | `2.6.3` |
| [mock](https://pypi.python.org/pypi/six) | `1.0.1` |

### Additional prerequisites to build cmd2 documentation
| Prerequisite | Minimum Version |
Expand All @@ -73,7 +71,6 @@ If Python is already installed in your machine, run the following commands to va

```shell
python -V
pip freeze | grep six
pip freeze | grep pyparsing
```

Expand Down Expand Up @@ -193,10 +190,10 @@ Once you have cmd2 cloned, before you start any cmd2 application, you first need

```bash
# Install cmd2 prerequisites
pip install -U six pyparsing pyperclip
pip install -U pyparsing pyperclip

# Install prerequisites for running cmd2 unit tests
pip install -U pytest mock
pip install -U pytest

# Install prerequisites for building cmd2 documentation
pip install -U sphinx sphinx-rtd-theme
Expand Down Expand Up @@ -480,6 +477,13 @@ Here is some advice regarding what makes a good pull request (PR) from the persp
- Code coverage of the unit tests matters, try not to decrease it
- Think twice before adding dependencies to 3rd party libraries (outside of the Python standard library) because it could affect a lot of users

### Developing and Debugging in an IDE

We recommend using [Visual Studio Code](https://code.visualstudio.com) with the [Python extension](https://code.visualstudio.com/docs/languages/python) and it's [Integrated Terminal](https://code.visualstudio.com/docs/python/debugging) debugger for debugging since it has
excellent support for debugging console applications.

[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.

### Acknowledgement
Thanks to the good folks at [freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) for creating
an excellent `CONTRIBUTING` file which we have borrowed heavily from.
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,18 @@ Main Features
- Settable environment parameters
- Parsing commands with arguments using `argparse`, including support for sub-commands
- Sub-menu support via the ``AddSubmenu`` decorator
- Unicode character support (*Python 3 only*)
- Unicode character support
- Good tab-completion of commands, sub-commands, file system paths, and shell commands
- Python 2.7 and 3.4+ support
- Windows, macOS, and Linux support
- Support for Python 3.4+ on Windows, macOS, and Linux
- Trivial to provide built-in help for all commands
- Built-in regression testing framework for your applications (transcript-based testing)
- Transcripts for use with built-in regression can be automatically generated from `history -t`

Plan for dropping Python 2.7 support
------------------------------------
Support for Python 2.7 will be discontinued on April 15, 2018. After that date, new releases of `cmd2` will only support
Python 3. Older releases of `cmd2` will of course continue to support Python 2.7.
Python 2.7 support is EOL
-------------------------
Support for adding new features to the Python 2.7 release of ``cmd2`` was discontinued on April 15, 2018. Bug fixes will be supported for Python 2.7 via 0.8.x until August 31, 2018.

Supporting Python 2 is an increasing burden on our limited resources. Switching to support only Python 3 will allow
Supporting Python 2 was an increasing burden on our limited resources. Switching to support only Python 3 will allow
us to clean up the codebase, remove some cruft, and focus on developing new features.

Installation
Expand All @@ -58,12 +56,11 @@ On all operating systems, the latest stable version of `cmd2` can be installed u
pip install -U cmd2
```

cmd2 works with Python 2.7 and Python 3.4+ on Windows, macOS, and Linux. It is pure Python code with
the only 3rd-party dependencies being on [six](https://pypi.python.org/pypi/six),
[pyparsing](http://pyparsing.wikispaces.com), and [pyperclip](https://github.com/asweigart/pyperclip).
cmd2 works with Python 3.4+ on Windows, macOS, and Linux. It is pure Python code with
the only 3rd-party dependencies being on [pyparsing](http://pyparsing.wikispaces.com), and [pyperclip](https://github.com/asweigart/pyperclip).
Windows has an additional dependency on [pyreadline](https://pypi.python.org/pypi/pyreadline). Non-Windows platforms
have an additional dependency on [wcwidth](https://pypi.python.org/pypi/wcwidth). Finally, Python
3.4 and earlier have an additional dependency on [contextlib2](https://pypi.python.org/pypi/contextlib2).
3.4 has an additional dependency on [contextlib2](https://pypi.python.org/pypi/contextlib2).

For information on other installation options, see
[Installation Instructions](https://cmd2.readthedocs.io/en/latest/install.html) in the cmd2
Expand Down Expand Up @@ -154,14 +151,11 @@ Example cmd2 application (**examples/example.py**):
"""
A sample application for cmd2.
"""

import random
import argparse
import random
import cmd2

from cmd2 import Cmd, with_argparser


class CmdLineApp(Cmd):
class CmdLineApp(cmd2.Cmd):
""" Example cmd2 application. """

# Setting this true makes it run a shell command if a cmd2/cmd command doesn't exist
Expand All @@ -179,14 +173,14 @@ class CmdLineApp(Cmd):
self.shortcuts.update({'&': 'speak'})

# Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell
Cmd.__init__(self, use_ipython=False)
super().__init__(use_ipython=False)

speak_parser = argparse.ArgumentParser()
speak_parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay')
speak_parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE')
speak_parser.add_argument('-r', '--repeat', type=int, help='output [n] times')
speak_parser.add_argument('words', nargs='+', help='words to say')
@with_argparser(speak_parser)
@cmd2.with_argparser(speak_parser)
def do_speak(self, args):
"""Repeats what you tell me to."""
words = []
Expand All @@ -207,7 +201,7 @@ class CmdLineApp(Cmd):
mumble_parser = argparse.ArgumentParser()
mumble_parser.add_argument('-r', '--repeat', type=int, help='how many times to repeat')
mumble_parser.add_argument('words', nargs='+', help='words to say')
@with_argparser(mumble_parser)
@cmd2.with_argparser(mumble_parser)
def do_mumble(self, args):
"""Mumbles what you tell me to."""
repetitions = args.repeat or 1
Expand Down
Loading