summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2018-09-24 08:21:11 -0700
committerDavid Lord <davidism@gmail.com>2018-09-24 08:36:28 -0700
commite8bf968c8f26231d7c2a6d04ac83c81199bb607f (patch)
tree58c41a49915bdb0c012cc89697c9bb0bb017277f
parenta589835a5b656eec4bace076ac7e947662c1cc68 (diff)
downloadclick-e8bf968c8f26231d7c2a6d04ac83c81199bb607f.tar.gz
update metadata
test on 3.7 fix collections deprecation warning
-rw-r--r--.appveyor.yml6
-rw-r--r--.coveragerc3
-rw-r--r--.gitignore27
-rw-r--r--.travis.yml27
-rw-r--r--LICENSE38
-rw-r--r--LICENSE.rst39
-rw-r--r--MANIFEST.in12
-rw-r--r--Makefile11
-rw-r--r--README.rst34
-rw-r--r--click/__init__.py20
-rw-r--r--click/_bashcomplete.py8
-rw-r--r--click/_termui_impl.py16
-rw-r--r--click/parser.py23
-rw-r--r--docs/license.rst3
-rw-r--r--docs/requirements.txt2
-rw-r--r--setup.cfg22
-rw-r--r--setup.py75
-rw-r--r--tox.ini12
18 files changed, 189 insertions, 189 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 1201593..8d90295 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -3,9 +3,9 @@ environment:
TOXENV: py,codecov
matrix:
- - PYTHON: C:\Python36-x64
+ - PYTHON: C:\Python37-x64
- PYTHON: C:\Python27-x64
- - PYTHON: C:\Python36
+ - PYTHON: C:\Python37
- PYTHON: C:\Python27
init:
@@ -22,7 +22,7 @@ test_script:
branches:
only:
- master
- - /^.*-maintenance$/
+ - /^.*\.x$/
cache:
- '%LOCALAPPDATA%\pip\Cache'
diff --git a/.coveragerc b/.coveragerc
deleted file mode 100644
index 2876fb5..0000000
--- a/.coveragerc
+++ /dev/null
@@ -1,3 +0,0 @@
-[run]
-branch = true
-source = click,tests
diff --git a/.gitignore b/.gitignore
index fe562f2..33ed830 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,18 @@
-.DS_Store
*.pyc
*.pyo
-*.egg-ignore
-*.egg-info
-.pytest_cache
-dist
-build
-docs/_build
-click.egg-info
-venv/
-.tox
-.cache
+__pycache__/
+.idea/
.ropeproject
-.idea
+.DS_Store
+env/
+venv/
+*.egg-info/
+*.eggs/
+build/
+dist/
+docs/_build/
+.pytest_cache/
+.tox/
+.coverage
+.coverage.*
+htmlcov/
diff --git a/.travis.yml b/.travis.yml
index 55deb45..3018973 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,21 +1,19 @@
os: linux
sudo: false
language: python
+python:
+ - "3.6"
+ - "3.5"
+ - "3.4"
+ - "2.7"
+ - "nightly"
+ - "pypy3"
+ - "pypy"
+env: TOXENV=py,codecov
matrix:
include:
- - python: 3.6
- env: TOXENV=py,codecov
- - python: 3.5
- env: TOXENV=py,codecov
- - python: 3.4
- env: TOXENV=py,codecov
- - python: 2.7
- env: TOXENV=py,codecov
- - python: pypy3
- env: TOXENV=py,codecov
- - python: nightly
- env: TOXENV=py
+ - env: TOXENV=docs-html
- os: osx
language: generic
env: TOXENV=py3,py2,codecov
@@ -25,8 +23,9 @@ matrix:
- $HOME/Library/Caches/Homebrew
- $HOME/Library/Caches/pip
allow_failures:
- - python: pypy3
- python: nightly
+ - python: pypy3
+ - python: pypy
- os: osx
fast_finish: true
@@ -50,7 +49,7 @@ cache:
branches:
only:
- master
- - /^.*-maintenance/
+ - /^.*\.x$/
notifications:
email: false
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 1704daa..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,38 +0,0 @@
-Copyright (c) 2014 by Armin Ronacher.
-
-Click uses parts of optparse written by Gregory P. Ward and maintained by the
-Python software foundation. This is limited to code in the parser.py
-module:
-
-Copyright (c) 2001-2006 Gregory P. Ward. All rights reserved.
-Copyright (c) 2002-2006 Python Software Foundation. All rights reserved.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * The names of the contributors may not be used to endorse or
- promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/LICENSE.rst b/LICENSE.rst
new file mode 100644
index 0000000..87ce152
--- /dev/null
+++ b/LICENSE.rst
@@ -0,0 +1,39 @@
+Copyright © 2014 by the Pallets team.
+
+Some rights reserved.
+
+Redistribution and use in source and binary forms of the software as
+well as documentation, with or without modification, are permitted
+provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+- Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+----
+
+Click uses parts of optparse written by Gregory P. Ward and maintained
+by the Python Software Foundation. This is limited to code in parser.py.
+
+Copyright © 2001-2006 Gregory P. Ward. All rights reserved.
+Copyright © 2002-2006 Python Software Foundation. All rights reserved.
diff --git a/MANIFEST.in b/MANIFEST.in
index 15458cf..33a336f 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,9 +1,11 @@
-include Makefile CHANGES LICENSE
-
+include CHANGES.rst
+include CONTRIBUTING.rst
+include LICENSE.rst
+include README.rst
+include tox.ini
graft artwork
-graft tests
-graft examples
graft docs
prune docs/_build
-
+graft examples
+graft tests
global-exclude *.py[co] .DS_Store
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 971e401..0000000
--- a/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-test:
- @cd tests; PYTHONPATH=.. pytest --tb=short
-
-upload-docs:
- $(MAKE) -C docs dirhtml
- rsync -a docs/_build/dirhtml/* flow.srv.pocoo.org:/srv/websites/click.pocoo.org/static/
-
-release:
- python setup.py sdist bdist_wheel upload
-
-.PHONY: upload-docs
diff --git a/README.rst b/README.rst
index b6dd4b1..e4c0471 100644
--- a/README.rst
+++ b/README.rst
@@ -2,8 +2,8 @@
==========
Click is a Python package for creating beautiful command line interfaces
-in a composable way with as little code as necessary. It's the "Command
-Line Interface Creation Kit". It's highly configurable but comes with
+in a composable way with as little code as necessary. It's the "Command
+Line Interface Creation Kit". It's highly configurable but comes with
sensible defaults out of the box.
It aims to make the process of writing command line tools quick and fun
@@ -12,9 +12,9 @@ implement an intended CLI API.
Click in three points:
-- arbitrary nesting of commands
-- automatic help page generation
-- supports lazy loading of subcommands at runtime
+- Arbitrary nesting of commands
+- Automatic help page generation
+- Supports lazy loading of subcommands at runtime
Installing
@@ -41,13 +41,13 @@ What does it look like? Here is an example of a simple Click program:
import click
@click.command()
- @click.option('--count', default=1, help='Number of greetings.')
- @click.option('--name', prompt='Your name',
- help='The person to greet.')
+ @click.option("--count", default=1, help="Number of greetings.")
+ @click.option("--name", prompt="Your name",
+ help="The person to greet.")
def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
- for x in range(count):
- click.echo('Hello %s!' % name)
+ for _ in range(count):
+ click.echo("Hello, %s!" % name)
if __name__ == '__main__':
hello()
@@ -57,17 +57,17 @@ And what it looks like when run:
.. code-block:: text
$ python hello.py --count=3
- Your name: John
- Hello John!
- Hello John!
- Hello John!
+ Your name: Click
+ Hello, Click!
+ Hello, Click!
+ Hello, Click!
Donate
------
-The Pallets organization develops and supports Flask and the libraries
-it uses. In order to grow the community of contributors and users, and
+The Pallets organization develops and supports Click and other popular
+packages. In order to grow the community of contributors and users, and
allow the maintainers to devote more time to the projects, `please
donate today`_.
@@ -79,7 +79,7 @@ Links
* Website: https://palletsprojects.com/p/click/
* Documentation: https://click.palletsprojects.com/
-* License: `BSD <https://github.com/pallets/click/blob/master/LICENSE>`_
+* License: `BSD <https://github.com/pallets/click/blob/master/LICENSE.rst>`_
* Releases: https://pypi.org/project/click/
* Code: https://github.com/pallets/click
* Issue tracker: https://github.com/pallets/click/issues
diff --git a/click/__init__.py b/click/__init__.py
index fc40c7e..3b602cc 100644
--- a/click/__init__.py
+++ b/click/__init__.py
@@ -1,17 +1,15 @@
# -*- coding: utf-8 -*-
"""
- click
- ~~~~~
+click
+~~~~~
- Click is a simple Python module that wraps the stdlib's optparse to make
- writing command line scripts fun. Unlike other modules, it's based around
- a simple API that does not come with too much magic and is composable.
+Click is a simple Python module inspired by the stdlib optparse to make
+writing command line scripts fun. Unlike other modules, it's based
+around a simple API that does not come with too much magic and is
+composable.
- In case optparse ever gets removed from the stdlib, it will be shipped by
- this module.
-
- :copyright: (c) 2014 by Armin Ronacher.
- :license: BSD, see LICENSE for more details.
+:copyright: © 2014 by the Pallets team.
+:license: BSD, see LICENSE.rst for more details.
"""
# Core classes
@@ -96,4 +94,4 @@ __all__ = [
disable_unicode_literals_warning = False
-__version__ = '7.0-dev'
+__version__ = '7.0.dev'
diff --git a/click/_bashcomplete.py b/click/_bashcomplete.py
index fba6e99..a5f1084 100644
--- a/click/_bashcomplete.py
+++ b/click/_bashcomplete.py
@@ -1,4 +1,3 @@
-import collections
import copy
import os
import re
@@ -8,6 +7,11 @@ from .parser import split_arg_string
from .core import MultiCommand, Option, Argument
from .types import Choice
+try:
+ from collections import abc
+except ImportError:
+ import collections as abc
+
WORDBREAK = '='
# Note, only BASH version 4.4 and later have the nosort option.
@@ -159,7 +163,7 @@ def is_incomplete_argument(current_params, cmd_param):
return True
if cmd_param.nargs == -1:
return True
- if isinstance(current_param_values, collections.Iterable) \
+ if isinstance(current_param_values, abc.Iterable) \
and cmd_param.nargs > 1 and len(current_param_values) < cmd_param.nargs:
return True
return False
diff --git a/click/_termui_impl.py b/click/_termui_impl.py
index b7fcbb5..00a8e5e 100644
--- a/click/_termui_impl.py
+++ b/click/_termui_impl.py
@@ -1,14 +1,16 @@
+# -*- coding: utf-8 -*-
"""
- click._termui_impl
- ~~~~~~~~~~~~~~~~~~
+click._termui_impl
+~~~~~~~~~~~~~~~~~~
- This module contains implementations for the termui module. To keep the
- import time of Click down, some infrequently used functionality is placed
- in this module and only imported as needed.
+This module contains implementations for the termui module. To keep the
+import time of Click down, some infrequently used functionality is
+placed in this module and only imported as needed.
- :copyright: (c) 2014 by Armin Ronacher.
- :license: BSD, see LICENSE for more details.
+:copyright: © 2014 by the Pallets team.
+:license: BSD, see LICENSE.rst for more details.
"""
+
import os
import sys
import time
diff --git a/click/parser.py b/click/parser.py
index 5e8c213..1c3ae9c 100644
--- a/click/parser.py
+++ b/click/parser.py
@@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
"""
- click.parser
- ~~~~~~~~~~~~
+click.parser
+~~~~~~~~~~~~
- This module started out as largely a copy paste from the stdlib's
- optparse module with the features removed that we do not need from
- optparse because we implement them in Click on a higher level (for
- instance type handling, help formatting and a lot more).
+This module started out as largely a copy paste from the stdlib's
+optparse module with the features removed that we do not need from
+optparse because we implement them in Click on a higher level (for
+instance type handling, help formatting and a lot more).
- The plan is to remove more and more from here over time.
+The plan is to remove more and more from here over time.
- The reason this is a different module and not optparse from the stdlib
- is that there are differences in 2.x and 3.x about the error messages
- generated and optparse in the stdlib uses gettext for no good reason
- and might cause us issues.
+The reason this is a different module and not optparse from the stdlib
+is that there are differences in 2.x and 3.x about the error messages
+generated and optparse in the stdlib uses gettext for no good reason
+and might cause us issues.
"""
+
import re
from collections import deque
from .exceptions import UsageError, NoSuchOption, BadOptionUsage, \
diff --git a/docs/license.rst b/docs/license.rst
index 1f4654a..13eb726 100644
--- a/docs/license.rst
+++ b/docs/license.rst
@@ -10,4 +10,5 @@ of the software without written consent.
License Text
------------
-.. include:: ../LICENSE
+.. include:: ../LICENSE.rst
+
diff --git a/docs/requirements.txt b/docs/requirements.txt
index dbd475f..295f450 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,2 +1,2 @@
-Sphinx~=1.7.7
+Sphinx~=1.8.0
Pallets-Sphinx-Themes~=1.1.0
diff --git a/setup.cfg b/setup.cfg
index 3b0846a..d4c2343 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,8 +1,20 @@
-[bdist_wheel]
-universal=1
-
[metadata]
-license_file = LICENSE
+license_file = LICENSE.rst
+
+[bdist_wheel]
+universal = 1
[tool:pytest]
-addopts = -p no:warnings --tb=short
+testpaths = tests
+
+[coverage:run]
+branch = True
+source =
+ click
+ tests
+
+[coverage:paths]
+source =
+ click
+ .tox/*/lib/python*/site-packages/click
+ .tox/pypy/site-packages/click
diff --git a/setup.py b/setup.py
index 194d1d4..1c18dc7 100644
--- a/setup.py
+++ b/setup.py
@@ -1,57 +1,44 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
import io
import re
from setuptools import setup
-
-_version_re = re.compile(r'__version__\s+=\s+(.*)')
-
-
-with io.open('README.rst', 'rt', encoding='utf8') as f:
+with io.open("README.rst", "rt", encoding="utf8") as f:
readme = f.read()
-with io.open('click/__init__.py', 'rt', encoding='utf8') as f:
- version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
+with io.open("click/__init__.py", "rt", encoding="utf8") as f:
+ version = re.search(r"__version__ = \'(.*?)\'", f.read()).group(1)
setup(
- name='click',
+ name="Click",
version=version,
- url='https://palletsprojects.com/p/click/',
- author='Armin Ronacher',
- author_email='armin.ronacher@active-4.com',
- maintainer='Pallets team',
- maintainer_email='contact@palletsprojects.com',
- long_description=readme,
- packages=['click'],
- description='A simple wrapper around optparse for '
- 'powerful command line utilities.',
- license='BSD',
- extras_require={
- 'dev': [
- 'pytest>=3',
- 'coverage',
- 'tox',
- 'sphinx',
- ],
- 'docs': [
- 'sphinx',
- 'Pallets-Sphinx-Themes',
- ]
+ url="https://palletsprojects.com/p/click/",
+ project_urls={
+ "Documentation": "https://click.palletsprojects.com/",
+ "Code": "https://github.com/pallets/click",
+ "Issue tracker": "https://github.com/pallets/click/issues",
},
+ license="BSD",
+ author="Armin Ronacher",
+ author_email="armin.ronacher@active-4.com",
+ maintainer="Pallets Team",
+ maintainer_email="contact@palletsprojects.com",
+ description="Composable command line interface toolkit",
+ long_description=readme,
+ packages=["click"],
+ include_package_data=True,
+ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
classifiers=[
- 'Development Status :: 5 - Production/Stable',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: BSD License',
- 'Operating System :: OS Independent',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
+ "Development Status :: 5 - Production/Stable",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: BSD License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.4",
+ "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
],
- python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
)
diff --git a/tox.ini b/tox.ini
index 1f68f4d..a44b110 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,9 @@
[tox]
-envlist = py{36,35,34,27,py}
+envlist =
+ py{37,36,35,34,27,py3,py}
+ docs-html
+ coverage-report
+skip_missing_interpreters = true
[testenv]
passenv = LANG
@@ -7,14 +11,14 @@ deps =
pytest
coverage
colorama
-commands = coverage run -p -m pytest {posargs:tests}
+commands = coverage run -p -m pytest {posargs}
[testenv:docs-html]
-deps = sphinx
+deps = -r docs/requirements.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
[testenv:docs-linkcheck]
-deps = sphinx
+deps = -r docs/requirements.txt
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs {envtmpdir}/linkcheck
[testenv:coverage-report]