diff options
-rw-r--r-- | CONTRIBUTING.rst | 4 | ||||
-rw-r--r-- | README.rst | 10 | ||||
-rw-r--r-- | cliff/columns.py | 9 | ||||
-rw-r--r-- | cliff/commandmanager.py | 8 | ||||
-rw-r--r-- | demoapp/setup.py | 5 | ||||
-rw-r--r-- | doc/source/contributors/index.rst | 6 | ||||
-rw-r--r-- | doc/source/install/index.rst | 17 | ||||
-rw-r--r-- | doc/source/user/introduction.rst | 5 | ||||
-rw-r--r-- | lower-constraints.txt | 3 | ||||
-rw-r--r-- | setup.cfg | 1 | ||||
-rw-r--r-- | tox.ini | 4 |
11 files changed, 32 insertions, 40 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 0550e59..a39b072 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -5,6 +5,6 @@ following the workflow documented at: Pull requests submitted through GitHub will be ignored. -Bugs should be filed on Launchpad, not GitHub: +Bugs should be filed on Storyboard, not GitHub or Launchpad: - https://bugs.launchpad.net/python-cliff + https://storyboard.openstack.org/#!/project/openstack/cliff @@ -11,14 +11,14 @@ Team and repository tags cliff -- Command Line Interface Formulation Framework ======================================================= -cliff is a framework for building command line programs. It uses -`setuptools entry points`_ to provide subcommands, output formatters, and -other extensions. +cliff is a framework for building command line programs. +It uses `entry points`_ to provide subcommands, output formatters, and other +extensions. -.. _setuptools entry points: http://setuptools.readthedocs.io/en/latest/pkg_resources.html#convenience-api +.. _entry points: https://packaging.python.org/specifications/entry-points/ * Free software: Apache license * Documentation: https://docs.openstack.org/cliff/latest/ * Source: https://opendev.org/openstack/cliff -* Bugs: https://bugs.launchpad.net/python-cliff +* Bugs: https://storyboard.openstack.org/#!/project/openstack/cliff * Contributors: https://github.com/openstack/cliff/graphs/contributors diff --git a/cliff/columns.py b/cliff/columns.py index abf1c4f..3b3c2bc 100644 --- a/cliff/columns.py +++ b/cliff/columns.py @@ -24,10 +24,14 @@ class FormattableColumn(object): def __init__(self, value): self._value = value + def __eq__(self, other): + return ( + self.__class__ == other.__class__ and self._value == other._value + ) + @abc.abstractmethod def human_readable(self): - """Return a basic human readable version of the data. - """ + """Return a basic human readable version of the data.""" def machine_readable(self): """Return a raw data structure using only Python built-in types. @@ -35,6 +39,5 @@ class FormattableColumn(object): It must be possible to serialize the return value directly using a formatter like JSON, and it will be up to the formatter plugin to decide how to make that transformation. - """ return self._value diff --git a/cliff/commandmanager.py b/cliff/commandmanager.py index d49f358..1787fcf 100644 --- a/cliff/commandmanager.py +++ b/cliff/commandmanager.py @@ -50,11 +50,10 @@ class EntryPointWrapper(object): class CommandManager(object): """Discovers commands and handles lookup based on argv data. - :param namespace: String containing the setuptools entrypoint namespace - for the plugins to be loaded. For example, - ``'cliff.formatter.list'``. + :param namespace: String containing the entrypoint namespace for the + plugins to be loaded. For example, ``'cliff.formatter.list'``. :param convert_underscores: Whether cliff should convert underscores to - spaces in entry_point commands. + spaces in entry_point commands. """ def __init__(self, namespace, convert_underscores=True): self.commands = {} @@ -93,7 +92,6 @@ class CommandManager(object): :type old_name: str :param new_name: The new command name. :type new_name: str - """ self._legacy[old_name] = new_name diff --git a/demoapp/setup.py b/demoapp/setup.py index 1cd2ce4..49abc84 100644 --- a/demoapp/setup.py +++ b/demoapp/setup.py @@ -1,12 +1,13 @@ #!/usr/bin/env python +from setuptools import find_packages +from setuptools import setup + PROJECT = 'cliffdemo' # Change docs/sphinx/conf.py too! VERSION = '0.1' -from setuptools import setup, find_packages - try: long_description = open('README.rst', 'rt').read() except IOError: diff --git a/doc/source/contributors/index.rst b/doc/source/contributors/index.rst index eec0fad..fbb6904 100644 --- a/doc/source/contributors/index.rst +++ b/doc/source/contributors/index.rst @@ -4,9 +4,9 @@ If you would like to contribute to cliff directly, these instructions should help you get started. Bug reports, and feature requests are -all welcome through the `Launchpad project`_. +all welcome through the `Storyboard project`_. -.. _Launchpad project: https://launchpad.net/python-cliff +.. _Storyboard project: https://storyboard.openstack.org/#!/project/openstack/cliff Changes to cliff should be submitted for review via the Gerrit tool, following the workflow documented at @@ -14,7 +14,7 @@ https://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. -Bugs should be filed under the `Launchpad project`_. +Bugs should be filed under the `Storyboard project`_. .. note:: diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst index 30b4532..97af9f5 100644 --- a/doc/source/install/index.rst +++ b/doc/source/install/index.rst @@ -7,11 +7,6 @@ Python Versions cliff is being developed under Python 3. -Dependencies -============ - -cliff depends on setuptools and its pkg_resources module. - .. _install-basic: Basic Installation @@ -20,13 +15,9 @@ Basic Installation cliff should be installed into the same site-packages area where the application and extensions are installed (either a virtualenv or the global site-packages). You may need administrative privileges to do -that. The easiest way to install it is using pip_:: - - $ pip install cliff - -or:: +that. The easiest way to install it is using pip_. For example:: - $ sudo pip install cliff + $ pip install cliff .. _pip: http://pypi.python.org/pypi/pip @@ -38,5 +29,5 @@ The source is hosted on OpenDev: https://opendev.org/openstack/cliff Reporting Bugs ============== -Please report bugs through the github project: -https://bugs.launchpad.net/python-cliff +Please report bugs through the storyboard: +https://storyboard.openstack.org/#!/project/openstack/cliff diff --git a/doc/source/user/introduction.rst b/doc/source/user/introduction.rst index e9a14ff..5db32d6 100644 --- a/doc/source/user/introduction.rst +++ b/doc/source/user/introduction.rst @@ -35,7 +35,7 @@ The CommandManager The :class:`cliff.commandmanager.CommandManager` knows how to load individual command plugins. The default implementation uses -`setuptools entry points`_ but any mechanism for loading commands can +`entry points`_ but any mechanism for loading commands can be used by replacing the default :class:`CommandManager` when instantiating an :class:`App`. @@ -71,6 +71,5 @@ multiple commands before the program exits. Many cliff-based applications will be able to use the default implementation of :class:`InteractiveApp` without subclassing it. -.. _setuptools entry points: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points - +.. _entry points: https://packaging.python.org/specifications/entry-points/ .. _argparse: http://docs.python.org/library/argparse.html diff --git a/lower-constraints.txt b/lower-constraints.txt index 074fa42..4aef16d 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,5 +1,4 @@ alabaster==0.7.10 -Babel==2.3.4 bandit==1.1.0 cmd2==0.8.0 coverage==4.0 @@ -11,7 +10,7 @@ GitPython==1.0.1 imagesize==0.7.1 Jinja2==2.10 linecache2==1.0.0 -MarkupSafe==1.0 +MarkupSafe==1.1.1 pbr==2.0.0 prettytable==0.7.2 Pygments==2.2.0 @@ -13,6 +13,7 @@ classifier = Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: Implementation :: CPython Intended Audience :: Developers @@ -1,6 +1,6 @@ [tox] minversion = 3.1.0 -envlist = py37,pep8 +envlist = py38,pep8 ignore_basepython_conflict = True [testenv] @@ -15,7 +15,7 @@ commands = stestr run {posargs} stestr slowest deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/upper-constraints.txt} + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt |