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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
build
dist
cmd2.egg-info
.eggs
.cache
*.pyc
.tox
Expand Down
12 changes: 10 additions & 2 deletions cmd2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#
# -*- coding: utf-8 -*-
"""This simply imports certain things for backwards compatibility."""
from .cmd2 import __version__, Cmd, Statement, EmptyStatement, categorize

from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is finally going to make me abandon my PYTHONPATH hack way of doing cmd2 development and switch to the pip way instead using:

$ cd ~/src/cmd2
$ pip install -e .

But that is probably a good thing ...

except DistributionNotFound:
# package is not installed
pass

from .cmd2 import Cmd, Statement, EmptyStatement, categorize
from .cmd2 import with_argument_list, with_argparser, with_argparser_and_unknown_args, with_category
from .pyscript_bridge import CommandResult
from .pyscript_bridge import CommandResult
2 changes: 0 additions & 2 deletions cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ def __subclasshook__(cls, C):
except ImportError: # pragma: no cover
ipython_available = False

__version__ = '0.9.4'


# optional attribute, when tagged on a function, allows cmd2 to categorize commands
HELP_CATEGORY = 'help_category'
Expand Down
11 changes: 6 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,18 @@

# General information about the project.
project = 'cmd2'
copyright = '2010-2017, Catherine Devlin and Todd Leonhardt'
copyright = '2010-2018, Catherine Devlin and Todd Leonhardt'
author = 'Catherine Devlin and Todd Leonhardt'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.9'
# The full version, including alpha/beta/rc tags.
release = '0.9.4'
from pkg_resources import get_distribution
# version will look like x.y.z
version = get_distribution('cmd2').version
# release will look like x.y
release = '.'.join(version.split('.')[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""
from setuptools import setup

VERSION = '0.9.4'
DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python"
LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make
it quick and easy for developers to build feature-rich and user-friendly interactive command line applications. It
Expand Down Expand Up @@ -60,6 +59,8 @@
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines())))

SETUP_REQUIRES = ['setuptools_scm']

INSTALL_REQUIRES = ['pyperclip >= 1.5.27', 'colorama', 'attrs']

EXTRAS_REQUIRE = {
Expand All @@ -79,7 +80,7 @@

setup(
name="cmd2",
version=VERSION,
use_scm_version=True,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
classifiers=CLASSIFIERS,
Expand All @@ -91,6 +92,7 @@
packages=['cmd2'],
keywords='command prompt console cmd',
python_requires='>=3.4',
setup_requires=SETUP_REQUIRES,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
)
5 changes: 2 additions & 3 deletions tests/test_cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
HELP_HISTORY, SHORTCUTS_TXT, SHOW_TXT, SHOW_LONG, StdOut


def test_ver():
assert cmd2.__version__ == '0.9.4'

def test_version(base_app):
assert cmd2.__version__

def test_empty_statement(base_app):
out = run_cmd(base_app, '')
Expand Down