Skip to contentSkip to conversation

package/python-scp: new package

PATCH Superseded Alexis Lothoré via buildroot 1 participant 5 messages Oct 17, 2025 – Oct 19, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover package/python-scp: new package

Hello,
this small series adds support for the small python-scp package, which comes on top of the paramiko python package to ease download/upload of files thanks to SCP protocol.

- Patch 1 brings the new package. It is mostly based on ./utils/scanpypi scp -o package
- Patch 2 brings a small test ensuring that python-scp is properly installed and is usable

---
Alexis Lothoré (2):
package/python-scp: new package support/testing: add runtime tests for python-scp

 DEVELOPERS                                         |  3 +++
 package/Config.in                                  |  1 +
 package/python-scp/Config.in                       |  7 +++++++
 package/python-scp/python-scp.hash                 |  5 +++++
 package/python-scp/python-scp.mk                   | 14 +++++++++++++
 support/testing/tests/package/sample_python_scp.py | 10 +++++++++
 support/testing/tests/package/test_python_scp.py   | 24 ++++++++++++++++++++++
 7 files changed, 64 insertions(+)

---
base-commit: 0c2a0a44f00e2ab9b41a2bc3bf019e17ef37c471
change-id: 20250924-python-scp-12cf67ae9b0e

Best regards,

Signature · 8 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/2 package/python-scp: new package

Add python-scp as a new package. python-scp allows to send and receives files in python through the scp1 protocol, on top of paramiko.

---
 DEVELOPERS                         |  3 +++
 package/Config.in                  |  1 +
 package/python-scp/Config.in       |  7 +++++++
 package/python-scp/python-scp.hash |  5 +++++
 package/python-scp/python-scp.mk   | 14 ++++++++++++++
 5 files changed, 30 insertions(+)
DEVELOPERS +3 -0
index 84ca8c76dc52d23a64edc43dab91924e8509d8d5..d0664e8723cd2223f5180ca5ee311dc78b0376bd 100644
@@ -148,6 +148,9 @@ F:	configs/cubieboard2_defconfig
 N:	Alexey Lukyanchuk <[email protected]>
 F:	package/zabbix/
 
+N: 	Alexis Lothoré <[email protected]>
+F: 	package/python-scp
+
 N:	Alistair Francis <[email protected]>
 F:	board/sifive/
 F:	boot/opensbi/
package/Config.in +1 -0
index 1ae92409c4bd11bbbbafd0f9f8287e5601603568..3561ec81476a30e924baf0276ec86da5119ea457 100644
@@ -1383,6 +1383,7 @@ menu "External python modules"
 	source "package/python-scapy/Config.in"
 	source "package/python-schedule/Config.in"
 	source "package/python-scipy/Config.in"
+	source "package/python-scp/Config.in"
 	source "package/python-sdbus/Config.in"
 	source "package/python-sdbus-modemmanager/Config.in"
 	source "package/python-sdbus-networkmanager/Config.in"
package/python-scp/Config.in new file +7 -0
new file mode 100644
index 0000000000000000000000000000000000000000..1db0e910f4b2041ac63871a66b07382b6c1c4c87
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_SCP
+	bool "python-scp"
+	select BR2_PACKAGE_PYTHON_PARAMIKO # runtime
+	help
+	  scp module for paramiko.
+
+	  https://github.com/jbardin/scp.py
package/python-scp/python-scp.hash new file +5 -0
new file mode 100644
index 0000000000000000000000000000000000000000..4ec4e6a41a4d44331189417e336023ade637c09e
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/scp/json
+md5  54c0e3b6cc52620ce3a81362fa8bb29d  scp-0.15.0.tar.gz
+sha256  f1b22e9932123ccf17eebf19e0953c6e9148f589f93d91b872941a696305c83f  scp-0.15.0.tar.gz
+# Locally computed sha256 checksums
+sha256  2455cf0fc78e13772bf10ef5f209e7eb8625706d671b2f420cc8add37d548c1c  LICENSE.txt
package/python-scp/python-scp.mk new file +14 -0
new file mode 100644
index 0000000000000000000000000000000000000000..d223b16290760a9c78b5bb58dd4d4af21b49a43a
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-scp
+#
+################################################################################
+
+PYTHON_SCP_VERSION = 0.15.0
+PYTHON_SCP_SOURCE = scp-$(PYTHON_SCP_VERSION).tar.gz
+PYTHON_SCP_SITE = https://files.pythonhosted.org/packages/d6/1c/d213e1c6651d0bd37636b21b1ba9b895f276e8057f882c9f944931e4f002
+PYTHON_SCP_SETUP_TYPE = setuptools
+PYTHON_SCP_LICENSE = LGPL-2.1+
+PYTHON_SCP_LICENSE_FILES = LICENSE.txt
+
+$(eval $(python-package))
Signature · 6 lines
2.51.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 4 lines · Alexis Lothoré via buildroot

Add python-scp as a new package. python-scp allows to send and receives files in python through the scp1 protocol, on top of paramiko.

Series applied to master, thanks.

For info, I did few minor changes to the runtime test. See:
https://gitlab.com/buildroot.org/buildroot/-/commit/7470587cfa9a24d3c49adc0fb6cc60512907f31a

Best regards,

Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hello Julien,

Quoted 10 lines · Julien Olivain
Quoted 4 lines · Alexis Lothoré via buildroot

Add python-scp as a new package. python-scp allows to send and receives files in python through the scp1 protocol, on top of paramiko.

Series applied to master, thanks.

For info, I did few minor changes to the runtime test. See:
https://gitlab.com/buildroot.org/buildroot/-/commit/7470587cfa9a24d3c49adc0fb6cc60512907f31a

ACK, thanks for the improvements !

Alexis

Signature · 8 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

PATCH 2/2 support/testing: add runtime tests for python-scp

In reply to Alexis Lothoré via buildroot

Add a basic test involving a local SSH connection (based on dropbear server). The test validates that we are able, through python-scp, to fetch the /etc/hostname file.

The test needs some basic key initialization to allow connecting to the dropbear server, hence the custom run_sample_scripts method.

---
 support/testing/tests/package/sample_python_scp.py | 10 +++++++++
 support/testing/tests/package/test_python_scp.py   | 24 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)
support/testing/tests/package/sample_python_scp.py new file +10 -0
new file mode 100644
index 0000000000000000000000000000000000000000..fdb4b720a9e6346a650e6d90120c598af9f2988d
@@ -0,0 +1,10 @@
+from paramiko import SSHClient
+from paramiko.client import AutoAddPolicy
+from scp import SCPClient
+
+ssh_client = SSHClient()
+ssh_client.load_system_host_keys()
+ssh_client.set_missing_host_key_policy(AutoAddPolicy)
+ssh_client.connect('127.0.0.1', username='root')
+scp_client = SCPClient(ssh_client.get_transport())
+scp_client.get("/etc/hostname", "/tmp/hostname")
support/testing/tests/package/test_python_scp.py new file +24 -0
new file mode 100644
index 0000000000000000000000000000000000000000..2cb4f1e67e6e74c643167f4c621e18895d36e6f6
@@ -0,0 +1,24 @@
+import os
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonSCP(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_DROPBEAR=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_SCP=y
+        """
+    sample_scripts = ["tests/package/sample_python_scp.py"]
+
+    def run_sample_scripts(self):
+        # Allow passwordless root login in SSH server
+        output, exit_code = self.emulator.run('mkdir /root/.ssh')
+        output, exit_code = self.emulator.run('dropbearkey -t ed25519 -f .ssh/id_dropbear')
+        output, exit_code = self.emulator.run('dropbearkey -y -f .ssh/id_dropbear|grep "^ssh-ed25519" > .ssh/authorized_keys')
+        output, exit_code = self.emulator.run('dropbearconvert dropbear openssh .ssh/id_dropbear .ssh/id_ed25519')
+
+        for script in self.sample_scripts:
+            cmd = self.interpreter + " " + os.path.basename(script)
+            self.assertRunOk(cmd, timeout=self.timeout)
Signature · 6 lines
2.51.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot