Skip to content

Miscellaneous fixes #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.coverage
.tox/
build/
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ jobs:
- python: pypy
include:
- python: pypy
- python: 3.11
- python: 3.10
- python: 3.9
- python: 3.8
- python: 3.7
- python: 3.6
- python: 3.5
- python: 2.7
fast_finish: true
before_install:
- sudo apt-get update -qq
Expand Down
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
executor: Programmer friendly subprocess wrapper
executor: Programmer-friendly subprocess wrapper
================================================

.. image:: https://travis-ci.org/xolox/python-executor.svg?branch=master
Expand All @@ -22,8 +22,9 @@ escaping of arguments and error checking:
what's called a "command pool". The concurrency level can be customized and
of course both local and remote commands are supported.

The package is currently tested on Python 2.7, 3.5, 3.6, 3.7, 3.8 and PyPy. For
usage instructions please refer to following sections and the documentation_.
The package is currently tested on Python 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11
and PyPy. For usage instructions please refer to following sections and the
documentation_.

.. contents::
:local:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
executor: Programmer friendly subprocess wrapper
executor: Programmer-friendly subprocess wrapper
================================================

Welcome to the documentation of `executor` version |release|!
Expand Down
8 changes: 4 additions & 4 deletions executor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: fileencoding=utf-8

# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: November 19, 2020
Expand Down Expand Up @@ -213,7 +213,7 @@ def execute_prepared(command):
class ExternalCommand(ControllableProcess):

"""
Programmer friendly :class:`subprocess.Popen` wrapper.
Programmer-friendly :class:`subprocess.Popen` wrapper.

The :class:`ExternalCommand` class wraps :class:`subprocess.Popen` to make
it easier to do the right thing (the simplicity of :func:`os.system()` with
Expand Down Expand Up @@ -1984,7 +1984,7 @@ def reset(self):

def quote(*args):
"""
Quote a string or a sequence of strings to be used as command line argument(s).
Quote an object or a sequence of objects to be used as command line argument(s).

This function is a simple wrapper around :func:`pipes.quote()` which
adds support for quoting sequences of strings (lists and tuples). For
Expand All @@ -2007,7 +2007,7 @@ def quote(*args):
value = args[0]
if not isinstance(value, (list, tuple)):
return pipes.quote(value)
return ' '.join(map(quote, value))
return ' '.join(map(quote, (str(e) for e in value)))


def which(program, mode=os.F_OK | os.X_OK, path=None):
Expand Down
2 changes: 1 addition & 1 deletion executor/chroot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: May 13, 2020
Expand Down
2 changes: 1 addition & 1 deletion executor/concurrent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: May 14, 2020
Expand Down
11 changes: 2 additions & 9 deletions executor/contexts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: May 14, 2020
Expand Down Expand Up @@ -366,14 +366,7 @@ def lsb_release_variables(self):
logger.debug("Parsing /etc/lsb-release contents: %r", contents)
for lnum, line in enumerate(contents.splitlines()):
name, delimiter, value = line.partition(u'=')
# The following encode/decode trick works around shlex.split() not
# properly supporting Unicode strings on Python 2.7, for details
# refer to https://stackoverflow.com/a/14219159/788200.
if PY2:
tokens = shlex.split(value.encode('UTF-8'))
parsed_value = [t.decode('UTF-8') for t in tokens]
else:
parsed_value = shlex.split(value)
parsed_value = shlex.split(value)
# The null byte check below guards against a weird edge case
# that has so far only manifested in the Python 2.6 environment
# of Travis CI: The parsing of /etc/lsb-release results in the
Expand Down
2 changes: 1 addition & 1 deletion executor/process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 2, 2020
Expand Down
2 changes: 1 addition & 1 deletion executor/schroot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: June 10, 2017
Expand Down
2 changes: 1 addition & 1 deletion executor/ssh/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: November 19, 2020
Expand Down
2 changes: 1 addition & 1 deletion executor/ssh/server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: May 4, 2018
Expand Down
2 changes: 1 addition & 1 deletion executor/tcp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 2, 2020
Expand Down
6 changes: 0 additions & 6 deletions executor/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,12 +1101,6 @@ def test_lsb_release_variables(self):
# laptop as well as Travis CI run Ubuntu LTS releases.
assert variables['DISTRIB_ID'].lower() == u'ubuntu'
assert variables['DISTRIB_CODENAME'].lower() in EXPECTED_CODENAMES
# Make sure all strings are Unicode strings, this tests against
# a regression of a bug caused by shlex.split() on Python 2.7
# automatically coercing Unicode strings to byte strings.
for key, value in context.lsb_release_variables.items():
assert isinstance(key, text_type)
assert isinstance(value, text_type)

def test_local_context(self):
"""Test a local command context."""
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Programmer friendly subprocess wrapper.
# Programmer-friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: February 29, 2020
Expand Down Expand Up @@ -61,7 +61,7 @@ def get_absolute_path(*args):

setup(name='executor',
version=get_version('executor', '__init__.py'),
description='Programmer friendly subprocess wrapper',
description='Programmer-friendly subprocess wrapper',
long_description=get_contents('README.rst'),
url='https://executor.readthedocs.io',
author="Peter Odding",
Expand All @@ -76,7 +76,7 @@ def get_absolute_path(*args):
tests_require=[
'virtualenv',
],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
python_requires='>=3.5',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand All @@ -88,13 +88,14 @@ def get_absolute_path(*args):
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet',
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 = py27, py35, py36, py37, py38, pypy
envlist = py35, py36, py37, py38, py39, py310, py311, pypy

[testenv]
commands = py.test {posargs}
Expand Down