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
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
language: python

sudo: false # false enables container-based build for fast boot times on Linux

matrix:
include:
- os: linux
python: 3.4
env: TOXENV=py34
- os: linux
python: 3.5
env: TOXENV=py35
Expand All @@ -16,8 +11,11 @@ matrix:
- os: linux
python: 3.7
dist: xenial
sudo: true # Travis CI doesn't yet support official (non-development) Python 3.7 on container-based builds
env: TOXENV=py37
- os: linux
python: 3.8-dev
dist: xenial
env: TOXENV=py38
- os: linux
python: 3.5
env: TOXENV=docs
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.9.14 (TBD, 2019
* Enhancements
* Added support for and testing with Python 3.8, starting with 3.8 beta
* Breaking Changes
* Python 3.4 reached its [end of life](https://www.python.org/dev/peps/pep-0429/) on March 18, 2019 and is no longer supported by `cmd2`

## 0.9.13 (June 14, 2019)
* Bug Fixes
* Fixed issue where the wrong terminator was being appended by `Statement.expanded_command_line()`
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The tables below list all prerequisites along with the minimum required version

| Prerequisite | Minimum Version |
| --------------------------------------------------- | --------------- |
| [python](https://www.python.org/downloads/) | `3.4` |
| [python](https://www.python.org/downloads/) | `3.5` |
| [attrs](https://github.com/python-attrs/attrs) | `16.3` |
| [colorama](https://github.com/tartley/colorama) | `0.3.7` |
| [pyperclip](https://github.com/asweigart/pyperclip) | `1.5.27` |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Main Features
- Unicode character support
- Good tab-completion of commands, sub-commands, file system paths, and shell commands
- Automatic tab-completion of `argparse` flags when using one of the `cmd2` `argparse` decorators
- Support for Python 3.4+ on Windows, macOS, and Linux
- Support for Python 3.5+ 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` or `load -t`
Expand All @@ -59,7 +59,7 @@ On all operating systems, the latest stable version of `cmd2` can be installed u
pip install -U cmd2
```

cmd2 works with Python 3.4+ on Windows, macOS, and Linux. It is pure Python code with few 3rd-party dependencies.
cmd2 works with Python 3.5+ on Windows, macOS, and Linux. It is pure Python code with few 3rd-party dependencies.

For information on other installation options, see
[Installation Instructions](https://cmd2.readthedocs.io/en/latest/install.html) in the cmd2
Expand Down
3 changes: 0 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
# Run the pipeline with multiple Python versions
strategy:
matrix:
Python34:
python.version: '3.4'
TOXENV: 'py34'
Python35:
python.version: '3.5'
TOXENV: 'py35'
Expand Down
7 changes: 1 addition & 6 deletions cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import sys
import threading
from collections import namedtuple
from contextlib import redirect_stdout
from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, Union, IO

import colorama
Expand Down Expand Up @@ -103,12 +104,6 @@ def __subclasshook__(cls, C):
return True
return NotImplemented

# Python 3.4 require contextlib2 for temporarily redirecting stderr and stdout
if sys.version_info < (3, 5):
# noinspection PyUnresolvedReferences
from contextlib2 import redirect_stdout
else:
from contextlib import redirect_stdout

# Detect whether IPython is installed to determine if the built-in "ipy" command should be included
ipython_available = True
Expand Down
8 changes: 1 addition & 7 deletions cmd2/pyscript_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@
"""

import sys
from contextlib import redirect_stdout, redirect_stderr
from typing import Optional

from .utils import namedtuple_with_defaults, StdSim

# Python 3.4 require contextlib2 for temporarily redirecting stderr and stdout
if sys.version_info < (3, 5):
# noinspection PyUnresolvedReferences
from contextlib2 import redirect_stdout, redirect_stderr
else:
from contextlib import redirect_stdout, redirect_stderr


class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr', 'stop', 'data'])):
"""Encapsulates the results from a cmd2 app command
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Contents:
Compatibility
=============

Tested and working with Python 3.4+ on Windows, macOS, and Linux.
Tested and working with Python 3.5+ on Windows, macOS, and Linux.

Index
=====
Expand Down
8 changes: 2 additions & 6 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This section covers the basics of how to install, upgrade, and uninstall ``cmd2`

Installing
----------
First you need to make sure you have Python 3.4+, pip_, and setuptools_. Then you can just use pip to
First you need to make sure you have Python 3.5+, pip_, and setuptools_. Then you can just use pip to
install from PyPI_.

.. _pip: https://pypi.python.org/pypi/pip
Expand All @@ -25,7 +25,7 @@ install from PyPI_.

Requirements for Installing
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* If you have Python 3 >=3.4 installed from `python.org
* If you have Python 3 >=3.5 installed from `python.org
<https://www.python.org>`_, you will already have pip_ and
setuptools_, but may need to upgrade to the latest versions:

Expand Down Expand Up @@ -124,10 +124,6 @@ If you wish to permanently uninstall ``cmd2``, this can also easily be done with

pip uninstall cmd2

Extra requirements for Python 3.4
---------------------------------
``cmd2`` requires the ``contextlib2`` module for Python 3.4. This is used to temporarily redirect
stdout and stderr. Also when using Python 3.4, ``cmd2`` requires the ``typing`` module backport.

Extra requirement for macOS
===========================
Expand Down
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines()))) # noqa: E128
Expand All @@ -36,14 +36,12 @@
EXTRAS_REQUIRE = {
# Windows also requires pyreadline to ensure tab completion works
":sys_platform=='win32'": ['pyreadline'],
# Python 3.4 and earlier require contextlib2 for temporarily redirecting stderr and stdout
":python_version<'3.5'": ['contextlib2', 'typing'],
# Extra dependencies for running unit tests
'test': ["gnureadline; sys_platform=='darwin'", # include gnureadline on macOS to ensure it is available in tox env
"mock ; python_version<'3.6'", # for python 3.5 and earlier we need the third party mock module
"mock ; python_version<'3.6'", # for python 3.5 we need the third party mock module
'codecov', 'pytest', 'pytest-cov', 'pytest-mock'],
# development only dependencies: install with 'pip install -e .[dev]'
'dev': ["mock ; python_version<'3.6'", # for python 3.5 and earlier we need the third party mock module
'dev': ["mock ; python_version<'3.6'", # for python 3.5 we need the third party mock module
'pytest', 'codecov', 'pytest-cov', 'pytest-mock', 'tox', 'pylint',
'sphinx', 'sphinx-rtd-theme', 'sphinx-autobuild', 'invoke', 'twine>=1.11',
]
Expand All @@ -63,7 +61,7 @@
platforms=['any'],
packages=['cmd2'],
keywords='command prompt console cmd',
python_requires='>=3.4',
python_requires='>=3.5',
setup_requires=SETUP_REQUIRES,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
Expand Down
7 changes: 1 addition & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Cmd2 unit/functional testing
"""
import sys
from contextlib import redirect_stdout, redirect_stderr
from typing import Optional
from unittest import mock

Expand All @@ -11,12 +12,6 @@
import cmd2
from cmd2.utils import StdSim

# Python 3.4 require contextlib2 for temporarily redirecting stderr and stdout
if sys.version_info < (3, 5):
# noinspection PyUnresolvedReferences
from contextlib2 import redirect_stdout, redirect_stderr
else:
from contextlib import redirect_stdout, redirect_stderr

# Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit)
try:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = docs,py34,py35,py36,py37
envlist = docs,py35,py36,py37,py38

[pytest]
testpaths = tests
Expand Down