Skip to content

Commit 06e8de5

Browse files
authored
3.4 (#70)
* Support python 3.4 (and later remove from ver. 1.x) * clean-up type comments vs type hints
1 parent 3a07b7a commit 06e8de5

File tree

9 files changed

+26
-15
lines changed

9 files changed

+26
-15
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ sudo: false
22
language: python
33
os: linux
44
python:
5+
- 3.4
56
- 3.5
67
- 3.6
78
- &mainstream_python 3.7-dev

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ Pros:
4242

4343
::
4444

45+
Python 3.4
4546
Python 3.5
4647
Python 3.6
4748
Python 3.7
4849
PyPy3 3.5+
4950

50-
.. note:: For Python 2.7, 3.4 and PyPy please use versions 1.x.x
51+
.. note:: For Python 2.7 and PyPy please use versions 1.x.x
5152

5253
This package includes:
5354

exec_helpers/_ssh_client_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def execute_async(
572572
:param command: Command for execution
573573
:type command: str
574574
:param stdin: pass STDIN text to the process
575-
:type stdin: typing.Union[typing.AnyStr, bytearray, None]
575+
:type stdin: typing.Union[str, bytes, bytearray, None]
576576
:param open_stdout: open STDOUT stream for read
577577
:type open_stdout: bool
578578
:param open_stderr: open STDERR stream for read

exec_helpers/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def execute_async(
141141
:param command: Command for execution
142142
:type command: str
143143
:param stdin: pass STDIN text to the process
144-
:type stdin: typing.Union[typing.AnyStr, bytearray, None]
144+
:type stdin: typing.Union[str, bytes, bytearray, None]
145145
:param open_stdout: open STDOUT stream for read
146146
:type open_stdout: bool
147147
:param open_stderr: open STDERR stream for read

exec_helpers/exec_result.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ExecResult:
4444

4545
def __init__(
4646
self,
47-
cmd, # type: str
47+
cmd: str,
4848
stdin: typing.Union[bytes, str, bytearray, None] = None,
4949
stdout: typing.Optional[typing.Iterable[bytes]] = None,
5050
stderr: typing.Optional[typing.Iterable[bytes]] = None,
@@ -55,7 +55,7 @@ def __init__(
5555
:param cmd: command
5656
:type cmd: str
5757
:param stdin: string STDIN
58-
:type stdin: typing.Union[typing.AnyStr, bytearray, None]
58+
:type stdin: typing.Union[str, bytes, bytearray, None]
5959
:param stdout: binary STDOUT
6060
:type stdout: typing.Optional[typing.Iterable[bytes]]
6161
:param stderr: binary STDERR
@@ -145,7 +145,7 @@ def _get_brief(cls, data: typing.Tuple[bytes, ...]) -> str:
145145
)
146146

147147
@property
148-
def cmd(self): # type: () -> str
148+
def cmd(self) -> str:
149149
"""Executed command.
150150
151151
:rtype: str

exec_helpers/subprocess_runner.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ def execute_async(
204204
pass # pragma: no cover
205205

206206
# pylint: enable=unused-argument
207-
def execute_async( # type: ignore # noqa: F811
207+
def execute_async( # noqa: F811
208208
self,
209209
command: str,
210-
stdin: typing.Union[typing.AnyStr, bytearray, None] = None,
210+
stdin: typing.Union[str, bytes, bytearray, None] = None,
211211
open_stdout: bool = True,
212212
open_stderr: bool = True,
213213
verbose: bool = False,
@@ -219,7 +219,7 @@ def execute_async( # type: ignore # noqa: F811
219219
:param command: Command for execution
220220
:type command: str
221221
:param stdin: pass STDIN text to the process
222-
:type stdin: typing.Union[typing.AnyStr, bytearray, None]
222+
:type stdin: typing.Union[str, bytes, bytearray, None]
223223
:param open_stdout: open STDOUT stream for read
224224
:type open_stdout: bool
225225
:param open_stderr: open STDERR stream for read
@@ -258,9 +258,9 @@ def execute_async( # type: ignore # noqa: F811
258258

259259
if stdin is not None:
260260
if isinstance(stdin, str):
261-
stdin = stdin.encode(encoding='utf-8') # type: ignore
261+
stdin = stdin.encode(encoding='utf-8')
262262
elif isinstance(stdin, bytearray):
263-
stdin = bytes(stdin) # type: ignore
263+
stdin = bytes(stdin)
264264
try:
265265
process.stdin.write(stdin)
266266
except OSError as exc:

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def get_simple_vars_from_src(src):
228228
'License :: OSI Approved :: Apache Software License',
229229

230230
'Programming Language :: Python :: 3',
231+
'Programming Language :: Python :: 3.4',
231232
'Programming Language :: Python :: 3.5',
232233
'Programming Language :: Python :: 3.6',
233234
'Programming Language :: Python :: 3.7',
@@ -257,7 +258,7 @@ def get_simple_vars_from_src(src):
257258
long_description=long_description,
258259
classifiers=classifiers,
259260
keywords=keywords,
260-
python_requires='>=3.5',
261+
python_requires='>=3.4',
261262
# While setuptools cannot deal with pre-installed incompatible versions,
262263
# setting a lower bound is not harmful - it makes error messages cleaner. DO
263264
# NOT set an upper bound on setuptools, as that will lead to uninstallable

tools/build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
PYTHON_VERSIONS="cp35-cp35m cp36-cp36m cp37-cp37m"
2+
PYTHON_VERSIONS="cp34-cp34m cp35-cp35m cp36-cp36m cp37-cp37m"
33

44
# Avoid creation of __pycache__/*.py[c|o]
55
export PYTHONDONTWRITEBYTECODE=1

tox.ini

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[tox]
77
minversion = 2.0
8-
envlist = pep8, pylint, mypy, bandit, pep257, py{35,36,37,py3}, docs, py{35,36,37}-nocov
8+
envlist = pep8, pylint, mypy, bandit, pep257, py{34,35,36,37,py3}, docs, py{34,35,36,37}-nocov
99
skipsdist = True
1010
skip_missing_interpreters = True
1111

@@ -20,14 +20,21 @@ deps =
2020
pytest-cov
2121
pytest-html
2222
pytest-sugar
23-
py{35,36}-nocov: Cython
23+
py{34,35,36}-nocov: Cython
2424
-r{toxinidir}/CI_REQUIREMENTS.txt
2525

2626
commands =
2727
pip freeze
2828
py.test --junitxml=unit_result.xml --cov-report html --self-contained-html --html=report.html --cov-config .coveragerc --cov=exec_helpers {posargs:test}
2929
coverage report --fail-under 97
3030

31+
[testenv:py34-nocov]
32+
usedevelop = False
33+
commands =
34+
python setup.py bdist_wheel
35+
pip install exec_helpers --no-index -f dist
36+
py.test -vvv {posargs:test}
37+
3138
[testenv:py35-nocov]
3239
usedevelop = False
3340
commands =
@@ -53,6 +60,7 @@ commands =
5360
commands = {posargs:}
5461

5562
[tox:travis]
63+
3.4 = py34,
5664
3.5 = py35,
5765
3.6 = py36,
5866
3.7 = py37,

0 commit comments

Comments
 (0)