exec-helpers 8.2.1__tar.gz → 8.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/PKG-INFO +1 -1
  2. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/_ssh_base.py +28 -4
  3. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/_version.py +3 -3
  4. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/ssh.py +3 -0
  5. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/PKG-INFO +1 -1
  6. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/scm_version.json +2 -2
  7. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/.editorconfig +0 -0
  8. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/.pre-commit-config.yaml +0 -0
  9. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/.readthedocs.yaml +0 -0
  10. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/CI_REQUIREMENTS.txt +0 -0
  11. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/LICENSE +0 -0
  12. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/MANIFEST.in +0 -0
  13. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/README.rst +0 -0
  14. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/build_requirements.txt +0 -0
  15. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/classifiers.txt +0 -0
  16. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/__init__.py +0 -0
  17. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/__init__.pyi +0 -0
  18. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/_helpers.py +0 -0
  19. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/_log_templates.py +0 -0
  20. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/_ssh_helpers.py +0 -0
  21. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/_subprocess_helpers.py +0 -0
  22. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/api.py +0 -0
  23. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/async_api/__init__.py +0 -0
  24. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/async_api/__init__.pyi +0 -0
  25. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/async_api/api.py +0 -0
  26. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/async_api/exec_result.py +0 -0
  27. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/async_api/subprocess.py +0 -0
  28. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/constants.py +0 -0
  29. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/exceptions.py +0 -0
  30. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/exec_result.py +0 -0
  31. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/proc_enums.py +0 -0
  32. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/py.typed +0 -0
  33. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/ssh_auth.py +0 -0
  34. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers/subprocess.py +0 -0
  35. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/SOURCES.txt +0 -0
  36. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/dependency_links.txt +0 -0
  37. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/not-zip-safe +0 -0
  38. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/requires.txt +0 -0
  39. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/scm_file_list.json +0 -0
  40. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/exec_helpers.egg-info/top_level.txt +0 -0
  41. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/pyproject.toml +0 -0
  42. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/requirements.txt +0 -0
  43. {exec_helpers-8.2.1 → exec_helpers-8.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exec-helpers
3
- Version: 8.2.1
3
+ Version: 8.2.2
4
4
  Summary: Execution helpers for simplified usage of subprocess and ssh.
5
5
  Author-email: Aleksei Stepanov <penguinolog@gmail.com>
6
6
  Maintainer-email: Aleksei Stepanov <penguinolog@gmail.com>, Antonio Esposito <esposito.cloud@gmail.com>, Dennis Dmitriev <dis-xcom@gmail.com>
@@ -1905,9 +1905,15 @@ class SSHClientBase(api.ExecHelper):
1905
1905
  :type path: str | pathlib.PurePath
1906
1906
  :return: path is valid (an object exists).
1907
1907
  :rtype: bool
1908
+ :raises ConnectionError: SSH session was closed and the reconnect failed.
1909
+ :raises OSError: SSH session was closed and the reconnect failed with a socket error.
1910
+ :raises paramiko.SSHException: SFTP connection failed, or the reconnect failed with a paramiko error.
1911
+
1912
+ .. versionchanged:: 8.2.2 A failed reconnect is raised instead of being reported as a missing path.
1908
1913
  """
1914
+ sftp = self._sftp # a failed reconnect is raised, not reported as a missing path
1909
1915
  try:
1910
- self._sftp.lstat(pathlib.PurePath(path).as_posix())
1916
+ sftp.lstat(pathlib.PurePath(path).as_posix())
1911
1917
  except OSError:
1912
1918
  return False
1913
1919
 
@@ -1942,9 +1948,15 @@ class SSHClientBase(api.ExecHelper):
1942
1948
  :type path: str | pathlib.PurePath
1943
1949
  :return: path is file.
1944
1950
  :rtype: bool
1951
+ :raises ConnectionError: SSH session was closed and the reconnect failed.
1952
+ :raises OSError: SSH session was closed and the reconnect failed with a socket error.
1953
+ :raises paramiko.SSHException: SFTP connection failed, or the reconnect failed with a paramiko error.
1954
+
1955
+ .. versionchanged:: 8.2.2 A failed reconnect is raised instead of being reported as a missing path.
1945
1956
  """
1957
+ sftp = self._sftp # a failed reconnect is raised, not reported as a missing path
1946
1958
  try:
1947
- attrs: paramiko.sftp_attr.SFTPAttributes = self._sftp.lstat(pathlib.PurePath(path).as_posix())
1959
+ attrs: paramiko.sftp_attr.SFTPAttributes = sftp.lstat(pathlib.PurePath(path).as_posix())
1948
1960
  if attrs.st_mode is None:
1949
1961
  return False
1950
1962
  return stat.S_ISREG(attrs.st_mode)
@@ -1958,9 +1970,15 @@ class SSHClientBase(api.ExecHelper):
1958
1970
  :type path: str | pathlib.PurePath
1959
1971
  :return: path is directory.
1960
1972
  :rtype: bool
1973
+ :raises ConnectionError: SSH session was closed and the reconnect failed.
1974
+ :raises OSError: SSH session was closed and the reconnect failed with a socket error.
1975
+ :raises paramiko.SSHException: SFTP connection failed, or the reconnect failed with a paramiko error.
1976
+
1977
+ .. versionchanged:: 8.2.2 A failed reconnect is raised instead of being reported as a missing path.
1961
1978
  """
1979
+ sftp = self._sftp # a failed reconnect is raised, not reported as a missing path
1962
1980
  try:
1963
- attrs: paramiko.sftp_attr.SFTPAttributes = self._sftp.lstat(pathlib.PurePath(path).as_posix())
1981
+ attrs: paramiko.sftp_attr.SFTPAttributes = sftp.lstat(pathlib.PurePath(path).as_posix())
1964
1982
  if attrs.st_mode is None:
1965
1983
  return False
1966
1984
  return stat.S_ISDIR(attrs.st_mode)
@@ -1974,9 +1992,15 @@ class SSHClientBase(api.ExecHelper):
1974
1992
  :type path: str | pathlib.PurePath
1975
1993
  :return: path is symlink.
1976
1994
  :rtype: bool
1995
+ :raises ConnectionError: SSH session was closed and the reconnect failed.
1996
+ :raises OSError: SSH session was closed and the reconnect failed with a socket error.
1997
+ :raises paramiko.SSHException: SFTP connection failed, or the reconnect failed with a paramiko error.
1998
+
1999
+ .. versionchanged:: 8.2.2 A failed reconnect is raised instead of being reported as a missing path.
1977
2000
  """
2001
+ sftp = self._sftp # a failed reconnect is raised, not reported as a missing path
1978
2002
  try:
1979
- attrs: paramiko.sftp_attr.SFTPAttributes = self._sftp.lstat(pathlib.PurePath(path).as_posix())
2003
+ attrs: paramiko.sftp_attr.SFTPAttributes = sftp.lstat(pathlib.PurePath(path).as_posix())
1980
2004
  if attrs.st_mode is None:
1981
2005
  return False
1982
2006
  return stat.S_ISLNK(attrs.st_mode)
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '8.2.1'
22
- __version_tuple__ = version_tuple = (8, 2, 1)
21
+ __version__ = version = '8.2.2'
22
+ __version_tuple__ = version_tuple = (8, 2, 2)
23
23
 
24
- __commit_id__ = commit_id = 'gc72db6b6f'
24
+ __commit_id__ = commit_id = 'gfe05177c6'
@@ -73,6 +73,8 @@ class SSHClient(_ssh_base.SSHClientBase):
73
73
  :type source: str | pathlib.PurePath
74
74
  :param target: Remote path.
75
75
  :type target: str | pathlib.PurePath
76
+
77
+ .. versionchanged:: 8.2.2 Uploading a directory creates the remote directory it is copied to.
76
78
  """
77
79
  self.logger.debug(f"Copying '{source}' -> '{target}'")
78
80
 
@@ -87,6 +89,7 @@ class SSHClient(_ssh_base.SSHClientBase):
87
89
  self._sftp.put(src.as_posix(), tgt.as_posix(), confirm=True)
88
90
  return
89
91
 
92
+ self.mkdir(tgt.as_posix()) # glob below yields only what is inside src, never src itself
90
93
  for pth in src.glob("**/*"):
91
94
  relative = pth.relative_to(src).as_posix()
92
95
  destination: str = os.path.normpath(tgt.joinpath(relative).as_posix()).replace("\\", "/")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: exec-helpers
3
- Version: 8.2.1
3
+ Version: 8.2.2
4
4
  Summary: Execution helpers for simplified usage of subprocess and ssh.
5
5
  Author-email: Aleksei Stepanov <penguinolog@gmail.com>
6
6
  Maintainer-email: Aleksei Stepanov <penguinolog@gmail.com>, Antonio Esposito <esposito.cloud@gmail.com>, Dennis Dmitriev <dis-xcom@gmail.com>
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "8.2.1",
2
+ "tag": "8.2.2",
3
3
  "distance": 0,
4
- "node": "gc72db6b6fee992f88308a92d396f871206acb888",
4
+ "node": "gfe05177c60fb1020793729bd1ee5d0daa8711d54",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-10-29"
File without changes
File without changes
File without changes
File without changes
File without changes