Skip to content

Commit 89ea863

Browse files
committed
Move forward: stop using cython as not enough optimizations
* Extra type declarations using subclassing * Add chroot info in call logs
1 parent 9016947 commit 89ea863

File tree

11 files changed

+38
-992
lines changed

11 files changed

+38
-992
lines changed

.travis.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,7 @@ _python:
2121
python: "3.8"
2222

2323
_helpers:
24-
- &install_cython pip install --upgrade Cython
2524
- &build_package python setup.py bdist_wheel
26-
- &install_built pip install exec_helpers --no-index -f dist
27-
- &test_no_cov py.test -vvv test
28-
- &test_cythonized
29-
stage: Test cythonized
30-
install:
31-
- *upgrade_python_toolset
32-
- *install_test_deps
33-
- *install_deps
34-
- *install_cython
35-
script:
36-
- *build_package
37-
- *install_built
38-
- *test_no_cov
39-
after_success: skip
4025

4126
- &static_analysis
4227
stage: Static analysis
@@ -109,14 +94,7 @@ jobs:
10994
<<: *python36
11095
- stage: test
11196
<<: *python37
112-
# - stage: test
113-
# <<: *python38
114-
115-
- <<: *test_cythonized
116-
<<: *python36
117-
- <<: *test_cythonized
118-
<<: *python37
119-
- <<: *test_cythonized
97+
- stage: test
12098
<<: *python38
12199

122100
- stage: deploy
@@ -130,8 +108,6 @@ jobs:
130108
install:
131109
- *upgrade_python_toolset
132110
- *install_deps
133-
script:
134-
- ./tools/run_docker.sh "exec_helpers"
135111
before_deploy:
136112
- *build_package
137113
deploy:

azure-pipelines.yml

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -99,79 +99,3 @@ jobs:
9999
parameters: {name: 'Python_37', python: '3.7', architecture: 'x64', kind: 'native'}
100100
- template: .azure_pipelines/run_tests.yml
101101
parameters: {name: 'Python_38', python: '3.8', architecture: 'x64', kind: 'native'}
102-
103-
- template: .azure_pipelines/run_tests.yml
104-
parameters: {name: 'Python_36', python: '3.6', architecture: 'x64', kind: 'cython'}
105-
- template: .azure_pipelines/run_tests.yml
106-
parameters: {name: 'Python_36', python: '3.6', architecture: 'x86', kind: 'cython'}
107-
- template: .azure_pipelines/run_tests.yml
108-
parameters: {name: 'Python_37', python: '3.7', architecture: 'x64', kind: 'cython'}
109-
- template: .azure_pipelines/run_tests.yml
110-
parameters: {name: 'Python_37', python: '3.7', architecture: 'x86', kind: 'cython'}
111-
- template: .azure_pipelines/run_tests.yml
112-
parameters: {name: 'Python_38', python: '3.8', architecture: 'x64', kind: 'cython'}
113-
- template: .azure_pipelines/run_tests.yml
114-
parameters: {name: 'Python_38', python: '3.8', architecture: 'x86', kind: 'cython'}
115-
116-
- job: 'Build_and_deploy'
117-
dependsOn:
118-
- Python_36_x64_native
119-
- Python_37_x64_native
120-
- Python_38_x64_native
121-
122-
- Python_36_x64_cython
123-
- Python_36_x86_cython
124-
- Python_37_x64_cython
125-
- Python_37_x86_cython
126-
- Python_38_x64_cython
127-
- Python_38_x86_cython
128-
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
129-
pool:
130-
vmIMage: 'VS2017-Win2016'
131-
strategy:
132-
maxParallel: 6
133-
matrix:
134-
Python36_x64:
135-
python.version: '3.6'
136-
python.architecture: 'x64'
137-
Python36_x86:
138-
python.version: '3.6'
139-
python.architecture: 'x86'
140-
Python37_x64:
141-
python.version: '3.7'
142-
python.architecture: 'x64'
143-
Python37_x86:
144-
python.version: '3.7'
145-
python.architecture: 'x86'
146-
Python38_x64:
147-
python.version: '3.8'
148-
python.architecture: 'x64'
149-
Python38_x86:
150-
python.version: '3.8'
151-
python.architecture: 'x86'
152-
153-
steps:
154-
- task: UsePythonVersion@0
155-
inputs:
156-
versionSpec: '$(python.version)'
157-
architecture: '$(python.architecture)'
158-
159-
- script: |
160-
python -m pip install --upgrade pip
161-
pip install -U setuptools
162-
pip install -r build_requirements.txt
163-
displayName: 'Install dependencies'
164-
165-
- script: |
166-
python setup.py bdist_wheel
167-
displayName: 'Build'
168-
169-
- task: TwineAuthenticate@0
170-
displayName: 'Twine Authenticate '
171-
inputs:
172-
externalFeeds: PyPI
173-
174-
- script: |
175-
pip install -U twine
176-
twine upload -r PyPI --config-file $(PYPIRC_PATH) dist/exec_helpers-* --skip-existing
177-
displayName: 'Deploy'

exec_helpers/_ssh_client_base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def __del__(self) -> None:
506506

507507
def __enter__(self) -> "SSHClientBase": # pylint: disable=useless-super-delegation
508508
"""Get context manager."""
509-
return super().__enter__() # type: ignore
509+
return super().__enter__()
510510

511511
def __exit__(self, exc_type: typing.Any, exc_val: typing.Any, exc_tb: typing.Any) -> None:
512512
"""Exit context manager.
@@ -1042,7 +1042,10 @@ def get_result(remote: "SSHClientBase") -> exec_result.ExecResult:
10421042
cmd_for_log: str = remote._mask_command(cmd=command, log_mask_re=log_mask_re)
10431043

10441044
remote.logger.log(
1045-
level=logging.INFO if verbose else logging.DEBUG, msg=f"Executing command:\n{cmd_for_log!r}\n"
1045+
level=log_level,
1046+
msg=f"Executing command"
1047+
f"{'' if not remote._chroot_path else f' (with chroot to: {remote._chroot_path})'}:\n"
1048+
f"{cmd_for_log!r}\n",
10461049
)
10471050
async_result: SshExecuteAsyncResult = remote._execute_async(
10481051
command,
@@ -1068,6 +1071,7 @@ def get_result(remote: "SSHClientBase") -> exec_result.ExecResult:
10681071
prep_expected: typing.Tuple[typing.Union[int, proc_enums.ExitCodes], ...] = proc_enums.exit_codes_to_enums(
10691072
expected
10701073
)
1074+
log_level: int = logging.INFO if verbose else logging.DEBUG
10711075

10721076
futures: typing.Dict["SSHClientBase", "concurrent.futures.Future[exec_result.ExecResult]"] = {
10731077
remote: get_result(remote) for remote in set(remotes)

0 commit comments

Comments
 (0)