Skip to content
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

Add debian packaging files #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SCOTT-HAMILTON
Copy link

@SCOTT-HAMILTON SCOTT-HAMILTON commented Jul 12, 2023

This PR is a starting point for packaging all the parallel-ssh ecosystem to debian, the end goal being to have a python3-parallel-ssh package.
I've already started working on parallel-ssh and ssh-python so those are coming next.

I had to disable one test: tests/test_sftp.py:test_mkdir in order to make it build locally, otherwise I had this error:

======================================================================
ERROR: test_mkdir (tests.test_sftp.SFTPTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/patrick/Packaging/ssh2-python/python3-ssh2-1.0.0/.pybuild/cpython3_3.8_ssh2-python/build/tests/test_sftp.py", line 311, in test_mkdir
    sftp.mkdir(_path, mode)
  File "ssh2/sftp.pyx", line 352, in ssh2.sftp.SFTP.mkdir
  File "ssh2/utils.pyx", line 192, in ssh2.utils.handle_error_codes
ssh2.exceptions.SFTPProtocolError

----------------------------------------------------------------------

This builds fine locally, the steps are as follow (on a debian machine with buildessentials and debhelper installed, and maybe more):

# We copy the debian folder but we want to build with the 1.0.0 tree
git clone https://github.com/SCOTT-HAMILTON/ssh2-python
mv ssh2-python/debian .
rm -rf ssh2-python

# we get the 1.0.0 tree
wget https://github.com/ParallelSSH/ssh2-python/archive/refs/tags/1.0.0.tar.gz
tar -xf 1.0.0.tar.gz
mv ssh2-python-1.0.0/ python3-ssh2-1.0.0
mv debian python3-ssh2-1.0.0

# we make the tar file
tar -czf python3-ssh2_1.0.0.orig.tar.gz python3-ssh2-1.0.0

# we install the build deps
cd python3-ssh2-1.0.0
sudo mk-build-deps --install debian/control
rm -f python3-ssh2-build-deps_1.0.0-1_all.deb

# and we finally build
debuild -us -uc

This works for me locally on ZorinOS 16.2 but I can't make it work on SUSE's OpenBuildService see https://build.opensuse.org/package/show/home:ScottHamilton/python3-ssh2 and the build logs on the debian machine: https://build.opensuse.org/public/build/home:ScottHamilton/Debian_Testing/x86_64/python3-ssh2/_log.

Contrary to locally, on the OBS, almost all the remaining tests fail with the same error ssh2.exceptions.KexFailureError. I don't really no much about ssh2 internals so I have no idea what could go wrong on OBS and also on the tests that I've disabled (which I've skipped because they were running into ssh2.exceptions.AgentConnectionError: Unable to connect to agent)

I've noticed that the tests don't buid locally if the working directory is under /tmp. Maybe this is why the OBS build is failing, very strange ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant